A sensor to register collisions. 更多...
#include <CollisionSensor.h>
Public 成员函数 | |
ACollisionSensor (const FObjectInitializer &ObjectInitializer) | |
void | OnActorCollisionEvent (AActor *Actor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit) |
void | OnCollisionEvent (AActor *Actor, AActor *OtherActor, FVector NormalImpulse, const FHitResult &Hit) |
void | OnComponentCollisionEvent (UPrimitiveComponent *HitComp, AActor *OtherActor, UPrimitiveComponent *OtherComp, FVector NormalImpulse, const FHitResult &Hit) |
virtual void | PrePhysTick (float DeltaSeconds) override |
void | SetOwner (AActor *NewOwner) override |
Public 成员函数 继承自 ASensor | |
ASensor (const FObjectInitializer &ObjectInitializer) | |
virtual void | BeginPlay () |
boost::optional< FActorAttribute > | GetAttribute (const FString Name) |
const UCarlaEpisode & | GetEpisode () const |
URandomEngine * | GetRandomEngine () |
int32 | GetSeed () const |
auto | GetToken () const |
Return the token that allows subscribing to this sensor's stream. | |
bool | IsStreamReady () |
FDataStream | MoveDataStream () |
virtual void | OnFirstClientConnected () |
virtual void | OnLastClientDisconnected () |
virtual void | PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
void | PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
virtual void | Set (const FActorDescription &Description) |
void | SetDataStream (FDataStream InStream) |
Replace the FDataStream associated with this sensor. | |
void | SetEpisode (const UCarlaEpisode &InEpisode) |
void | SetSeed (int32 InSeed) |
void | Tick (const float DeltaTime) final |
静态 Public 成员函数 | |
static FActorDefinition | GetSensorDefinition () |
Private 属性 | |
std::vector< std::tuple< uint64_t, AActor *, AActor * > > | CollisionRegistry |
Registry that saves all collisions. | |
额外继承的成员函数 | |
Protected 成员函数 继承自 ASensor | |
void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
template<typename SensorT > | |
FAsyncDataStream | GetDataStream (const SensorT &Self) |
Return the FDataStream associated with this sensor. | |
void | PostActorCreated () override |
Protected 属性 继承自 ASensor | |
bool | bIsActive = false |
URandomEngine * | RandomEngine = nullptr |
Random Engine used to provide noise for sensor output. | |
int32 | Seed = 123456789 |
Seed of the pseudo-random engine. | |
A sensor to register collisions.
在文件 CollisionSensor.h 第 19 行定义.
ACollisionSensor::ACollisionSensor | ( | const FObjectInitializer & | ObjectInitializer | ) |
在文件 CollisionSensor.cpp 第 20 行定义.
|
static |
在文件 CollisionSensor.cpp 第 26 行定义.
引用了 UActorBlueprintFunctionLibrary::MakeGenericSensorDefinition().
void ACollisionSensor::OnCollisionEvent | ( | AActor * | Actor, |
AActor * | OtherActor, | ||
FVector | NormalImpulse, | ||
const FHitResult & | Hit ) |
在文件 CollisionSensor.cpp 第 80 行定义.
引用了 Collision, CollisionRegistry, carla::streaming::detail::token_type::get_stream_id(), ASensor::GetDataStream(), ASensor::GetEpisode(), FCarlaEngine::GetFrameCounter(), carla::ros2::ROS2::GetInstance(), ASensor::GetToken(), IsValid() , 以及 FAsyncDataStreamTmpl< T >::SerializeAndSend().
被这些函数引用 OnActorCollisionEvent() , 以及 OnComponentCollisionEvent().
void ACollisionSensor::OnComponentCollisionEvent | ( | UPrimitiveComponent * | HitComp, |
AActor * | OtherActor, | ||
UPrimitiveComponent * | OtherComp, | ||
FVector | NormalImpulse, | ||
const FHitResult & | Hit ) |
|
overridevirtual |
重载 ASensor .
在文件 CollisionSensor.cpp 第 64 行定义.
引用了 CollisionRegistry , 以及 FCarlaEngine::GetFrameCounter().
|
override |
在文件 CollisionSensor.cpp 第 33 行定义.
引用了 IsValid(), OnActorCollisionEvent(), OnComponentCollisionEvent() , 以及 Vehicle.
Registry that saves all collisions.
Used to avoid sending the same collision more than once per frame, as the collision sensor uses the PhysX substepping tick. Helps with sensor usage and stream overload.
在文件 CollisionSensor.h 第 57 行定义.
被这些函数引用 OnCollisionEvent() , 以及 PrePhysTick().