|
CARLA
|
Vehicle status sensor ("sensor.other.vehicle_status"): attached to a vehicle, streams a packed kinematic + control state snapshot each tick and forwards it to the ROS2 side, where it feeds the six Autoware /vehicle/status/* report publishers. More...
#include <VehicleStatusSensor.h>
Inheritance diagram for AVehicleStatusSensor:Public Member Functions | |
| AVehicleStatusSensor (const FObjectInitializer &ObjectInitializer) | |
| virtual void | PostPhysTick (UWorld *World, ELevelTick TickType, float DeltaSeconds) override |
| virtual void | Set (const FActorDescription &ActorDescription) override |
Public Member Functions inherited from ASensor | |
| bool | AreClientsListening () |
| ASensor (const FObjectInitializer &ObjectInitializer) | |
| void | ClearReadyToTick () |
| std::optional< FActorAttribute > | GetAttribute (const FString Name) |
| const UCarlaEpisode & | GetEpisode () const |
| virtual void | GetMirrorState (carla::multigpu::SensorState &State) const |
| Multi-GPU: the runtime state this sensor starts its next tick from (noise generator, sweep angle, history). | |
| URandomEngine * | GetRandomEngine () |
| float | GetReadyToTickDeltaSeconds () const |
| int32 | GetSeed () const |
| auto | GetToken () const |
| Return the token that allows subscribing to this sensor's stream. | |
| bool | IsReadyToTick () const |
| bool | IsStreamReady () |
| FDataStream | MoveDataStream () |
| virtual void | OnFirstClientConnected () |
| virtual void | OnLastClientDisconnected () |
| void | PostPhysTickInternal (UWorld *World, ELevelTick TickType, float DeltaSeconds) |
| virtual void | PrePhysTick (float DeltaSeconds) |
| void | SetDataStream (FDataStream InStream) |
| Replace the FDataStream associated with this sensor. | |
| void | SetEpisode (const UCarlaEpisode &InEpisode) |
| virtual void | SetMirrorState (const carla::multigpu::SensorState &State) |
| void | SetPrimaryTick (float DeltaSeconds) |
| Multi-GPU secondary: tick in this engine frame, with the primary's delta. | |
| void | SetSavingDataToDisk (bool bSavingData) |
| void | SetSeed (int32 InSeed) |
| void | Tick (const float DeltaTime) final |
Static Public Member Functions | |
| static FActorDefinition | GetSensorDefinition () |
Static Public Member Functions inherited from ASensor | |
| static FSensorCaptureContext | MakeCaptureContext (const ASensor &Sensor) |
| Call on the game thread right after CaptureScene(). | |
Protected Member Functions | |
| virtual void | BeginPlay () override |
Protected Member Functions inherited from ASensor | |
| void | EndPlay (EEndPlayReason::Type EndPlayReason) override |
| template<typename SensorType > | |
| FAsyncDataStream | GetDataStream (SensorType &&Self) |
| Return the FDataStream associated with this sensor. | |
| void | PostActorCreated () override |
Protected Attributes | |
| float | MaxRateHz = 1000.0f |
| float | MinRateHz = 1.0f |
| float | TargetRateHz = 30.0f |
Protected Attributes inherited from ASensor | |
| bool | bIsActive = false |
| bool | bSavingDataToDisk = false |
| URandomEngine * | RandomEngine = nullptr |
| Random Engine used to provide noise for sensor output. | |
| int32 | Seed = 123456789 |
| Seed of the pseudo-random engine. | |
Private Member Functions | |
| void | CheckForParentVehicle () |
| void | CollectAndStream (float DeltaSeconds) |
| TObjectPtr< ACarlaWheeledVehicle > | FindAttachmentParentVehicle () const |
| void | SetVelocityInfoToLocal (const AActor *VehicleActor) |
Static Private Member Functions | |
| template<typename T > | |
| static FORCEINLINE T | CmpsToMps (const T &v_cmps) |
Private Attributes | |
| FTimerHandle | CheckParentTimerHandle |
| TWeakObjectPtr< ACarlaWheeledVehicle > | OwningVehicle |
| FVelocityInfo | VelocityInfo |
Additional Inherited Members | |
Static Protected Member Functions inherited from ASensor | |
| template<typename SensorType , typename ElementType > | |
| static void | SendDataToClient (SensorType &&Sensor, TArrayView< ElementType > SensorData, const FSensorCaptureContext &CaptureContext) |
Vehicle status sensor ("sensor.other.vehicle_status"): attached to a vehicle, streams a packed kinematic + control state snapshot each tick and forwards it to the ROS2 side, where it feeds the six Autoware /vehicle/status/* report publishers.
Ported from tier4/autoware-support.
Definition at line 65 of file VehicleStatusSensor.h.
|
explicit |
Definition at line 26 of file VehicleStatusSensor.cpp.
References MaxRateHz, MinRateHz, and TargetRateHz.
|
overrideprotectedvirtual |
Reimplemented from ASensor.
Definition at line 46 of file VehicleStatusSensor.cpp.
References CheckForParentVehicle(), and CheckParentTimerHandle.
|
private |
Definition at line 59 of file VehicleStatusSensor.cpp.
References CheckParentTimerHandle, FindAttachmentParentVehicle(), and OwningVehicle.
Referenced by BeginPlay().
|
inlinestaticprivate |
Definition at line 111 of file VehicleStatusSensor.h.
Referenced by SetVelocityInfoToLocal().
|
private |
Definition at line 80 of file VehicleStatusSensor.cpp.
References FVelocityInfo::AngularVelocity, UCarlaEpisode::bIsPrimaryServer, FindAttachmentParentVehicle(), carla::streaming::detail::token_type::get_stream_id(), UCarlaStatics::GetCurrentEpisode(), ASensor::GetDataStream(), carla::ros2::ROS2::GetInstance(), FVelocityInfo::GetSpeed(), ASensor::GetToken(), IsValid(), OwningVehicle, SetVelocityInfoToLocal(), Vehicle, FVelocityInfo::Velocity, and VelocityInfo.
Referenced by PostPhysTick().
|
private |
Definition at line 68 of file VehicleStatusSensor.cpp.
References Vehicle.
Referenced by CheckForParentVehicle(), and CollectAndStream().
|
static |
Definition at line 36 of file VehicleStatusSensor.cpp.
References UActorBlueprintFunctionLibrary::MakeVehicleStatusDefinition().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 53 of file VehicleStatusSensor.cpp.
References CollectAndStream().
|
overridevirtual |
Reimplemented from ASensor.
Definition at line 41 of file VehicleStatusSensor.cpp.
|
private |
Definition at line 169 of file VehicleStatusSensor.cpp.
References FVelocityInfo::AngularVelocity, CarlaGetActorAngularVelocityInRadians(), CmpsToMps(), FVelocityInfo::RotationRate, FVelocityInfo::Velocity, and VelocityInfo.
Referenced by CollectAndStream().
|
private |
Definition at line 101 of file VehicleStatusSensor.h.
Referenced by BeginPlay(), and CheckForParentVehicle().
|
protected |
Definition at line 89 of file VehicleStatusSensor.h.
Referenced by AVehicleStatusSensor().
|
protected |
Definition at line 87 of file VehicleStatusSensor.h.
Referenced by AVehicleStatusSensor().
|
private |
Definition at line 97 of file VehicleStatusSensor.h.
Referenced by CheckForParentVehicle(), and CollectAndStream().
|
protected |
Definition at line 92 of file VehicleStatusSensor.h.
Referenced by AVehicleStatusSensor().
|
private |
Definition at line 98 of file VehicleStatusSensor.h.
Referenced by CollectAndStream(), and SetVelocityInfoToLocal().