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... | |
std::shared_ptr< ros::NodeHandle > | nh_ |
ROS node handle. More... | |
ros::Publisher | 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 16 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 20 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 159 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 211 of file SensorPublisher.cpp.
|
static |
Create an instance.
m | model |
d | data |
plugin_id | plugin ID |
Definition at line 74 of file SensorPublisher.cpp.
|
static |
Register plugin.
Definition at line 15 of file SensorPublisher.cpp.
void MujocoRosUtils::SensorPublisher::reset | ( | const mjModel * | m, |
int | plugin_id | ||
) |
|
protected |
Frame ID of message header.
Definition at line 89 of file SensorPublisher.h.
|
protected |
Type of ROS message.
Definition at line 86 of file SensorPublisher.h.
|
protected |
ROS node handle.
Definition at line 95 of file SensorPublisher.h.
|
protected |
ROS publisher.
Definition at line 98 of file SensorPublisher.h.
|
protected |
Iteration interval to skip ROS publish.
Definition at line 101 of file SensorPublisher.h.
|
protected |
Sensor ID.
Definition at line 83 of file SensorPublisher.h.
|
protected |
Iteration count of simulation.
Definition at line 104 of file SensorPublisher.h.
|
protected |
Topic name.
Definition at line 92 of file SensorPublisher.h.