Skip to content

Commit

Permalink
Refactor gpu_lidar_bridge demo
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <[email protected]>
  • Loading branch information
caguero committed Nov 6, 2024
1 parent ad225a2 commit 335407c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 66 deletions.
6 changes: 6 additions & 0 deletions ros_gz_sim_demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

install(
DIRECTORY
config/
DESTINATION share/${PROJECT_NAME}/config
)

install(
DIRECTORY
launch/
Expand Down
2 changes: 1 addition & 1 deletion ros_gz_sim_demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ GPU lidar data can be obtained as:

Using the bridge:

ros2 launch ros_gz_sim_demos gpu_lidar_bridge.launch.py
ros2 launch ros_gz_sim_demos gpu_lidar_bridge.launch.xml

*TODO*: Blocked by `ros_gz_point_cloud` [issue](https://github.com/gazebosim/ros_gz/issues/40).

Expand Down
18 changes: 18 additions & 0 deletions ros_gz_sim_demos/config/gpu_lidar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# GPU lidar configuration.
- ros_topic_name: "/lidar"
gz_topic_name: "/lidar"
ros_type_name: "sensor_msgs/msg/LaserScan"
gz_type_name: "gz.msgs.LaserScan"
subscriber_queue: 5
publisher_queue: 6
lazy: false
direction: GZ_TO_ROS

- ros_topic_name: "/lidar/points"
gz_topic_name: "/lidar/points"
ros_type_name: "sensor_msgs/msg/PointCloud2"
gz_type_name: "gz.msgs.PointCloudPacked"
subscriber_queue: 5
publisher_queue: 6
lazy: false
direction: GZ_TO_ROS
65 changes: 0 additions & 65 deletions ros_gz_sim_demos/launch/gpu_lidar_bridge.launch.py

This file was deleted.

6 changes: 6 additions & 0 deletions ros_gz_sim_demos/launch/gpu_lidar_bridge.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<gz_server world_sdf_file="gpu_lidar_sensor.sdf" use_composition="True" create_own_container="True" />
<ros_gz_bridge bridge_name="ros_gz_bridge" config_file="$(find-pkg-share ros_gz_sim_demos)/config/gpu_lidar.yaml" use_composition="True" />
<node pkg="rviz2" exec="rviz2" args="-d $(find-pkg-share ros_gz_sim_demos)/rviz/gpu_lidar_bridge.rviz" />
<executable cmd="gz sim -g" />
</launch>

0 comments on commit 335407c

Please sign in to comment.