Ft: Gazebo lidar template for ROS2#22
Conversation
|
#21 This one should be merged first to avoid potential conflicts. |
|
Points for discussion:
|
|
We also need something like this for the depth cameras since we no longer only use Realsense... For now, I've created an issue. Maybe I'll find some time sometime to actually solve it :D |
|
Yep, having parametric depth cameras would be great! So please, work on this :-). For now, I am dealing with the static tfs by a custom tf publisher.. |
Ft ros2 tf pub
|
Just small update on this PR:
ToDo list
Therefore, please do not merge this PR yet. |
|
@TomasMerva As we discussed, please also include the namespace in the frame names. You can check to have the TF structured similarly to the ROS1 version. Anyway, Good work! PS: If the PR is not in the ready state, you can switch it to |
…joints instead of links
Ft rplidar
…ill not detect it
|
What has changed:
Things to keep in mind or suggestions
|
… same way as in URDF
|
Re-enabled lidars for all supported platforms:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a general LIDAR template for ROS2 using the default Gazebo plugin and reorganizes sensor components into separate folders. The main changes include:
- Implementation of a new
SdfTfPublisherutility to generate static TF transforms from SDF files - Reorganization of sensor templates into dedicated folders (
rangefinder/,lidar/,camera/) - Addition of LIDAR sensor templates (RPLidar, Scanse Sweep, Velodyne, Ouster) with support for both 2D and 3D LIDARs
- Updates to the bridge configuration to handle LIDAR topics
- Refactoring of the camera macro to remove link/joint creation and use pose offsets instead
Reviewed Changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mrs_uav_gazebo_simulator/utils/sdf_to_tf_publisher.py | New utility class for parsing SDF files and publishing static TF transforms for sensors |
| mrs_uav_gazebo_simulator/mrs_drone_spawner.py | Updated to support LIDAR sensors, integrate TF publisher, and reorganize sensor detection logic |
| models/mrs_robots_description/sdf/components/lidar/*.sdf.jinja | New LIDAR sensor templates (ouster, rplidar, scanse_sweep, velodyne) |
| models/mrs_robots_description/sdf/components/rangefinder/*.sdf.jinja | Reorganized rangefinder templates (garmin, teraranger) |
| models/mrs_robots_description/sdf/components/camera/*.sdf.jinja | Reorganized camera templates (bluefox, mobius) |
| models/mrs_robots_description/sdf/components/component_snippets.sdf.jinja | Updated to import from reorganized component folders |
| models/mrs_robots_description/sdf/generic_components.sdf.jinja | Added new LIDAR plugin macro, refactored camera macro |
| config/uav_ros_gz_bridge_config.yaml.jinja | New bridge configuration template supporting cameras and LIDARs |
| models/mrs_robots_description/sdf/*.sdf.jinja | Updated drone models to use new component organization and add LIDAR sensors |
| launch/*.launch.py | Minor formatting and parameter name changes |
| config/spawner_params.yaml | Added TF static publisher configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>


Hi,
I added a general template for the LIDAR using the default Gazebo plugin and separated the individual sensors into their own folders.
Things that still need to be done:
tf2 static publisheris required. Therefore, a custom plugin wrapper forGazebo::Lidarshould be implemented as you do in ROS1.component_snippets.sdf.jinjaandgeneric_components.sdf.jinja. These should each be moved into separate folders or removed since none of them has been implemented yet.Camera::Image::RawandCamera::Infoare currently loaded in different ways. It would be good to unify this and load everything throughuav_ros_gz_bridge_config.jinja.yaml.