ros2_control - kilted
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mujoco_ros2_control_plugins::RangefinderLidarPlugin Class Reference

Plugin wrapper for MuJoCo rangefinder-based lidar sensors. More...

#include <rangefinder_lidar_plugin.hpp>

Inheritance diagram for mujoco_ros2_control_plugins::RangefinderLidarPlugin:
Inheritance graph
[legend]
Collaboration diagram for mujoco_ros2_control_plugins::RangefinderLidarPlugin:
Collaboration graph
[legend]

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.
 

Detailed Description

Plugin wrapper for MuJoCo rangefinder-based lidar sensors.

This handles the legacy pattern where individual mjSENS_RANGEFINDER sensors are grouped by name convention (e.g. lidar_name-0, lidar_name-1, ...) and published as LaserScan messages.

Member Function Documentation

◆ cleanup()

void mujoco_ros2_control_plugins::RangefinderLidarPlugin::cleanup ( )
overridevirtual

◆ init()

bool mujoco_ros2_control_plugins::RangefinderLidarPlugin::init ( rclcpp::Node::SharedPtr  node,
const mjModel *  model,
mjData *  data 
)
overridevirtual

Initialize the plugin.

Parameters
nodeShared pointer to the ROS 2 node for accessing parameters
modelPointer to the MuJoCo model
dataPointer to the MuJoCo data
Returns
true if initialization was successful
Note
This method will be called once when the plugin is loaded. It can be used to read parameters, set up publishers/subscribers, etc. The node will be a child of the main mujoco_ros2_control node, so parameters should be namespaced accordingly.

Implements mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.

◆ update_write()

void mujoco_ros2_control_plugins::RangefinderLidarPlugin::update_write ( const mjModel *  model,
mjData *  data 
)
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.

Parameters
modelPointer to the MuJoCo model
dataPointer to a recent snapshot (not the live mj_data_)

Reimplemented from mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.


The documentation for this class was generated from the following files: