![]() |
ros2_control - kilted
|
Plugin that publishes the pose and velocity of every MuJoCo free-joint body (or a user-selected subset) to a single topic, in a user-selectable reference frame. More...
#include <free_joint_state_publisher_plugin.hpp>


Public Member Functions | |
| bool | init (rclcpp::Node::SharedPtr node, const mjModel *model, mjData *data) override |
| Initialize the plugin. | |
| void | update_write (const mjModel *model, mjData *data) override |
Called once per write() cycle, on the control thread, after the hardware interface has staged the controller commands and right before they are sent to the simulation. | |
| void | cleanup () override |
| Cleanup the plugin. | |
Public Member Functions inherited from mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase | |
| virtual void | update_read (const mjModel *, mjData *) |
Called once per read() cycle, on the control thread, before the state is handed to ros2_control. Default does nothing. | |
| virtual void | update (const mjModel *, mjData *) |
Same as update_write(). Default does nothing. | |
| virtual void | pre_step (mjData *) |
| Called immediately before every simulation step on the physics thread. Default does nothing. | |
| virtual void | on_reset (mjData *) |
| Called after a world reset (ResetWorld service or UI reset). Default does nothing. | |
Plugin that publishes the pose and velocity of every MuJoCo free-joint body (or a user-selected subset) to a single topic, in a user-selectable reference frame.
Publishes mujoco_ros2_control_msgs/msg/FreeJointStateArray on the configurable topic parameter.
frame_id - Name of the MuJoCo body every published pose/twist is expressed relative to. Empty (the default) means the world frame. body_names - Names of the free-joint bodies to publish. Empty (the default) means every free-joint body in the model. topic - Output topic name. Defaults to "free_joint_states". publish_rate - Publish frequency in Hz. Defaults to 50.0.
When frame_id names another body, poses are expressed relative to that body's current world pose, and twists are rotated into that body's current world orientation without subtracting the reference body's own velocity.
|
overridevirtual |
Cleanup the plugin.
Implements mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.
|
overridevirtual |
Initialize the plugin.
| node | Shared pointer to the ROS 2 node for accessing parameters |
| model | Pointer to the MuJoCo model |
| data | Pointer to the MuJoCo data |
Implements mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.
|
overridevirtual |
Called once per write() cycle, on the control thread, after the hardware interface has staged the controller commands and right before they are sent to the simulation.
Plugins run in order and can read and rewrite ctrl/qfrc_applied. The default forwards to the deprecated update() so plugins that still override it keep working.
| model | Pointer to the MuJoCo model |
| data | Pointer to a recent snapshot (not the live mj_data_) |
Reimplemented from mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.