CARLA
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
carla::ros2 Namespace Reference

Namespaces

namespace  autoware_steering_compensation
 Ported verbatim from tier4/autoware-support (commit 63e831e85 lineage).
 
namespace  msg
 

Classes

struct  AckermannControl
 
class  AckermannControlSubscriber
 
struct  AckermannControlTraits
 
struct  AutowareControlCmdTraits
 
struct  AutowareControlModeReportTraits
 
class  AutowareControlSubscriber
 
struct  AutowareEmergencyCmdTraits
 
struct  AutowareEngageTraits
 
struct  AutowareGearCmdTraits
 
struct  AutowareGearReportTraits
 
struct  AutowareGnssPoseTraits
 
struct  AutowareGnssPoseWithCovarianceTraits
 
class  AutowareGNSSPublisher
 
struct  AutowareHazardLightsCmdTraits
 
struct  AutowareHazardLightsReportTraits
 
struct  AutowareSteeringReportTraits
 
struct  AutowareTurnIndicatorsCmdTraits
 
struct  AutowareTurnIndicatorsReportTraits
 
class  AutowareVehicleStatusPublisher
 
struct  AutowareVelocityReportTraits
 
class  BasePublisher
 
class  BaseSubscriber
 
class  BasicListener
 
class  BasicListenerImpl
 
class  BasicPublisher
 
struct  BasicPublisherMsgTraits
 
class  BasicSubscriber
 
struct  BasicSubscriberImpl
 
struct  CameraIntrinsics
 
struct  CarlaCameraImageMsgTraits
 
struct  CarlaCameraInfoMsgTraits
 
class  CarlaCameraPublisher
 
struct  CarlaClockMsgTraits
 
class  CarlaClockPublisher
 
struct  CarlaCollisionMsgTraits
 
class  CarlaCollisionPublisher
 
class  CarlaDVSCameraPublisher
 
class  CarlaDVSImagePublisher
 
class  CarlaDVSPointCloudPublisher
 
class  CarlaEgoVehicleControlSubscriber
 
struct  CarlaEgoVehicleControlTraits
 
struct  CarlaGnssMsgTraits
 
class  CarlaGNSSPublisher
 
struct  CarlaImuMsgTraits
 
class  CarlaIMUPublisher
 
class  CarlaLidarPublisher
 
class  CarlaOpticalFlowCameraPublisher
 
struct  CarlaPointCloudMsgTraits
 
class  CarlaPointCloudPublisher
 
class  CarlaRadarPublisher
 
class  CarlaRGBCameraPublisher
 
class  CarlaSemanticLidarPublisher
 
class  CarlaSubscriber
 
struct  CarlaTransformMsgTraits
 
class  CarlaTransformPublisher
 
struct  CdrTopicInfo
 Per-type metadata needed by the middleware layer. More...
 
struct  CdrTopicInfo< msg::AckermannDrive >
 
struct  CdrTopicInfo< msg::AckermannDriveStamped >
 
struct  CdrTopicInfo< msg::CameraInfo >
 
struct  CdrTopicInfo< msg::CarlaCollisionEvent >
 
struct  CdrTopicInfo< msg::CarlaEgoVehicleControl >
 
struct  CdrTopicInfo< msg::CarlaLineInvasion >
 
struct  CdrTopicInfo< msg::Clock >
 
struct  CdrTopicInfo< msg::Control >
 
struct  CdrTopicInfo< msg::ControlModeReport >
 
struct  CdrTopicInfo< msg::Engage >
 
struct  CdrTopicInfo< msg::Float32 >
 
struct  CdrTopicInfo< msg::GearCommand >
 
struct  CdrTopicInfo< msg::GearReport >
 
struct  CdrTopicInfo< msg::HazardLightsCommand >
 
struct  CdrTopicInfo< msg::HazardLightsReport >
 
struct  CdrTopicInfo< msg::Header >
 
struct  CdrTopicInfo< msg::Image >
 
struct  CdrTopicInfo< msg::Imu >
 
struct  CdrTopicInfo< msg::Lateral >
 
struct  CdrTopicInfo< msg::Longitudinal >
 
struct  CdrTopicInfo< msg::NavSatFix >
 
struct  CdrTopicInfo< msg::NavSatStatus >
 
struct  CdrTopicInfo< msg::Odometry >
 
struct  CdrTopicInfo< msg::Point >
 
struct  CdrTopicInfo< msg::Point32 >
 
struct  CdrTopicInfo< msg::PointCloud2 >
 
struct  CdrTopicInfo< msg::PointField >
 
struct  CdrTopicInfo< msg::Pose >
 
struct  CdrTopicInfo< msg::PoseStamped >
 
struct  CdrTopicInfo< msg::PoseWithCovariance >
 
struct  CdrTopicInfo< msg::PoseWithCovarianceStamped >
 
struct  CdrTopicInfo< msg::Quaternion >
 
struct  CdrTopicInfo< msg::RegionOfInterest >
 
struct  CdrTopicInfo< msg::SteeringReport >
 
struct  CdrTopicInfo< msg::String >
 
struct  CdrTopicInfo< msg::TF2Error >
 
struct  CdrTopicInfo< msg::TFMessage >
 
struct  CdrTopicInfo< msg::Time >
 
struct  CdrTopicInfo< msg::Transform >
 
struct  CdrTopicInfo< msg::TransformStamped >
 
struct  CdrTopicInfo< msg::TurnIndicatorsCommand >
 
struct  CdrTopicInfo< msg::TurnIndicatorsReport >
 
struct  CdrTopicInfo< msg::Twist >
 
struct  CdrTopicInfo< msg::TwistWithCovariance >
 
struct  CdrTopicInfo< msg::Vector3 >
 
struct  CdrTopicInfo< msg::VehicleEmergencyStamped >
 
struct  CdrTopicInfo< msg::VelocityReport >
 
struct  DvsEvent
 
class  FastDDSPublisherMiddleware
 FastDDS implementation of IPublisherMiddleware. More...
 
class  FastDDSSharedParticipant
 Refcounted singleton DomainParticipant shared across all FastDDS publishers and subscribers in the process. More...
 
class  FastDDSSubscriberMiddleware
 FastDDS implementation of ISubscriberMiddleware. More...
 
class  GenericCdrPubSubType
 Generic FastDDS TopicDataType that serializes carla::ros2::msg::* POD structs directly to CDR via CdrSerialization.h, without needing fastddsgen-generated per-type PubSubType classes. More...
 
class  IPublisherMiddleware
 Type-erased abstract interface for a publisher middleware. More...
 
class  ISubscriberMiddleware
 Type-erased abstract interface for a subscriber middleware. More...
 
struct  MessageControl
 
class  MiddlewareConfig
 Process-wide runtime configuration shared by every ROS 2 middleware implementation (FastDDS, CycloneDDS, and future ones such as Zenoh). More...
 
class  MiddlewareFactory
 Factory that creates publisher/subscriber middleware based on the active middleware selection. More...
 
struct  MiddlewareParseResult
 Result of parsing a middleware name string. More...
 
struct  PointFieldDescriptor
 
class  PublisherImpl
 
struct  QosProfile
 Middleware-neutral QoS profile passed to IPublisherMiddleware::Init / ISubscriberMiddleware::Init when a topic needs QoS different from the vendor defaults (e.g. More...
 
struct  ResolvedDomainId
 The resolved domain id together with the source it came from. More...
 
class  ROS2
 
class  SubscriberImpl
 
struct  TransformQuaternion
 
struct  VehicleAccelerationControl
 Control decoded from Autoware's /control/command/control_cmd: longitudinal acceleration [m/s^2] + steering (CARLA sign convention, already passed through the AutowareSteeringCompensation LUT). More...
 
struct  VehicleControl
 

Typedefs

using ActorCallback = std::function< void(void *actor, ROS2CallbackData data)>
 
using ActorMessageCallback = std::function< void(void *actor, ROS2MessageCallbackData data)>
 
using CarlaDepthCameraPublisher = CarlaRGBCameraPublisher
 
using CarlaISCameraPublisher = CarlaRGBCameraPublisher
 
using CarlaNormalsCameraPublisher = CarlaRGBCameraPublisher
 
using CarlaSSCameraPublisher = CarlaRGBCameraPublisher
 
using erc = eprosima::fastrtps::types::ReturnCode_t
 
using ROS2CallbackData = std::variant< VehicleControl, AckermannControl, VehicleAccelerationControl >
 
using ROS2MessageCallbackData = std::variant< MessageControl >
 

Enumerations

enum class  ControlMode {
  NO_COMMAND , AUTONOMOUS , AUTONOMOUS_STEER_ONLY , AUTONOMOUS_VELOCITY_ONLY ,
  MANUAL , DISENGAGED , NOT_READY
}
 
enum class  DomainIdSource { CommandLine , Environment , Default }
 Where the effective domain id came from, in priority order. More...
 
enum  ESensors {
  CollisionSensor , DepthCamera , NormalsCamera , DVSCamera ,
  GnssSensor , InertialMeasurementUnit , LaneInvasionSensor , ObstacleDetectionSensor ,
  OpticalFlowCamera , Radar , RayCastSemanticLidar , RayCastLidar ,
  RssSensor , SceneCaptureCamera , SemanticSegmentationCamera , InstanceSegmentationCamera ,
  WorldObserver , SceneCaptureCamera_WideAngleLens , DepthCamera_WideAngleLens , InstanceSegmentationCamera_WideAngleLens ,
  SemanticSegmentationCamera_WideAngleLens , CameraGBufferUint8 , CameraGBufferFloat , HSSLidar ,
  VehicleStatusSensor , AutowareGnssSensor
}
 
enum class  Gear {
  NONE , NEUTRAL , DRIVE , DRIVE_2 ,
  DRIVE_3 , DRIVE_4 , DRIVE_5 , DRIVE_6 ,
  DRIVE_7 , DRIVE_8 , DRIVE_9 , DRIVE_10 ,
  DRIVE_11 , DRIVE_12 , DRIVE_13 , DRIVE_14 ,
  DRIVE_15 , DRIVE_16 , DRIVE_17 , DRIVE_18 ,
  REVERSE , REVERSE_2 , PARK , LOW ,
  LOW_2
}
 
enum class  Middleware { FastDDS , CycloneDDS , Zenoh }
 Enumeration of available middleware implementations. More...
 
enum class  PointFieldDataType : std::uint8_t {
  Int8 = 1 , UInt8 = 2 , Int16 = 3 , UInt16 = 4 ,
  Int32 = 5 , UInt32 = 6 , Float32 = 7 , Float64 = 8
}
 
enum class  TurnIndicatorsStatus { OFF , LEFT , RIGHT }
 

Functions

std::array< float, 3 > AccelToRos (float ax, float ay, float az)
 
std::vector< uint8_t > build_user_data (const char *type_hash)
 Builds the REP-2016 endpoint USER_DATA payload encoding a REP-2011 type hash.
 
template<typename T >
std::vector< uint8_t > build_user_data_for ()
 Convenience: build user_data from the CdrTopicInfo<T>::type_hash() of T.
 
template<typename T >
uint32_t cdr_serialized_size (const T &msg)
 Return the exact CDR-serialized size in bytes for a message instance, including the 4-byte DDS encapsulation header.
 
CameraIntrinsics ComputeIntrinsics (uint32_t width, uint32_t height, float fov_degrees) noexcept
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::AckermannDrive &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::AckermannDriveStamped &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::CameraInfo &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::CarlaCollisionEvent &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::CarlaEgoVehicleControl &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::CarlaLineInvasion &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Clock &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Control &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::ControlModeReport &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Engage &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Float32 &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::GearCommand &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::GearReport &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::HazardLightsCommand &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::HazardLightsReport &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Header &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Image &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Imu &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Lateral &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Longitudinal &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::NavSatFix &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::NavSatStatus &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Odometry &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Point &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Point32 &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::PointCloud2 &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::PointField &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Pose &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::PoseStamped &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::PoseWithCovariance &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::PoseWithCovarianceStamped &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Quaternion &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::RegionOfInterest &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::SteeringReport &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::String &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TF2Error &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TFMessage &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Time &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Transform &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TransformStamped &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TurnIndicatorsCommand &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TurnIndicatorsReport &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Twist &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::TwistWithCovariance &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::Vector3 &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::VehicleEmergencyStamped &m)
 
void deserialize_cdr (eprosima::fastcdr::Cdr &cdr, msg::VelocityReport &m)
 
template<typename T >
bool deserialize_from_cdr (const uint8_t *data, size_t size, T &msg)
 Deserialize a msg::X from a CDR byte buffer that was produced by serialize_to_cdr() or by any ROS2-compatible DDS middleware.
 
std::vector< std::uint8_t > EncodeDvsEventsToBgr (std::uint32_t height, std::uint32_t width, const DvsEvent *events, std::size_t event_count)
 
std::vector< std::uint8_t > EncodeDvsEventsToBgr (std::uint32_t height, std::uint32_t width, const std::uint8_t *raw_events, std::size_t event_count, std::size_t event_stride)
 
std::vector< std::uint8_t > EncodeDvsEventsToPointCloud (const DvsEvent *events, std::size_t event_count)
 
std::vector< std::uint8_t > EncodeDvsEventsToPointCloud (const std::uint8_t *raw_events, std::size_t event_count, std::size_t event_stride)
 
std::vector< uint8_t > EncodeFlowImageToBgra (uint32_t height, uint32_t width, const float *data)
 
std::array< uint8_t, 4 > EncodeFlowPixelToBgra (float vx, float vy) noexcept
 
AckermannControl FromAckermannDrive (float steering_angle, float steering_angle_velocity, float speed, float acceleration, float jerk)
 
std::string GetAvailableMiddleware ()
 
std::string GetAvailableMiddlewareString ()
 Return a readable list of middleware implementations compiled into this binary.
 
std::array< float, 3 > GyroToRos (float gx, float gy, float gz)
 
bool IsValidDomainId (int id)
 
MiddlewareParseResult MiddlewareFromString (const std::string &name)
 Parse a middleware name string (lowercase).
 
const char * MiddlewareToString (Middleware middleware)
 Convert a Middleware enum value to a readable string.
 
std::array< float, 4 > OrientationFromCompass (float compass)
 
std::array< float, 3 > RadarPolarToCartesian (float depth, float azimuth, float altitude) noexcept
 
ResolvedDomainId ResolveDomainId (int cli_value, const char *env_value)
 Resolve the effective domain id from a command line value and an environment value, in priority order:
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::AckermannDrive &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::AckermannDriveStamped &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::CameraInfo &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::CarlaCollisionEvent &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::CarlaEgoVehicleControl &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::CarlaLineInvasion &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Clock &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Control &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::ControlModeReport &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Engage &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Float32 &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::GearCommand &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::GearReport &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::HazardLightsCommand &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::HazardLightsReport &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Header &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Image &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Imu &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Lateral &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Longitudinal &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::NavSatFix &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::NavSatStatus &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Odometry &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Point &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Point32 &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::PointCloud2 &m)
 PointCloud2::fields is a sequence of structs; FastCDR's generic vector operator calls serialize() on each element, which our POD types don't provide.
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::PointField &m)
 PointField: name is a string; offset, datatype, count are primitives.
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Pose &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::PoseStamped &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::PoseWithCovariance &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::PoseWithCovarianceStamped &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Quaternion &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::RegionOfInterest &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::SteeringReport &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::String &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TF2Error &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TFMessage &m)
 TFMessage::transforms is a sequence of TransformStamped structs.
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Time &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Transform &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TransformStamped &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TurnIndicatorsCommand &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TurnIndicatorsReport &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Twist &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::TwistWithCovariance &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::Vector3 &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::VehicleEmergencyStamped &m)
 
void serialize_cdr (eprosima::fastcdr::Cdr &cdr, const msg::VelocityReport &m)
 
template<typename T >
std::vector< uint8_t > serialize_to_cdr (const T &msg)
 Serialize a msg::X to a CDR byte buffer including the DDS encapsulation header (Classic CDR, encoding version 1, little-endian).
 
ResolvedDomainId SetActiveDomainId (int domain_id)
 Store the domain id in the shared library's MiddlewareConfig and return the effective domain id resolved there, so carla-server can log the value the middlewares will actually use.
 
bool SetActiveMiddleware (Middleware requested)
 DDS-free bridge for selecting the active middleware across the shared-library boundary.
 
std::string ToROS2TypeName (const std::string &type_name)
 Mangle a type name into the ROS2-compatible format.
 
TransformQuaternion TransformFromCarlaRotation (float tx, float ty, float tz, float pitch_deg, float yaw_deg, float roll_deg) noexcept
 
bool TryParseDomainId (const char *text, int &out)
 Parse a ROS_DOMAIN_ID-style string into a valid domain id.
 

Variables

constexpr int kDefaultDomainId = 0
 Domain id used when neither the command line nor the environment provides one.
 
constexpr std::array< PointFieldDescriptor, 4 > kDvsFields
 
constexpr std::array< PointFieldDescriptor, 4 > kLidarFields
 
constexpr std::array< PointFieldDescriptor, 10 > kLidarFieldsEx
 
static constexpr uint32_t kMaxCdrSequenceElements = 1u << 20
 Sanity cap for the length field of a CDR sequence read from the wire.
 
constexpr int kMaxDomainId = 232
 Highest valid ROS 2 domain id (RTPS maximum).
 
constexpr int kMinDomainId = 0
 Lowest valid ROS 2 domain id.
 
constexpr std::array< PointFieldDescriptor, 7 > kRadarFields
 
constexpr char kRosDomainIdEnvVar [] = "ROS_DOMAIN_ID"
 Name of the standard ROS 2 environment variable that selects the domain id.
 
constexpr std::array< PointFieldDescriptor, 6 > kSemanticLidarFields
 
constexpr int kUnsetDomainId = -1
 Sentinel domain id meaning "no domain id was configured on the command line"; each middleware falls back to its own native default.
 

Typedef Documentation

◆ ActorCallback

using carla::ros2::ActorCallback = typedef std::function<void(void *actor, ROS2CallbackData data)>

Definition at line 55 of file ROS2CallbackData.h.

◆ ActorMessageCallback

using carla::ros2::ActorMessageCallback = typedef std::function<void(void *actor, ROS2MessageCallbackData data)>

Definition at line 56 of file ROS2CallbackData.h.

◆ CarlaDepthCameraPublisher

Definition at line 20 of file CarlaDepthCameraPublisher.h.

◆ CarlaISCameraPublisher

Definition at line 14 of file CarlaISCameraPublisher.h.

◆ CarlaNormalsCameraPublisher

Definition at line 14 of file CarlaNormalsCameraPublisher.h.

◆ CarlaSSCameraPublisher

Definition at line 14 of file CarlaSSCameraPublisher.h.

◆ erc

typedef eprosima::fastrtps::types::ReturnCode_t carla::ros2::erc

Definition at line 18 of file FastDDSAliases.h.

◆ ROS2CallbackData

Definition at line 51 of file ROS2CallbackData.h.

◆ ROS2MessageCallbackData

Definition at line 53 of file ROS2CallbackData.h.

Enumeration Type Documentation

◆ ControlMode

enum class carla::ros2::ControlMode
strong
Enumerator
NO_COMMAND 
AUTONOMOUS 
AUTONOMOUS_STEER_ONLY 
AUTONOMOUS_VELOCITY_ONLY 
MANUAL 
DISENGAGED 
NOT_READY 

Definition at line 32 of file AutowareVehicleStatusPublisher.h.

◆ DomainIdSource

enum class carla::ros2::DomainIdSource
strong

Where the effective domain id came from, in priority order.

Enumerator
CommandLine 

From the –ros-domain-id command line option.

Environment 

From the ROS_DOMAIN_ID environment variable.

Default 

Neither was set; the default domain (0) is used.

Definition at line 35 of file MiddlewareConfig.h.

◆ ESensors

Enumerator
CollisionSensor 
DepthCamera 
NormalsCamera 
DVSCamera 
GnssSensor 
InertialMeasurementUnit 
LaneInvasionSensor 
ObstacleDetectionSensor 
OpticalFlowCamera 
Radar 
RayCastSemanticLidar 
RayCastLidar 
RssSensor 
SceneCaptureCamera 
SemanticSegmentationCamera 
InstanceSegmentationCamera 
WorldObserver 
SceneCaptureCamera_WideAngleLens 
DepthCamera_WideAngleLens 
InstanceSegmentationCamera_WideAngleLens 
SemanticSegmentationCamera_WideAngleLens 
CameraGBufferUint8 
CameraGBufferFloat 
HSSLidar 
VehicleStatusSensor 
AutowareGnssSensor 

Definition at line 65 of file ROS2.cpp.

◆ Gear

enum class carla::ros2::Gear
strong
Enumerator
NONE 
NEUTRAL 
DRIVE 
DRIVE_2 
DRIVE_3 
DRIVE_4 
DRIVE_5 
DRIVE_6 
DRIVE_7 
DRIVE_8 
DRIVE_9 
DRIVE_10 
DRIVE_11 
DRIVE_12 
DRIVE_13 
DRIVE_14 
DRIVE_15 
DRIVE_16 
DRIVE_17 
DRIVE_18 
REVERSE 
REVERSE_2 
PARK 
LOW 
LOW_2 

Definition at line 43 of file AutowareVehicleStatusPublisher.h.

◆ Middleware

enum class carla::ros2::Middleware
strong

Enumeration of available middleware implementations.

Passed to ROS2::Enable() to select the middleware at startup. Once set, the middleware cannot be changed without restarting.

Enumerator
FastDDS 
CycloneDDS 
Zenoh 

Definition at line 15 of file Middleware.h.

◆ PointFieldDataType

enum class carla::ros2::PointFieldDataType : std::uint8_t
strong
Enumerator
Int8 
UInt8 
Int16 
UInt16 
Int32 
UInt32 
Float32 
Float64 

Definition at line 22 of file PointCloudFieldsLayout.h.

◆ TurnIndicatorsStatus

Enumerator
OFF 
LEFT 
RIGHT 

Definition at line 71 of file AutowareVehicleStatusPublisher.h.

Function Documentation

◆ AccelToRos()

std::array< float, 3 > carla::ros2::AccelToRos ( float  ax,
float  ay,
float  az 
)
inline

Definition at line 34 of file ImuMath.h.

Referenced by TEST(), and carla::ros2::CarlaIMUPublisher::Write().

◆ build_user_data()

std::vector< uint8_t > carla::ros2::build_user_data ( const char *  type_hash)
inline

Builds the REP-2016 endpoint USER_DATA payload encoding a REP-2011 type hash.

Per OMG DDSI-RTPS v2.5 §9.6.2.2.2, PID_USER_DATA (0x002c) carries the DDS UserDataQosPolicy octet sequence. ROS 2 REP-2016 defines the payload as a set of ASCII key=value pairs separated by semicolons, e.g.:

typehash=RIHS01_<64 lowercase hex>;

rmw_cyclonedds_cpp and rmw_fastrtps_cpp on Iron / Jazzy parse this string from PID_USER_DATA during SEDP endpoint discovery to perform REP-2011 type-hash-based matching. When it is absent (null), Jazzy rmws emit: [WARN] Failed to parse type hash ... from USER_DATA '(null)'.

This helper is vendor-agnostic; the resulting byte vector is fed to: FastDDS : DataWriterQos::user_data().data_vec() DataReaderQos::user_data().data_vec() CycloneDDS: dds_qset_userdata(qos, data, size)

If type_hash is nullptr (used for types whose hash is unknown), an empty vector is returned and user_data should NOT be set.

Definition at line 37 of file UserDataFormat.h.

Referenced by build_user_data_for().

◆ build_user_data_for()

template<typename T >
std::vector< uint8_t > carla::ros2::build_user_data_for ( )
inline

Convenience: build user_data from the CdrTopicInfo<T>::type_hash() of T.

Returns an empty vector (and the caller must skip setting user_data) when CdrTopicInfo<T>::type_hash() returns nullptr.

Definition at line 59 of file UserDataFormat.h.

References build_user_data().

◆ cdr_serialized_size()

template<typename T >
uint32_t carla::ros2::cdr_serialized_size ( const T &  msg)

Return the exact CDR-serialized size in bytes for a message instance, including the 4-byte DDS encapsulation header.

Used by GenericCdrPubSubType to tell FastDDS the actual payload size before write(), so the payload buffer is sized correctly for variable-length fields (e.g. Image::data, PointCloud2::data). The result is provably equal to serialize_to_cdr(msg).size().

Definition at line 942 of file CdrSerialization.h.

References serialize_cdr().

Referenced by carla::ros2::GenericCdrPubSubType< MsgType >::getSerializedSizeProvider(), TEST(), TEST(), and TEST().

◆ ComputeIntrinsics()

CameraIntrinsics carla::ros2::ComputeIntrinsics ( uint32_t  width,
uint32_t  height,
float  fov_degrees 
)
inlinenoexcept

◆ deserialize_cdr() [1/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::AckermannDrive &  m 
)
inline

◆ deserialize_cdr() [2/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::AckermannDriveStamped &  m 
)
inline

◆ deserialize_cdr() [3/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::CameraInfo &  m 
)
inline

◆ deserialize_cdr() [4/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::CarlaCollisionEvent &  m 
)
inline

◆ deserialize_cdr() [5/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::CarlaEgoVehicleControl &  m 
)
inline

◆ deserialize_cdr() [6/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::CarlaLineInvasion &  m 
)
inline

◆ deserialize_cdr() [7/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Clock &  m 
)
inline

Definition at line 393 of file CdrSerialization.h.

References carla::ros2::msg::Clock::clock, and deserialize_cdr().

◆ deserialize_cdr() [8/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Control &  m 
)
inline

◆ deserialize_cdr() [9/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::ControlModeReport &  m 
)
inline

◆ deserialize_cdr() [10/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Engage &  m 
)
inline

◆ deserialize_cdr() [11/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Float32 &  m 
)
inline

Definition at line 208 of file CdrSerialization.h.

References carla::ros2::msg::Float32::data.

◆ deserialize_cdr() [12/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::GearCommand &  m 
)
inline

◆ deserialize_cdr() [13/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::GearReport &  m 
)
inline

◆ deserialize_cdr() [14/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::HazardLightsCommand &  m 
)
inline

◆ deserialize_cdr() [15/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::HazardLightsReport &  m 
)
inline

◆ deserialize_cdr() [16/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Header &  m 
)
inline

◆ deserialize_cdr() [17/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Image &  m 
)
inline

◆ deserialize_cdr() [18/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Imu &  m 
)
inline

◆ deserialize_cdr() [19/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Lateral &  m 
)
inline

◆ deserialize_cdr() [20/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Longitudinal &  m 
)
inline

◆ deserialize_cdr() [21/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::NavSatFix &  m 
)
inline

◆ deserialize_cdr() [22/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::NavSatStatus &  m 
)
inline

◆ deserialize_cdr() [23/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Odometry &  m 
)
inline

◆ deserialize_cdr() [24/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Point &  m 
)
inline

◆ deserialize_cdr() [25/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Point32 &  m 
)
inline

◆ deserialize_cdr() [26/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::PointCloud2 &  m 
)
inline

◆ deserialize_cdr() [27/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::PointField &  m 
)
inline

◆ deserialize_cdr() [28/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Pose &  m 
)
inline

◆ deserialize_cdr() [29/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::PoseStamped &  m 
)
inline

◆ deserialize_cdr() [30/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::PoseWithCovariance &  m 
)
inline

◆ deserialize_cdr() [31/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::PoseWithCovarianceStamped &  m 
)
inline

◆ deserialize_cdr() [32/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Quaternion &  m 
)
inline

◆ deserialize_cdr() [33/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::RegionOfInterest &  m 
)
inline

◆ deserialize_cdr() [34/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::SteeringReport &  m 
)
inline

◆ deserialize_cdr() [35/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::String &  m 
)
inline

Definition at line 405 of file CdrSerialization.h.

References carla::ros2::msg::String::data.

◆ deserialize_cdr() [36/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TF2Error &  m 
)
inline

◆ deserialize_cdr() [37/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TFMessage &  m 
)
inline

◆ deserialize_cdr() [38/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Time &  m 
)
inline

◆ deserialize_cdr() [39/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Transform &  m 
)
inline

◆ deserialize_cdr() [40/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TransformStamped &  m 
)
inline

◆ deserialize_cdr() [41/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TurnIndicatorsCommand &  m 
)
inline

◆ deserialize_cdr() [42/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TurnIndicatorsReport &  m 
)
inline

◆ deserialize_cdr() [43/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Twist &  m 
)
inline

◆ deserialize_cdr() [44/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::TwistWithCovariance &  m 
)
inline

◆ deserialize_cdr() [45/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::Vector3 &  m 
)
inline

◆ deserialize_cdr() [46/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::VehicleEmergencyStamped &  m 
)
inline

◆ deserialize_cdr() [47/47]

void carla::ros2::deserialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
msg::VelocityReport &  m 
)
inline

◆ deserialize_from_cdr()

template<typename T >
bool carla::ros2::deserialize_from_cdr ( const uint8_t *  data,
size_t  size,
T &  msg 
)

Deserialize a msg::X from a CDR byte buffer that was produced by serialize_to_cdr() or by any ROS2-compatible DDS middleware.

Returns true on success, false on any Fast-CDR error (truncated buffer, malformed encapsulation header, sequence length exceeding the sanity cap, etc.). The buffer must include the 4-byte DDS encapsulation header.

Definition at line 959 of file CdrSerialization.h.

References deserialize_cdr().

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ EncodeDvsEventsToBgr() [1/2]

std::vector< std::uint8_t > carla::ros2::EncodeDvsEventsToBgr ( std::uint32_t  height,
std::uint32_t  width,
const DvsEvent *  events,
std::size_t  event_count 
)
inline

◆ EncodeDvsEventsToBgr() [2/2]

std::vector< std::uint8_t > carla::ros2::EncodeDvsEventsToBgr ( std::uint32_t  height,
std::uint32_t  width,
const std::uint8_t *  raw_events,
std::size_t  event_count,
std::size_t  event_stride 
)
inline

Definition at line 64 of file DvsEventEncoding.h.

◆ EncodeDvsEventsToPointCloud() [1/2]

std::vector< std::uint8_t > carla::ros2::EncodeDvsEventsToPointCloud ( const DvsEvent *  events,
std::size_t  event_count 
)
inline

◆ EncodeDvsEventsToPointCloud() [2/2]

std::vector< std::uint8_t > carla::ros2::EncodeDvsEventsToPointCloud ( const std::uint8_t *  raw_events,
std::size_t  event_count,
std::size_t  event_stride 
)
inline

Definition at line 112 of file DvsEventEncoding.h.

◆ EncodeFlowImageToBgra()

std::vector< uint8_t > carla::ros2::EncodeFlowImageToBgra ( uint32_t  height,
uint32_t  width,
const float *  data 
)
inline

◆ EncodeFlowPixelToBgra()

std::array< uint8_t, 4 > carla::ros2::EncodeFlowPixelToBgra ( float  vx,
float  vy 
)
inlinenoexcept

Definition at line 34 of file OpticalFlowEncoding.h.

References intensity, and x.

Referenced by EncodeFlowImageToBgra(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ FromAckermannDrive()

AckermannControl carla::ros2::FromAckermannDrive ( float  steering_angle,
float  steering_angle_velocity,
float  speed,
float  acceleration,
float  jerk 
)
inline

◆ GetAvailableMiddleware()

std::string carla::ros2::GetAvailableMiddleware ( )
Returns
A readable list of the middleware implementations compiled into the shared library. Must be resolved inside the shared library because the CARLA_ROS2_MIDDLEWARE_* macros are defined only on the carla-ros2-native target, not on carla-server.

Definition at line 19 of file ActiveMiddleware.cpp.

References carla::ros2::MiddlewareFactory::GetAvailableMiddlewareString().

Referenced by carla::ros2::ROS2::Enable(), and FCarlaEngine::NotifyInitGame().

◆ GetAvailableMiddlewareString()

std::string carla::ros2::GetAvailableMiddlewareString ( )
inline

Return a readable list of middleware implementations compiled into this binary.

Definition at line 56 of file Middleware.h.

Referenced by carla::ros2::MiddlewareFactory::GetAvailableMiddlewareString(), and TEST().

◆ GyroToRos()

std::array< float, 3 > carla::ros2::GyroToRos ( float  gx,
float  gy,
float  gz 
)
inline

Definition at line 51 of file ImuMath.h.

Referenced by TEST(), TEST(), and carla::ros2::CarlaIMUPublisher::Write().

◆ IsValidDomainId()

bool carla::ros2::IsValidDomainId ( int  id)
inline
Returns
true if id is a valid ROS 2 domain id (0..232). The unset sentinel is intentionally NOT valid: callers test for it explicitly.

Definition at line 30 of file MiddlewareConfig.h.

References kMaxDomainId, and kMinDomainId.

Referenced by FCarlaEngine::NotifyInitGame(), ResolveDomainId(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ MiddlewareFromString()

MiddlewareParseResult carla::ros2::MiddlewareFromString ( const std::string &  name)
inline

Parse a middleware name string (lowercase).

Returns {true, middleware} on match, {false, FastDDS} for unrecognized values.

Definition at line 42 of file Middleware.h.

References CycloneDDS, FastDDS, and Zenoh.

Referenced by FCarlaEngine::NotifyInitGame(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ MiddlewareToString()

const char * carla::ros2::MiddlewareToString ( Middleware  middleware)
inline

Convert a Middleware enum value to a readable string.

Definition at line 22 of file Middleware.h.

References CycloneDDS, FastDDS, and Zenoh.

Referenced by carla::ros2::ROS2::Enable(), TEST(), TEST(), and TEST().

◆ OrientationFromCompass()

std::array< float, 4 > carla::ros2::OrientationFromCompass ( float  compass)
inline

Definition at line 23 of file ImuMath.h.

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and carla::ros2::CarlaIMUPublisher::Write().

◆ RadarPolarToCartesian()

std::array< float, 3 > carla::ros2::RadarPolarToCartesian ( float  depth,
float  azimuth,
float  altitude 
)
inlinenoexcept

◆ ResolveDomainId()

ResolvedDomainId carla::ros2::ResolveDomainId ( int  cli_value,
const char *  env_value 
)
inline

Resolve the effective domain id from a command line value and an environment value, in priority order:

  1. cli_value, when it is a valid domain id (0..232).
  2. env_value (e.g. ROS_DOMAIN_ID), when it parses to a valid domain id.
  3. kDefaultDomainId (0). This function is pure (no environment access), so the precedence rules can be unit-tested by passing the environment value as a string.

Definition at line 80 of file MiddlewareConfig.h.

References CommandLine, Default, Environment, IsValidDomainId(), kDefaultDomainId, and TryParseDomainId().

Referenced by carla::ros2::MiddlewareConfig::ResolveEffective(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ serialize_cdr() [1/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::AckermannDrive &  m 
)
inline

◆ serialize_cdr() [2/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::AckermannDriveStamped &  m 
)
inline

◆ serialize_cdr() [3/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::CameraInfo &  m 
)
inline

◆ serialize_cdr() [4/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::CarlaCollisionEvent &  m 
)
inline

◆ serialize_cdr() [5/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::CarlaEgoVehicleControl &  m 
)
inline

◆ serialize_cdr() [6/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::CarlaLineInvasion &  m 
)
inline

◆ serialize_cdr() [7/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Clock &  m 
)
inline

Definition at line 388 of file CdrSerialization.h.

References carla::ros2::msg::Clock::clock, and serialize_cdr().

◆ serialize_cdr() [8/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Control &  m 
)
inline

◆ serialize_cdr() [9/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::ControlModeReport &  m 
)
inline

◆ serialize_cdr() [10/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Engage &  m 
)
inline

◆ serialize_cdr() [11/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Float32 &  m 
)
inline

Definition at line 203 of file CdrSerialization.h.

References carla::ros2::msg::Float32::data.

◆ serialize_cdr() [12/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::GearCommand &  m 
)
inline

◆ serialize_cdr() [13/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::GearReport &  m 
)
inline

◆ serialize_cdr() [14/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::HazardLightsCommand &  m 
)
inline

◆ serialize_cdr() [15/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::HazardLightsReport &  m 
)
inline

◆ serialize_cdr() [16/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Header &  m 
)
inline

◆ serialize_cdr() [17/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Image &  m 
)
inline

◆ serialize_cdr() [18/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Imu &  m 
)
inline

◆ serialize_cdr() [19/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Lateral &  m 
)
inline

◆ serialize_cdr() [20/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Longitudinal &  m 
)
inline

◆ serialize_cdr() [21/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::NavSatFix &  m 
)
inline

◆ serialize_cdr() [22/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::NavSatStatus &  m 
)
inline

◆ serialize_cdr() [23/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Odometry &  m 
)
inline

◆ serialize_cdr() [24/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Point &  m 
)
inline

◆ serialize_cdr() [25/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Point32 &  m 
)
inline

◆ serialize_cdr() [26/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::PointCloud2 &  m 
)
inline

◆ serialize_cdr() [27/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::PointField &  m 
)
inline

PointField: name is a string; offset, datatype, count are primitives.

Definition at line 236 of file CdrSerialization.h.

References carla::ros2::msg::PointField::count, carla::ros2::msg::PointField::datatype, carla::ros2::msg::PointField::name, and carla::ros2::msg::PointField::offset.

◆ serialize_cdr() [28/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Pose &  m 
)
inline

◆ serialize_cdr() [29/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::PoseStamped &  m 
)
inline

◆ serialize_cdr() [30/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::PoseWithCovariance &  m 
)
inline

◆ serialize_cdr() [31/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::PoseWithCovarianceStamped &  m 
)
inline

◆ serialize_cdr() [32/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Quaternion &  m 
)
inline

◆ serialize_cdr() [33/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::RegionOfInterest &  m 
)
inline

◆ serialize_cdr() [34/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::SteeringReport &  m 
)
inline

◆ serialize_cdr() [35/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::String &  m 
)
inline

Definition at line 400 of file CdrSerialization.h.

References carla::ros2::msg::String::data.

◆ serialize_cdr() [36/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TF2Error &  m 
)
inline

◆ serialize_cdr() [37/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TFMessage &  m 
)
inline

TFMessage::transforms is a sequence of TransformStamped structs.

Write length + elements manually.

Definition at line 880 of file CdrSerialization.h.

References serialize_cdr(), and carla::ros2::msg::TFMessage::transforms.

◆ serialize_cdr() [38/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Time &  m 
)
inline

◆ serialize_cdr() [39/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Transform &  m 
)
inline

◆ serialize_cdr() [40/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TransformStamped &  m 
)
inline

◆ serialize_cdr() [41/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TurnIndicatorsCommand &  m 
)
inline

◆ serialize_cdr() [42/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TurnIndicatorsReport &  m 
)
inline

◆ serialize_cdr() [43/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Twist &  m 
)
inline

◆ serialize_cdr() [44/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::TwistWithCovariance &  m 
)
inline

◆ serialize_cdr() [45/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::Vector3 &  m 
)
inline

◆ serialize_cdr() [46/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::VehicleEmergencyStamped &  m 
)
inline

◆ serialize_cdr() [47/47]

void carla::ros2::serialize_cdr ( eprosima::fastcdr::Cdr &  cdr,
const msg::VelocityReport &  m 
)
inline

◆ serialize_to_cdr()

template<typename T >
std::vector< uint8_t > carla::ros2::serialize_to_cdr ( const T &  msg)

Serialize a msg::X to a CDR byte buffer including the DDS encapsulation header (Classic CDR, encoding version 1, little-endian).

The returned buffer is wire-compatible with all ROS2 distros and can be passed to FastDDS write_serialized_payload() or CycloneDDS dds_writecdr(). Returns an empty vector if Fast-CDR raises an exception (e.g. out of memory while growing the internal FastBuffer).

Definition at line 914 of file CdrSerialization.h.

References serialize_cdr().

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ SetActiveDomainId()

ResolvedDomainId carla::ros2::SetActiveDomainId ( int  domain_id)

Store the domain id in the shared library's MiddlewareConfig and return the effective domain id resolved there, so carla-server can log the value the middlewares will actually use.

Pass kUnsetDomainId to keep each middleware's native default. Like the other exports here, this is DDS-free and its definition is compiled into the shared library, so MiddlewareConfig's process-wide storage lives on the shared-library side that the middlewares read.

Definition at line 23 of file ActiveMiddleware.cpp.

References carla::ros2::MiddlewareConfig::ResolveEffective(), and carla::ros2::MiddlewareConfig::SetDomainId().

Referenced by carla::ros2::ROS2::Enable().

◆ SetActiveMiddleware()

bool carla::ros2::SetActiveMiddleware ( Middleware  requested)

DDS-free bridge for selecting the active middleware across the shared-library boundary.

ROS2.cpp is the only ROS 2 translation unit compiled into carla-server; every other ROS 2 source (including MiddlewareFactory.h and the vendor middleware headers) is compiled exclusively into libcarla-ros2-native.so. These declarations include only Middleware.h, so carla-server can select the middleware without any DDS header crossing the boundary. The definitions are compiled into the shared library. Resolve and select the requested middleware.

Returns
true if the middleware was compiled into the shared library and is now active, false if it is unavailable (in which case the active middleware is left unchanged).

Definition at line 11 of file ActiveMiddleware.cpp.

References carla::ros2::MiddlewareFactory::ResolveMiddleware(), and carla::ros2::MiddlewareFactory::SetMiddleware().

Referenced by carla::ros2::ROS2::Enable().

◆ ToROS2TypeName()

std::string carla::ros2::ToROS2TypeName ( const std::string &  type_name)
inline

Mangle a type name into the ROS2-compatible format.

"sensor_msgs::msg::Image" becomes "sensor_msgs::msg::dds_::Image_". A bare name like "Image" becomes "dds_::Image_".

Definition at line 82 of file Middleware.h.

Referenced by TEST(), TEST(), TEST(), and TEST().

◆ TransformFromCarlaRotation()

TransformQuaternion carla::ros2::TransformFromCarlaRotation ( float  tx,
float  ty,
float  tz,
float  pitch_deg,
float  yaw_deg,
float  roll_deg 
)
inlinenoexcept

◆ TryParseDomainId()

bool carla::ros2::TryParseDomainId ( const char *  text,
int &  out 
)
inline

Parse a ROS_DOMAIN_ID-style string into a valid domain id.

Returns
true and writes out only when text is a base-10 integer that is a valid domain id (0..232). nullptr, empty, non-numeric, trailing-garbage and out-of-range inputs return false and leave out untouched.

Definition at line 51 of file MiddlewareConfig.h.

References kMaxDomainId.

Referenced by ResolveDomainId(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

Variable Documentation

◆ kDefaultDomainId

constexpr int carla::ros2::kDefaultDomainId = 0
constexpr

Domain id used when neither the command line nor the environment provides one.

Definition at line 23 of file MiddlewareConfig.h.

Referenced by ResolveDomainId(), TEST(), TEST(), TEST(), and TEST_F().

◆ kDvsFields

constexpr std::array<PointFieldDescriptor, 4> carla::ros2::kDvsFields
inlineconstexpr
Initial value:
= {{
{"x", 0u, PointFieldDataType::UInt16, 1u},
{"y", 2u, PointFieldDataType::UInt16, 1u},
{"t", 4u, PointFieldDataType::Float64, 1u},
{"pol", 12u, PointFieldDataType::Int8, 1u},
}}

Definition at line 94 of file PointCloudFieldsLayout.h.

Referenced by carla::ros2::CarlaDVSPointCloudPublisher::GetFieldDescriptorCount(), carla::ros2::CarlaDVSPointCloudPublisher::GetFieldDescriptors(), TEST(), and TEST().

◆ kLidarFields

constexpr std::array<PointFieldDescriptor, 4> carla::ros2::kLidarFields
inlineconstexpr
Initial value:
= {{
{"x", 0u, PointFieldDataType::Float32, 1u},
{"y", 4u, PointFieldDataType::Float32, 1u},
{"z", 8u, PointFieldDataType::Float32, 1u},
{"intensity", 12u, PointFieldDataType::Float32, 1u},
}}

Definition at line 41 of file PointCloudFieldsLayout.h.

Referenced by carla::ros2::CarlaLidarPublisher::GetFieldDescriptorCount(), carla::ros2::CarlaLidarPublisher::GetFieldDescriptors(), TEST(), and TEST().

◆ kLidarFieldsEx

constexpr std::array<PointFieldDescriptor, 10> carla::ros2::kLidarFieldsEx
inlineconstexpr
Initial value:
= {{
{"x", 0u, PointFieldDataType::Float32, 1u},
{"y", 4u, PointFieldDataType::Float32, 1u},
{"z", 8u, PointFieldDataType::Float32, 1u},
{"intensity", 12u, PointFieldDataType::UInt8, 1u},
{"return_type", 13u, PointFieldDataType::UInt8, 1u},
{"channel", 14u, PointFieldDataType::UInt16, 1u},
{"azimuth", 16u, PointFieldDataType::Float32, 1u},
{"elevation", 20u, PointFieldDataType::Float32, 1u},
{"distance", 24u, PointFieldDataType::Float32, 1u},
{"time_stamp", 28u, PointFieldDataType::UInt32, 1u},
}}

Definition at line 53 of file PointCloudFieldsLayout.h.

Referenced by carla::ros2::CarlaLidarPublisher::GetFieldDescriptorCount(), carla::ros2::CarlaLidarPublisher::GetFieldDescriptors(), TEST(), and TEST().

◆ kMaxCdrSequenceElements

constexpr uint32_t carla::ros2::kMaxCdrSequenceElements = 1u << 20
staticconstexpr

Sanity cap for the length field of a CDR sequence read from the wire.

Protects against malformed/hostile payloads claiming a multi-GB sequence, which would otherwise OOM-abort the process inside std::vector::resize(). 1,048,576 elements is far above any realistic ROS2 message (PointCloud2 rarely has more than a dozen fields; TFMessage rarely has more than a few hundred transforms) while bounding the worst-case allocation to ~80 MiB.

Definition at line 83 of file CdrSerialization.h.

Referenced by deserialize_cdr(), and deserialize_cdr().

◆ kMaxDomainId

constexpr int carla::ros2::kMaxDomainId = 232
constexpr

Highest valid ROS 2 domain id (RTPS maximum).

Definition at line 20 of file MiddlewareConfig.h.

Referenced by IsValidDomainId(), FCarlaEngine::NotifyInitGame(), TEST(), TEST(), TEST(), and TryParseDomainId().

◆ kMinDomainId

constexpr int carla::ros2::kMinDomainId = 0
constexpr

Lowest valid ROS 2 domain id.

Definition at line 17 of file MiddlewareConfig.h.

Referenced by IsValidDomainId(), and FCarlaEngine::NotifyInitGame().

◆ kRadarFields

constexpr std::array<PointFieldDescriptor, 7> carla::ros2::kRadarFields
inlineconstexpr
Initial value:
= {{
{"x", 0u, PointFieldDataType::Float32, 1u},
{"y", 4u, PointFieldDataType::Float32, 1u},
{"z", 8u, PointFieldDataType::Float32, 1u},
{"velocity", 12u, PointFieldDataType::Float32, 1u},
{"azimuth", 16u, PointFieldDataType::Float32, 1u},
{"altitude", 20u, PointFieldDataType::Float32, 1u},
{"depth", 24u, PointFieldDataType::Float32, 1u},
}}

Definition at line 80 of file PointCloudFieldsLayout.h.

Referenced by carla::ros2::CarlaRadarPublisher::GetFieldDescriptorCount(), carla::ros2::CarlaRadarPublisher::GetFieldDescriptors(), TEST(), and TEST().

◆ kRosDomainIdEnvVar

constexpr char carla::ros2::kRosDomainIdEnvVar[] = "ROS_DOMAIN_ID"
constexpr

Name of the standard ROS 2 environment variable that selects the domain id.

Definition at line 26 of file MiddlewareConfig.h.

Referenced by carla::ros2::MiddlewareConfig::ResolveEffective(), RosDomainIdEnvFixture::SetUp(), RosDomainIdEnvFixture::TearDown(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ kSemanticLidarFields

constexpr std::array<PointFieldDescriptor, 6> carla::ros2::kSemanticLidarFields
inlineconstexpr
Initial value:
= {{
{"x", 0u, PointFieldDataType::Float32, 1u},
{"y", 4u, PointFieldDataType::Float32, 1u},
{"z", 8u, PointFieldDataType::Float32, 1u},
{"cos_inc_angle", 12u, PointFieldDataType::Float32, 1u},
{"object_idx", 16u, PointFieldDataType::UInt32, 1u},
{"object_tag", 20u, PointFieldDataType::UInt32, 1u},
}}

Definition at line 68 of file PointCloudFieldsLayout.h.

Referenced by carla::ros2::CarlaSemanticLidarPublisher::GetFieldDescriptorCount(), carla::ros2::CarlaSemanticLidarPublisher::GetFieldDescriptors(), TEST(), and TEST().

◆ kUnsetDomainId

constexpr int carla::ros2::kUnsetDomainId = -1
constexpr

Sentinel domain id meaning "no domain id was configured on the command line"; each middleware falls back to its own native default.

Definition at line 14 of file MiddlewareConfig.h.

Referenced by FCarlaEngine::NotifyInitGame(), RosDomainIdEnvFixture::SetUp(), MiddlewareConfigFixture::TearDown(), RosDomainIdEnvFixture::TearDown(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().