Go to the documentation of this file.
4 #include <tf2_ros/transform_broadcaster.h>
6 #include <mujoco/mjdata.h>
7 #include <mujoco/mjmodel.h>
8 #include <mujoco/mjtnum.h>
9 #include <mujoco/mjvisualize.h>
38 void reset(
const mjModel * m,
int plugin_id);
45 void compute(
const mjModel * m, mjData * d,
int plugin_id);
62 const std::string & frame_id,
63 const std::string & pose_topic_name,
64 const std::string & vel_topic_name,
67 const std::string & tf_child_frame_id);
77 std::shared_ptr<ros::NodeHandle>
nh_;
86 std::shared_ptr<tf2_ros::TransformBroadcaster>
tf_br_;
PosePublisher(PosePublisher &&)=default
Copy constructor.
static void RegisterPlugin()
Register plugin.
std::shared_ptr< ros::NodeHandle > nh_
ROS node handle.
bool output_tf_
Whether to broadcast TF.
std::string tf_child_frame_id_
Child frame ID for TF.
void compute(const mjModel *m, mjData *d, int plugin_id)
Compute.
static PosePublisher * Create(const mjModel *m, mjData *d, int plugin_id)
Create an instance.
Plugin to publish topics or broadcast TF of pose and velocity of the body.
int sim_cnt_
Iteration count of simulation.
std::string pose_topic_name_
Topic name of pose.
std::shared_ptr< tf2_ros::TransformBroadcaster > tf_br_
TF broadcaster.
void reset(const mjModel *m, int plugin_id)
Reset.
ros::Publisher vel_pub_
ROS publisher for velocity.
std::string frame_id_
Frame ID of topics header or TF parent.
ros::Publisher pose_pub_
ROS publisher for pose.
int publish_skip_
Iteration interval to skip ROS publish.
std::string vel_topic_name_
Topic name of velocity.