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

Plugin wrapper of the included 3D Lidar MuJoCo extension. More...

#include <mujoco_3d_lidar_plugin.hpp>

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

Public Member Functions

bool init (rclcpp::Node::SharedPtr node, const mjModel *model, mjData *data) override
 Initializes a new MujocoLidar wrapper object for 3d lidar sensors.
 
void update_write (const mjModel *model, mjData *data) override
 Callback to update the plugin's data.
 
void cleanup () override
 Destructs the plugin and all relevant data.
 
- 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 of the included 3D Lidar MuJoCo extension.

Will convert 3d_lidar sensor data from the physics simulation into the appropriate message and publish to the configured topic. Supports both 2-D and 3-D lidar sensor configs, and will publish either LaserScan or PointCloud messages according to the sensor type.

Member Function Documentation

◆ cleanup()

void mujoco_ros2_control_plugins::Mujoco3dLidarPlugin::cleanup ( )
overridevirtual

Destructs the plugin and all relevant data.

Implements mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.

◆ init()

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

Initializes a new MujocoLidar wrapper object for 3d lidar sensors.

Parameters
nodeWill be used to construct laserscan publishers
modelMuJoCo model for the simulation
dataMuJoCo data for the simulation

Implements mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.

◆ update_write()

void mujoco_ros2_control_plugins::Mujoco3dLidarPlugin::update_write ( const mjModel *  model,
mjData *  data 
)
overridevirtual

Callback to update the plugin's data.

Iterates over each lidar sensor and checks if new data is available. If not, this does nothing. If so, this will copy the sensor data into a relevant message type and publish it.

Reimplemented from mujoco_ros2_control_plugins::MuJoCoROS2ControlPluginBase.


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