26 "sensor object went out of the scope but the sensor is still alive",
39 }
catch (
const std::exception &e) {
50 GetEpisode().
Lock()->SubscribeToSensor(*
this, std::move(callback));
60 "attempting to unsubscribe from stream but sensor wasn't listening:",
76 log_warning(
"Send methods are not supported on non-V2x sensors (sensor.other.v2x_custom).");
92 log_warning(
"GBuffer methods are not supported on non-RGB sensors (sensor.camera.rgb).");
96 GetEpisode().
Lock()->SubscribeToGBuffer(*
this, GBufferId, std::move(callback));
111 log_warning(
"GBuffer methods are not supported on non-RGB sensors (sensor.camera.rgb).");
151 return Actor::Destroy();
#define RELEASE_ASSERT(pred)
constexpr size_t GBufferTextureCount
static bool IsValid(const ACarlaWheeledVehicle *Vehicle)
std::function< void(SharedPtr< sensor::SensorData >)> CallbackFunctionType
回调函数的类型别名,用于接收传感器数据。
bool IsEnabledForROS()
如果传感器正在为 ROS2 发布,则返回
void EnableForROS()
启用此传感器以进行 ROS2 发布
std::bitset< 16 > listening_mask
void ListenToGBuffer(uint32_t GBufferId, CallbackFunctionType callback)
监听 fr
void Send(std::string message)
通过该传感器发送数据
void Stop() override
停止监听新的测量结果。
void DisableForROS()
禁用此传感器以进行 ROS2 发布
bool IsListening() const override
返回此传感器实例当前是否正在监听模拟器中的相关传感器。
void Listen(CallbackFunctionType callback) override
注册一个 回调,每次收到新的测量值时执行。
void StopGBuffer(uint32_t GBufferId)
停止监听特定的 gbuffer 流。
EpisodeProxy & GetEpisode()
const rpc::Actor & GetActorDescription() const
const std::string & GetDisplayId() const
SharedPtrType Lock() const
与 TryLock 相同,但永远不会返回 nullptr。
static void log_error(Args &&... args)
static void log_warning(Args &&... args)
static void log_debug(Args &&... args)