|
mujoco_ros_utils
|
Plugin to publish sensor data. More...
#include <SensorPublisher.h>
Public Types | |
| enum | MessageType_ { MsgScalar = 0 , MsgPoint , MsgVector3 , MsgQuaternion } |
| Type of ROS message. More... | |
| typedef enum MujocoRosUtils::SensorPublisher::MessageType_ | MessageType |
| Type of ROS message. More... | |
Public Member Functions | |
| SensorPublisher (SensorPublisher &&)=default | |
| Copy constructor. More... | |
| void | reset (const mjModel *m, int plugin_id) |
| Reset. More... | |
| void | compute (const mjModel *m, mjData *d, int plugin_id) |
| Compute. More... | |
Static Public Member Functions | |
| static void | RegisterPlugin () |
| Register plugin. More... | |
| static SensorPublisher * | Create (const mjModel *m, mjData *d, int plugin_id) |
| Create an instance. More... | |
Protected Member Functions | |
| SensorPublisher (const mjModel *m, mjData *d, int sensor_id, MessageType msg_type, const std::string &frame_id, const std::string &topic_name, mjtNum publish_rate) | |
| Constructor. More... | |
Protected Attributes | |
| int | sensor_id_ = -1 |
| Sensor ID. More... | |
| MessageType | msg_type_ |
| Type of ROS message. More... | |
| std::string | frame_id_ |
| Frame ID of message header. More... | |
| std::string | topic_name_ |
| Topic name. More... | |
| rclcpp::Node::SharedPtr | nh_ |
| ROS node handle. More... | |
| rclcpp::PublisherBase::SharedPtr | pub_ |
| ROS publisher. More... | |
| int | publish_skip_ = 0 |
| Iteration interval to skip ROS publish. More... | |
| int | sim_cnt_ = 0 |
| Iteration count of simulation. More... | |
Plugin to publish sensor data.
Definition at line 20 of file SensorPublisher.h.
| typedef enum MujocoRosUtils::SensorPublisher::MessageType_ MujocoRosUtils::SensorPublisher::MessageType |
Type of ROS message.
Type of ROS message.
| Enumerator | |
|---|---|
| MsgScalar | Scalar. |
| MsgPoint | Point. |
| MsgVector3 | 3D vector |
| MsgQuaternion | Quaternion. |
Definition at line 24 of file SensorPublisher.h.
|
default |
Copy constructor.
|
protected |
Constructor.
| m | model |
| d | data |
| sensor_id | sensor ID |
| msg_type | type of ROS message |
| frame_id | frame ID of message header |
| topic_name | topic name |
| publish_rate | publish rate |
Definition at line 154 of file SensorPublisher.cpp.
| void MujocoRosUtils::SensorPublisher::compute | ( | const mjModel * | m, |
| mjData * | d, | ||
| int | plugin_id | ||
| ) |
Compute.
| m | model |
| d | data |
| plugin_id | plugin ID |
Definition at line 207 of file SensorPublisher.cpp.
|
static |
Create an instance.
| m | model |
| d | data |
| plugin_id | plugin ID |
Definition at line 69 of file SensorPublisher.cpp.
|
static |
Register plugin.
Definition at line 10 of file SensorPublisher.cpp.
| void MujocoRosUtils::SensorPublisher::reset | ( | const mjModel * | m, |
| int | plugin_id | ||
| ) |
|
protected |
Frame ID of message header.
Definition at line 93 of file SensorPublisher.h.
|
protected |
Type of ROS message.
Definition at line 90 of file SensorPublisher.h.
|
protected |
ROS node handle.
Definition at line 99 of file SensorPublisher.h.
|
protected |
ROS publisher.
Definition at line 102 of file SensorPublisher.h.
|
protected |
Iteration interval to skip ROS publish.
Definition at line 105 of file SensorPublisher.h.
|
protected |
Sensor ID.
Definition at line 87 of file SensorPublisher.h.
|
protected |
Iteration count of simulation.
Definition at line 108 of file SensorPublisher.h.
|
protected |
Topic name.
Definition at line 96 of file SensorPublisher.h.