The RSS Sensor class implementing the carla::client::Sensor interface This class is a proxy to the RssCheck class. More...
#include <RssSensor.h>
Public Types | |
using | ActorConstellationCallbackFunctionType = std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr<::carla::rss::ActorConstellationData >)> |
Public Types inherited from carla::client::Sensor | |
using | CallbackFunctionType = std::function< void(SharedPtr< sensor::SensorData >)> |
Public Member Functions | |
void | AppendRoutingTarget (const ::carla::geom::Transform &routing_target) |
appends a routing target to the current routing target list ( More... | |
void | DropRoute () |
drop the current route ( More... | |
const ::ad::rss::world::RssDynamics & | GetEgoVehicleDynamics () const |
const ::ad::rss::world::RssDynamics & | GetOtherVehicleDynamics () const |
const ::ad::rss::world::RssDynamics & | GetPedestrianDynamics () const |
const ::carla::rss::RoadBoundariesMode & | GetRoadBoundariesMode () const |
const std::vector<::carla::geom::Transform > | GetRoutingTargets () const |
bool | IsListening () const override |
Return whether this Sensor instance is currently listening to the associated sensor in the simulator. More... | |
void | Listen (CallbackFunctionType callback) override |
Register a callback to be executed each time a new measurement is received. More... | |
void | RegisterActorConstellationCallback (ActorConstellationCallbackFunctionType callback) |
Register a callback to be executed for each actor within each measurement to be processed to decide on the operation of the RSS sensor in respect to the ego vehicle to actor constellation. More... | |
void | ResetRoutingTargets () |
resets the current routing target ( More... | |
RssSensor (ActorInitializer init) | |
constructor More... | |
void | SetEgoVehicleDynamics (const ::ad::rss::world::RssDynamics &ego_dynamics) |
sets the ego vehicle dynamics to be used by the ego vehicle ( More... | |
void | SetLogLevel (const uint8_t &log_level) |
sets the current log level More... | |
void | SetMapLogLevel (const uint8_t &map_log_level) |
sets the current map log level More... | |
void | SetOtherVehicleDynamics (const ::ad::rss::world::RssDynamics &other_vehicle_dynamics) |
sets the ego vehicle dynamics to be used by other vehicles ( More... | |
void | SetPedestrianDynamics (const ::ad::rss::world::RssDynamics &pedestrian_dynamics) |
sets the ego vehicle dynamics to be used by pedestrians ( More... | |
void | SetRoadBoundariesMode (const ::carla::rss::RoadBoundariesMode &road_boundaries_mode) |
sets the current mode for respecting the road boundaries ( More... | |
void | Stop () override |
Stop listening for new measurements. More... | |
~RssSensor () | |
destructor More... | |
Public Member Functions inherited from carla::client::Actor | |
Actor (ActorInitializer init) | |
void | AddAngularImpulse (const geom::Vector3D &vector) |
Add angular impulse to the actor. More... | |
void | AddForce (const geom::Vector3D &force) |
Add force to the actor at its center of mass. More... | |
void | AddForce (const geom::Vector3D &force, const geom::Vector3D &location) |
Add force to the actor at certain location. More... | |
void | AddImpulse (const geom::Vector3D &vector) |
Add impulse to the actor at its center of mass. More... | |
void | AddImpulse (const geom::Vector3D &impulse, const geom::Vector3D &location) |
Add impulse to the actor at certain location. More... | |
void | AddTorque (const geom::Vector3D &vector) |
Add a torque to the actor. More... | |
virtual bool | Destroy () |
Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. More... | |
void | DisableConstantVelocity () |
Disable the constant velocity mode. More... | |
void | EnableConstantVelocity (const geom::Vector3D &vector) |
Enable a constant velocity mode. More... | |
geom::Vector3D | GetAcceleration () const |
Return the current 3D acceleration of the actor. More... | |
rpc::ActorState | GetActorState () const |
geom::Vector3D | GetAngularVelocity () const |
Return the current 3D angular velocity of the actor. More... | |
geom::Location | GetLocation () const |
Return the current location of the actor. More... | |
geom::Transform | GetTransform () const |
Return the current transform of the actor. More... | |
geom::Vector3D | GetVelocity () const |
Return the current 3D velocity of the actor. More... | |
bool | IsActive () const |
bool | IsAlive () const |
bool | IsDormant () const |
const auto & | Serialize () const |
void | SetActorDead () |
Set actor as dead and starts his life span. More... | |
void | SetCollisions (bool enabled=true) |
Enable or disable collisions on this actor. More... | |
void | SetEnableGravity (bool enabled=true) |
Enable or disable gravity on this actor. More... | |
void | SetLocation (const geom::Location &location) |
Teleport the actor to location. More... | |
void | SetSimulatePhysics (bool enabled=true) |
Enable or disable physics simulation on this actor. More... | |
void | SetTargetAngularVelocity (const geom::Vector3D &vector) |
Set the angular velocity of the actor before applying physics. More... | |
void | SetTargetVelocity (const geom::Vector3D &vector) |
Set the actor velocity before applying physics. More... | |
void | SetTransform (const geom::Transform &transform) |
Teleport and rotate the actor to transform. More... | |
virtual | ~Actor ()=default |
Public Member Functions inherited from carla::client::detail::ActorState | |
const std::vector< ActorAttributeValue > & | GetAttributes () const |
const std::string & | GetDisplayId () const |
ActorId | GetId () const |
SharedPtr< Actor > | GetParent () const |
ActorId | GetParentId () const |
const std::vector< uint8_t > & | GetSemanticTags () const |
const std::string & | GetTypeId () const |
World | GetWorld () const |
Private Member Functions | |
void | TickRssSensor (const client::Timestamp ×tamp, CallbackFunctionType callback) |
the acutal sensor tick callback function More... | |
void | TickRssSensorThreadLocked (const client::Timestamp ×tamp, SharedPtr< carla::client::ActorList > actors, CallbackFunctionType callback) |
Private Attributes | |
bool | _drop_route |
reqired to store DropRoute() requests until next sensor tick More... | |
std::size_t | _last_processed_frame |
last processed frame More... | |
std::size_t | _on_tick_register_id |
the id got when registering for the on tick event More... | |
std::mutex | _processing_lock |
the mutex to protect the actual RSS processing and in case it takes too long to process ever frame More... | |
ActorConstellationCallbackFunctionType | _rss_actor_constellation_callback |
std::shared_ptr<::carla::rss::RssCheck > | _rss_check |
std::list< double > | _rss_check_timings |
some debug timings More... | |
std::future< void > | _tick_future |
the future for the async ticking thread More... | |
Static Private Attributes | |
static std::atomic_uint | _global_map_initialization_counter_ {0u} |
Additional Inherited Members | |
Protected Member Functions inherited from carla::client::detail::ActorState | |
ActorState (rpc::Actor description, EpisodeProxy episode) | |
const rpc::Actor & | GetActorDescription () const |
const geom::BoundingBox & | GetBoundingBox () const |
EpisodeProxy & | GetEpisode () |
const EpisodeProxy & | GetEpisode () const |
The RSS Sensor class implementing the carla::client::Sensor interface This class is a proxy to the RssCheck class.
Definition at line 45 of file LibCarla/source/carla/rss/RssSensor.h.
using carla::client::RssSensor::ActorConstellationCallbackFunctionType = std::function<::carla::rss::ActorConstellationResult(carla::SharedPtr<::carla::rss::ActorConstellationData>)> |
Definition at line 50 of file LibCarla/source/carla/rss/RssSensor.h.
|
explicit |
constructor
Definition at line 27 of file LibCarla/source/carla/rss/RssSensor.cpp.
carla::client::RssSensor::~RssSensor | ( | ) |
destructor
Definition at line 29 of file LibCarla/source/carla/rss/RssSensor.cpp.
References IsListening(), and Stop().
void carla::client::RssSensor::AppendRoutingTarget | ( | const ::carla::geom::Transform & | routing_target | ) |
appends a routing target to the current routing target list (
Definition at line 263 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::DropRoute | ( | ) |
drop the current route (
Definition at line 290 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _drop_route.
const ::ad::rss::world::RssDynamics & carla::client::RssSensor::GetEgoVehicleDynamics | ( | ) | const |
Definition at line 157 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::rss::RssCheck::GetDefaultVehicleDynamics(), carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
const ::ad::rss::world::RssDynamics & carla::client::RssSensor::GetOtherVehicleDynamics | ( | ) | const |
Definition at line 186 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::rss::RssCheck::GetDefaultVehicleDynamics(), carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
const ::ad::rss::world::RssDynamics & carla::client::RssSensor::GetPedestrianDynamics | ( | ) | const |
Definition at line 215 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::rss::RssCheck::GetDefaultPedestrianDynamics(), carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
const ::carla::rss::RoadBoundariesMode & carla::client::RssSensor::GetRoadBoundariesMode | ( | ) | const |
Definition at line 244 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::rss::RssCheck::GetDefaultRoadBoundariesMode(), carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
const std::vector<::carla::geom::Transform > carla::client::RssSensor::GetRoutingTargets | ( | ) | const |
Definition at line 272 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
|
inlineoverridevirtual |
Return whether this Sensor instance is currently listening to the associated sensor in the simulator.
Implements carla::client::Sensor.
Definition at line 77 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by Listen(), RegisterActorConstellationCallback(), Stop(), and ~RssSensor().
|
overridevirtual |
Register a callback to be executed each time a new measurement is received.
Implements carla::client::Sensor.
Definition at line 46 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _global_map_initialization_counter_, _last_processed_frame, _on_tick_register_id, _rss_actor_constellation_callback, _rss_check, DEBUG_ASSERT, carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetEpisode(), carla::client::World::GetMap(), carla::client::detail::ActorState::GetParent(), carla::client::detail::ActorState::GetWorld(), IsListening(), carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::log_debug(), carla::log_error(), carla::throw_exception(), and TrafficLight.
void carla::client::RssSensor::RegisterActorConstellationCallback | ( | ActorConstellationCallbackFunctionType | callback | ) |
Register a callback to be executed for each actor within each measurement to be processed to decide on the operation of the RSS sensor in respect to the ego vehicle to actor constellation.
Definition at line 36 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, carla::client::detail::ActorState::GetDisplayId(), IsListening(), and carla::log_error().
void carla::client::RssSensor::ResetRoutingTargets | ( | ) |
resets the current routing target (
Definition at line 281 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetEgoVehicleDynamics | ( | const ::ad::rss::world::RssDynamics & | ego_dynamics | ) |
sets the ego vehicle dynamics to be used by the ego vehicle (
Definition at line 172 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetLogLevel | ( | const uint8_t & | log_level | ) |
sets the current log level
Definition at line 135 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetMapLogLevel | ( | const uint8_t & | map_log_level | ) |
sets the current map log level
Definition at line 146 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetOtherVehicleDynamics | ( | const ::ad::rss::world::RssDynamics & | other_vehicle_dynamics | ) |
sets the ego vehicle dynamics to be used by other vehicles (
Definition at line 201 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetPedestrianDynamics | ( | const ::ad::rss::world::RssDynamics & | pedestrian_dynamics | ) |
sets the ego vehicle dynamics to be used by pedestrians (
Definition at line 230 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_actor_constellation_callback, _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
void carla::client::RssSensor::SetRoadBoundariesMode | ( | const ::carla::rss::RoadBoundariesMode & | road_boundaries_mode | ) |
sets the current mode for respecting the road boundaries (
Definition at line 254 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _rss_check, carla::client::detail::ActorState::GetDisplayId(), and carla::log_error().
|
overridevirtual |
Stop listening for new measurements.
Be aware: GIL has to be unlocked to be able to wait for callbacks not active.
Implements carla::client::Sensor.
Definition at line 105 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _global_map_initialization_counter_, _on_tick_register_id, _processing_lock, _rss_check, carla::client::detail::ActorState::GetDisplayId(), carla::client::detail::ActorState::GetEpisode(), IsListening(), carla::client::detail::EpisodeProxyImpl< PointerT >::Lock(), carla::log_debug(), and carla::log_error().
Referenced by ~RssSensor().
|
private |
the acutal sensor tick callback function
Definition at line 296 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _last_processed_frame, _processing_lock, _rss_check, _tick_future, carla::client::Timestamp::frame, carla::client::World::GetActors(), carla::client::World::GetSettings(), carla::client::detail::ActorState::GetWorld(), and TickRssSensorThreadLocked().
|
private |
Definition at line 327 of file LibCarla/source/carla/rss/RssSensor.cpp.
References _drop_route, _processing_lock, _rss_check, _rss_check_timings, carla::client::Timestamp::elapsed_seconds, carla::client::Timestamp::frame, carla::client::detail::ActorState::GetParent(), and carla::client::Actor::GetTransform().
Referenced by TickRssSensor().
|
private |
reqired to store DropRoute() requests until next sensor tick
Definition at line 153 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by DropRoute(), and TickRssSensorThreadLocked().
|
staticprivate |
Definition at line 158 of file LibCarla/source/carla/rss/RssSensor.h.
|
private |
last processed frame
Definition at line 156 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by Listen(), and TickRssSensor().
|
private |
the id got when registering for the on tick event
Definition at line 138 of file LibCarla/source/carla/rss/RssSensor.h.
|
private |
the mutex to protect the actual RSS processing and in case it takes too long to process ever frame
Definition at line 141 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by Stop(), TickRssSensor(), and TickRssSensorThreadLocked().
|
private |
Definition at line 150 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by GetEgoVehicleDynamics(), GetOtherVehicleDynamics(), GetPedestrianDynamics(), Listen(), RegisterActorConstellationCallback(), SetEgoVehicleDynamics(), SetOtherVehicleDynamics(), and SetPedestrianDynamics().
|
private |
Definition at line 135 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by AppendRoutingTarget(), GetEgoVehicleDynamics(), GetOtherVehicleDynamics(), GetPedestrianDynamics(), GetRoadBoundariesMode(), GetRoutingTargets(), Listen(), ResetRoutingTargets(), SetEgoVehicleDynamics(), SetLogLevel(), SetMapLogLevel(), SetOtherVehicleDynamics(), SetPedestrianDynamics(), SetRoadBoundariesMode(), Stop(), TickRssSensor(), and TickRssSensorThreadLocked().
|
private |
some debug timings
Definition at line 147 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by TickRssSensorThreadLocked().
|
private |
the future for the async ticking thread
Definition at line 144 of file LibCarla/source/carla/rss/RssSensor.h.
Referenced by TickRssSensor().