Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Format Status](https://github.com/MarqRazz/realsense2_gz_description/actions/workflows/format.yaml/badge.svg)](https://github.com/MarqRazz/realsense2_gz_description/actions/workflows/format.yaml)

Description: This ROS 2 package is designed to be used in unison with [realsense2_description](https://github.com/IntelRealSense/realsense-ros/tree/ros2-master/realsense2_description) and allows for easy definition of Realsense cameras that can be simulated in Gazebo Fortress and newer. It may support other versions of Ignition Gazebo but this has not been tested.
Description: This ROS 2 package is designed to be used in unison with [realsense2_description](https://github.com/IntelRealSense/realsense-ros/tree/ros2-master/realsense2_description) and allows for easy definition of Realsense cameras that can be simulated in Gazebo Fortress and newer. It may support other versions of Gazebo but this has not been tested.

## Running Example Launch

Expand Down Expand Up @@ -42,7 +42,7 @@ Then call the xacros and specify the same `name` and other optional arguments.
This plugin can be started from your URDF or world.sdf file.
```xml
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
Expand Down
16 changes: 8 additions & 8 deletions launch/example_realsense_gazebo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def generate_launch_description():
condition=IfCondition(launch_rviz),
)

ignition_spawn_entity = Node(
gz_spawn_entity = Node(
package="ros_gz_sim",
executable="create",
output="screen",
Expand All @@ -122,17 +122,17 @@ def generate_launch_description():
)

# Bridge the camera data to ROS and match the default topics that the real camera would publish
# Note the gz_topic_name comes from _realsense_model.gazebo.xacro defaults which defaults to `camera` here.
# Note the gz_topic_name comes from <realsense_model>.gazebo.xacro which is defaulting to `camera` in this example.
gazebo_bridge = Node(
package="ros_gz_bridge",
executable="parameter_bridge",
parameters=[{"use_sim_time": True}],
arguments=[
"/camera/image@sensor_msgs/msg/Image[ignition.msgs.Image",
"/camera/depth_image@sensor_msgs/msg/Image[ignition.msgs.Image",
"/camera/points@sensor_msgs/msg/PointCloud2[ignition.msgs.PointCloudPacked",
"/camera/camera_info@sensor_msgs/msg/CameraInfo[ignition.msgs.CameraInfo",
"/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock",
"/camera/image@sensor_msgs/msg/Image[gz.msgs.Image",
"/camera/depth_image@sensor_msgs/msg/Image[gz.msgs.Image",
"/camera/points@sensor_msgs/msg/PointCloud2[gz.msgs.PointCloudPacked",
"/camera/camera_info@sensor_msgs/msg/CameraInfo[gz.msgs.CameraInfo",
"/clock@rosgraph_msgs/msg/Clock[gz.msgs.Clock",
],
remappings=[
(
Expand Down Expand Up @@ -163,7 +163,7 @@ def generate_launch_description():
robot_state_publisher_node,
rviz_node,
OpaqueFunction(function=launch_gz),
ignition_spawn_entity,
gz_spawn_entity,
gazebo_bridge,
]

Expand Down
2 changes: 1 addition & 1 deletion urdf/_d405.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<robot name="gazebo_d405" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_d405" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<xacro:include filename="$(find realsense2_gz_description)/urdf/rgb_camera.gazebo.xacro" />
<xacro:include filename="$(find realsense2_gz_description)/urdf/rgbd_camera.gazebo.xacro" />
Expand Down
2 changes: 1 addition & 1 deletion urdf/_d415.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<robot name="gazebo_d415" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_d415" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<xacro:include filename="$(find realsense2_gz_description)/urdf/rgb_camera.gazebo.xacro" />
<xacro:include filename="$(find realsense2_gz_description)/urdf/rgbd_camera.gazebo.xacro" />
Expand Down
2 changes: 1 addition & 1 deletion urdf/_d435.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<robot name="gazebo_d435" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_d435" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<xacro:include filename="$(find realsense2_gz_description)/urdf/rgb_camera.gazebo.xacro" />
<xacro:include filename="$(find realsense2_gz_description)/urdf/rgbd_camera.gazebo.xacro" />
Expand Down
2 changes: 1 addition & 1 deletion urdf/_d455.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<robot name="gazebo_d455" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_d455" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<xacro:include filename="$(find realsense2_gz_description)/urdf/rgb_camera.gazebo.xacro" />
<xacro:include filename="$(find realsense2_gz_description)/urdf/rgbd_camera.gazebo.xacro" />
Expand Down
2 changes: 1 addition & 1 deletion urdf/example_d415_gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Starting this plugin in the top level allows developers to define multiple cameras in their robot and only include the plugin once.
If you don't want to start the Sensors plugin in your URDF you can move starting this plugin to the world.sdf file you are working with. -->
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
Expand Down
8 changes: 4 additions & 4 deletions urdf/rgb_camera.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<robot name="gazebo_rgb" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_rgb" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<!--
Gazebo plugins can only be included once so this xacro assumes that a parent will include and configure them.
This xacro requires Gazebo plugin:
- ignition::gazebo::systems::Sensors
- gz::sim::systems::Sensors
to publish simulated RGB camera data

For example:
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
Expand Down Expand Up @@ -60,7 +60,7 @@ For example:
<triggered>${triggered}</triggered>
<trigger_topic>${name}/trigger</trigger_topic>
</camera>
<ignition_frame_id>${name}_color_frame</ignition_frame_id>
<gz_frame_id>${name}_color_frame</gz_frame_id>
<always_on>1</always_on>
<update_rate>${fps}</update_rate>
<topic>${gz_topic_name}/image</topic>
Expand Down
8 changes: 4 additions & 4 deletions urdf/rgbd_camera.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<robot name="gazebo_rgbd" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:ignition="http://gazebosim.org/schema">
<robot name="gazebo_rgbd" xmlns:xacro="http://www.ros.org/wiki/xacro" xmlns:gz="http://gazebosim.org/schema">

<!--
Gazebo plugins can only be included once so this xacro assumes that a parent will include and configure them.
This xacro requires Gazebo plugin:
- ignition::gazebo::systems::Sensors
- gz::sim::systems::Sensors
to publish simulated RGBD camera data

For example:
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
Expand Down Expand Up @@ -89,7 +89,7 @@ For example:
</depth_camera>
<optical_frame_id>${name}_color_optical_frame</optical_frame_id>
</camera>
<ignition_frame_id>${name}_color_frame</ignition_frame_id>
<gz_frame_id>${name}_color_frame</gz_frame_id>
<always_on>1</always_on>
<update_rate>${fps}</update_rate>
<visualize>false</visualize>
Expand Down
18 changes: 9 additions & 9 deletions world/example.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
filename="gz-sim-physics-system"
name="gz::sim::systems::Physics">
</plugin>
<plugin
filename="ignition-gazebo-user-commands-system"
name="ignition::gazebo::systems::UserCommands">
filename="gz-sim-user-commands-system"
name="gz::sim::systems::UserCommands">
</plugin>
<plugin
filename="ignition-gazebo-scene-broadcaster-system"
name="ignition::gazebo::systems::SceneBroadcaster">
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
</plugin>

<light type="directional" name="sun">
Expand Down Expand Up @@ -65,19 +65,19 @@
<include>
<pose>1.2 0.0 0.0 0.0 0.0 1.57</pose>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Construction Cone
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Construction Cone
</uri>
</include>
<include>
<pose>1.2 0.5 0.0 0.0 0.0 1.57</pose>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Suitcase2H
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Suitcase2H
</uri>
</include>
<include>
<pose>1.2 -0.5 0.0 0.0 0.0 1.57</pose>
<uri>
https://fuel.ignitionrobotics.org/1.0/OpenRobotics/models/Suitcase1H
https://fuel.gazebosim.org/1.0/OpenRobotics/models/Suitcase1H
</uri>
</include>
</world>
Expand Down
Loading