22 "sensor object went out of the scope but the sensor is still alive",
33 }
catch (
const std::exception &e) {
42 GetEpisode().
Lock()->SubscribeToSensor(*
this, std::move(callback));
50 "attempting to unsubscribe from stream but sensor wasn't listening:",
63 log_warning(
"GBuffer methods are not supported on non-RGB sensors (sensor.camera.rgb).");
66 GetEpisode().
Lock()->SubscribeToGBuffer(*
this, GBufferId, std::move(callback));
76 log_warning(
"GBuffer methods are not supported on non-RGB sensors (sensor.camera.rgb).");
void Listen(CallbackFunctionType callback) override
Register a callback to be executed each time a new measurement is received.
std::bitset< 16 > listening_mask
static void log_error(Args &&... args)
This file contains definitions of common data structures used in traffic manager. ...
void EnableForROS()
Enable this sensor for ROS2 publishing.
void ListenToGBuffer(uint32_t GBufferId, CallbackFunctionType callback)
Listen fr.
EpisodeProxy & GetEpisode()
static bool IsValid(const ACarlaWheeledVehicle *Vehicle)
bool IsListening() const override
Return whether this Sensor instance is currently listening to the associated sensor in the simulator...
static void log_debug(Args &&...)
const std::string & GetDisplayId() const
void DisableForROS()
Disable this sensor for ROS2 publishing.
#define RELEASE_ASSERT(pred)
virtual bool Destroy()
Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed...
static void log_warning(Args &&... args)
bool IsEnabledForROS()
Return if the sensor is publishing for ROS2.
bool Destroy() override
Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed...
std::function< void(SharedPtr< sensor::SensorData >)> CallbackFunctionType
SharedPtrType Lock() const
Same as TryLock but never return nullptr.
void StopGBuffer(uint32_t GBufferId)
Stop listening for a specific gbuffer stream.
constexpr size_t GBufferTextureCount
void Stop() override
Stop listening for new measurements.
const rpc::Actor & GetActorDescription() const