Information about an SDF sensor. More...
#include <Sensor.hh>
Public Member Functions | |
Sensor () | |
Default constructor. More... | |
Sensor (const Sensor &_sensor) | |
Copy constructor. More... | |
Sensor (Sensor &&_sensor) noexcept | |
Move constructor. More... | |
~Sensor () | |
Destructor. More... | |
const AirPressure * | AirPressureSensor () const |
Get the air pressure sensor, or nullptr if this sensor type is not an AirPressure sensor. More... | |
const Altimeter * | AltimeterSensor () const |
Get the altimeter sensor, or nullptr if this sensor type is not an Altimeter. More... | |
const Camera * | CameraSensor () const |
Get a pointer to a camera sensor, or nullptr if the sensor does not contain a camera sensor. More... | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. More... | |
const Imu * | ImuSensor () const |
Get a pointer to an IMU sensor, or nullptr if the sensor does not contain an IMU sensor. More... | |
const Lidar * | LidarSensor () const |
Get the lidar sensor, or nullptr if this sensor type is not a Lidar. More... | |
Errors | Load (ElementPtr _sdf) |
Load the sensor based on a element pointer. More... | |
const Magnetometer * | MagnetometerSensor () const |
Get the magnetometer sensor, or nullptr if this sensor type is not a Magnetometer. More... | |
std::string | Name () const |
Get the name of the sensor. More... | |
bool | operator!= (const Sensor &_sensor) const |
Return true this Sensor object does not contain the same values as the passed in parameter. More... | |
Sensor & | operator= (const Sensor &_sensor) |
Assignment operator. More... | |
Sensor & | operator= (Sensor &&_sensor) |
Move assignment operator. More... | |
bool | operator== (const Sensor &_sensor) const |
Return true if both Sensor objects contain the same values. More... | |
const ignition::math::Pose3d & | Pose () const SDF_DEPRECATED(9.0) |
Get the pose of the sensor. More... | |
const std::string & | PoseFrame () const SDF_DEPRECATED(9.0) |
Get the name of the coordinate frame in which this sensor's pose is expressed. More... | |
const std::string & | PoseRelativeTo () const |
Get the name of the coordinate frame relative to which this object's pose is expressed. More... | |
const ignition::math::Pose3d & | RawPose () const |
Get the pose of the sensor. More... | |
sdf::SemanticPose | SemanticPose () const |
Get SemanticPose object of this object to aid in resolving poses. More... | |
void | SetAirPressureSensor (const AirPressure &_air) |
Set the air pressure sensor. More... | |
void | SetAltimeterSensor (const Altimeter &_alt) |
Set the altimeter sensor. More... | |
void | SetCameraSensor (const Camera &_cam) |
Set the camera sensor. More... | |
void | SetImuSensor (const Imu &_imu) |
Set the IMU sensor. More... | |
void | SetLidarSensor (const Lidar &_lidar) |
Set the lidar sensor. More... | |
void | SetMagnetometerSensor (const Magnetometer &_mag) |
Set the magnetometer sensor. More... | |
void | SetName (const std::string &_name) |
Set the name of the sensor. More... | |
void | SetPose (const ignition::math::Pose3d &_pose) SDF_DEPRECATED(9.0) |
Set the pose of the sensor. More... | |
void | SetPoseFrame (const std::string &_frame) SDF_DEPRECATED(9.0) |
Set the name of the coordinate frame in which this sensor's pose is expressed. More... | |
void | SetPoseRelativeTo (const std::string &_frame) |
Set the name of the coordinate frame relative to which this object's pose is expressed. More... | |
void | SetRawPose (const ignition::math::Pose3d &_pose) |
Set the pose of the sensor. More... | |
void | SetTopic (const std::string &_topic) |
Set the topic on which sensor data should be published. More... | |
void | SetType (const SensorType _type) |
Set the sensor type. More... | |
bool | SetType (const std::string &_typeStr) |
Set the sensor type from a string. More... | |
void | SetUpdateRate (double _hz) |
Set the update rate. More... | |
std::string | Topic () const |
Get the topic on which sensor data should be published. More... | |
SensorType | Type () const |
Get the sensor type. More... | |
std::string | TypeStr () const |
Get the sensor type as a string. More... | |
double | UpdateRate () const |
Get the update rate in Hz. More... | |
Information about an SDF sensor.
sdf::SDF_VERSION_NAMESPACE::Sensor::Sensor | ( | ) |
Default constructor.
sdf::SDF_VERSION_NAMESPACE::Sensor::Sensor | ( | const Sensor & | _sensor | ) |
Copy constructor.
[in] | _sensor | Sensor to copy. |
|
noexcept |
Move constructor.
[in] | _sensor | Sensor to move. |
sdf::SDF_VERSION_NAMESPACE::Sensor::~Sensor | ( | ) |
Destructor.
const AirPressure* sdf::SDF_VERSION_NAMESPACE::Sensor::AirPressureSensor | ( | ) | const |
Get the air pressure sensor, or nullptr if this sensor type is not an AirPressure sensor.
const Altimeter* sdf::SDF_VERSION_NAMESPACE::Sensor::AltimeterSensor | ( | ) | const |
Get the altimeter sensor, or nullptr if this sensor type is not an Altimeter.
const Camera* sdf::SDF_VERSION_NAMESPACE::Sensor::CameraSensor | ( | ) | const |
Get a pointer to a camera sensor, or nullptr if the sensor does not contain a camera sensor.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Sensor::Element | ( | ) | const |
Get a pointer to the SDF element that was used during load.
const Imu* sdf::SDF_VERSION_NAMESPACE::Sensor::ImuSensor | ( | ) | const |
Get a pointer to an IMU sensor, or nullptr if the sensor does not contain an IMU sensor.
const Lidar* sdf::SDF_VERSION_NAMESPACE::Sensor::LidarSensor | ( | ) | const |
Get the lidar sensor, or nullptr if this sensor type is not a Lidar.
Errors sdf::SDF_VERSION_NAMESPACE::Sensor::Load | ( | ElementPtr | _sdf | ) |
Load the sensor based on a element pointer.
This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.
[in] | _sdf | The SDF Element pointer |
const Magnetometer* sdf::SDF_VERSION_NAMESPACE::Sensor::MagnetometerSensor | ( | ) | const |
Get the magnetometer sensor, or nullptr if this sensor type is not a Magnetometer.
std::string sdf::SDF_VERSION_NAMESPACE::Sensor::Name | ( | ) | const |
Get the name of the sensor.
The name of the sensor should be unique within the scope of a World.
bool sdf::SDF_VERSION_NAMESPACE::Sensor::operator!= | ( | const Sensor & | _sensor | ) | const |
Return true this Sensor object does not contain the same values as the passed in parameter.
Assignment operator.
[in] | _sensor | The sensor to set values from. |
Move assignment operator.
[in] | _sensor | The sensor to set values from. |
bool sdf::SDF_VERSION_NAMESPACE::Sensor::operator== | ( | const Sensor & | _sensor | ) | const |
Return true if both Sensor objects contain the same values.
const ignition::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::Sensor::Pose | ( | ) | const |
Get the pose of the sensor.
This is the pose of the sensor as specified in SDF (<sensor> <pose> ... </pose></sensor>), and is typically used to express the position and rotation of a sensor in a global coordinate frame.
const std::string& sdf::SDF_VERSION_NAMESPACE::Sensor::PoseFrame | ( | ) | const |
Get the name of the coordinate frame in which this sensor's pose is expressed.
A empty value indicates that the frame is the global/world coordinate frame.
const std::string& sdf::SDF_VERSION_NAMESPACE::Sensor::PoseRelativeTo | ( | ) | const |
Get the name of the coordinate frame relative to which this object's pose is expressed.
An empty value indicates that the frame is relative to the parent link/joint coordinate frame.
const ignition::math::Pose3d& sdf::SDF_VERSION_NAMESPACE::Sensor::RawPose | ( | ) | const |
Get the pose of the sensor.
This is the pose of the sensor as specified in SDF (<sensor> <pose> ... </pose></sensor>), and is typically used to express the position and rotation of a sensor in a global coordinate frame.
sdf::SemanticPose sdf::SDF_VERSION_NAMESPACE::Sensor::SemanticPose | ( | ) | const |
Get SemanticPose object of this object to aid in resolving poses.
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetAirPressureSensor | ( | const AirPressure & | _air | ) |
Set the air pressure sensor.
[in] | _air | The air pressure sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetAltimeterSensor | ( | const Altimeter & | _alt | ) |
Set the altimeter sensor.
[in] | _alt | The altimeter sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetCameraSensor | ( | const Camera & | _cam | ) |
Set the camera sensor.
[in] | _cam | The camera sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetImuSensor | ( | const Imu & | _imu | ) |
Set the IMU sensor.
[in] | _imu | The IMU sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetLidarSensor | ( | const Lidar & | _lidar | ) |
Set the lidar sensor.
[in] | _lidar | The lidar sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetMagnetometerSensor | ( | const Magnetometer & | _mag | ) |
Set the magnetometer sensor.
[in] | _mag | The magnetometer sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetName | ( | const std::string & | _name | ) |
Set the name of the sensor.
The name of the sensor should be unique within the scope of a World.
[in] | _name | Name of the sensor. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetPose | ( | const ignition::math::Pose3d & | _pose | ) |
Set the pose of the sensor.
[in] | _pose | The new sensor pose. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetPoseFrame | ( | const std::string & | _frame | ) |
Set the name of the coordinate frame in which this sensor's pose is expressed.
A empty value indicates that the frame is the global/world coordinate frame.
[in] | _frame | The name of the pose frame. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetPoseRelativeTo | ( | const std::string & | _frame | ) |
Set the name of the coordinate frame relative to which this object's pose is expressed.
An empty value indicates that the frame is relative to the parent link/joint coordinate frame.
[in] | _frame | The name of the pose relative-to frame. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetRawPose | ( | const ignition::math::Pose3d & | _pose | ) |
Set the pose of the sensor.
[in] | _pose | The new sensor pose. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetTopic | ( | const std::string & | _topic | ) |
Set the topic on which sensor data should be published.
[in] | _topic | Topic for this sensor's data. |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetType | ( | const SensorType | _type | ) |
Set the sensor type.
[in] | _type | The sensor type. |
bool sdf::SDF_VERSION_NAMESPACE::Sensor::SetType | ( | const std::string & | _typeStr | ) |
Set the sensor type from a string.
[in] | _typeStr | The sensor type. A valid parameter should equal one of the enum value name in the SensorType enum. For example, "altimeter" or "camera". |
void sdf::SDF_VERSION_NAMESPACE::Sensor::SetUpdateRate | ( | double | _hz | ) |
Set the update rate.
This is The frequency at which the sensor data is generated. If left unspecified (0.0), the sensor will generate data every cycle.
[in] | _rate | The update rate in Hz. |
std::string sdf::SDF_VERSION_NAMESPACE::Sensor::Topic | ( | ) | const |
Get the topic on which sensor data should be published.
SensorType sdf::SDF_VERSION_NAMESPACE::Sensor::Type | ( | ) | const |
Get the sensor type.
std::string sdf::SDF_VERSION_NAMESPACE::Sensor::TypeStr | ( | ) | const |
Get the sensor type as a string.
double sdf::SDF_VERSION_NAMESPACE::Sensor::UpdateRate | ( | ) | const |
Get the update rate in Hz.
This is The frequency at which the sensor data is generated. If left unspecified (0.0), the sensor will generate data every cycle.