You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
5
+
This repo is designed to make it easy to simulate Gazebo sensors and use/define them in your robots URDF.
6
+
It includes ROS2 URDF xacro's that properly define and configure the sensors for Gazebo.
7
+
Currently cameras (RGB, Depth or RGBD) are the only sensors supported but more will be added.
6
8
7
-
## Running Example Launch
9
+
This repo also offers convenient packages of common off the shelf sensors to make it easy to switch between simulation and hardware for the supported devices. If you would like your sensor added here please feel free to make a PR.
8
10
9
-
This package includes a launch file to start Gazebo, bridge the data to ROS 2 and display the simulated camera data in Rviz.
11
+
Example Realsense multi-camera simulation bridged to ROS 2:
12
+
<imgsrc="doc/realsense_gazebo.png" >
10
13
11
-
Once you have built this package and sourced your workspace you can run
-[Generic Gazebo Camera macros](gz_camera_macros/README.md) includes generic ROS xacro's that can be used to make a supported camera types
16
+
-[Realsense2 Gazebo Camera macros](realsense2_gz_description/README.md) includes xacros to define cameras in Gazebo that emulate a Realsense device available in `realsense2_description`
17
+
-[Orbbec Gazebo Camera macros](orbbec_gz_description/README.md) includes xacros to define cameras in Gazebo that emulate a Orbbec device available in the `orbbec_description` package on the [locus](https://github.com/locusrobotics/OrbbecSDK_ROS2/tree/locus) branch
15
18
16
-
> Note: you can specify `headless:=false` and it will also open the Gazebo GUI.
19
+
In the [package.xml](gz_camera_macros/package.xml) of the generic macros or even a specific camera like the [Realsense](realsense2_gz_description/package.xml)
20
+
they do not require Gazebo be installed because they are just xacro definitions.
21
+
You need the following packages available if you would like to run the simulator and example launch files.
22
+
```xml
23
+
<depend>robot_state_publisher</depend>
24
+
<depend>image_proc</depend>
25
+
<depend>ros_gz_bridge</depend>
26
+
<depend>ros_gz_sim</depend>
27
+
<depend>rviz2</depend>
28
+
```
17
29
18
-
Which should start a simulated camera in Gazebo with a few objects in front of it. In the Rviz window that launches you can see the RGB images streaming along with the point cloud in the main view.
30
+
# Known Issues
31
+
Gazebo parameter [optical_frame_id](https://github.com/gazebosim/gz-sensors/blob/fc8692c075001e9379d1ffe84c19149f49b43da5/src/CameraSensor.cc#L715-L716) is deprecated and will be removed at some point.
32
+
Attempting to use the `<sensor>`/`<gz_frame_id>` parameter to correct the frame_id for the camera_info topic does not to play nice and results in lots of
33
+
`XML Element[gz_frame_id], child of element[sensor], not defined in SDF. Copying[gz_frame_id] as children of [sensor].`
34
+
warnings printed for each camera instance.
19
35
20
-
<imgsrc="doc/realsense_gazebo.png"width="50%" >
36
+
The RGBD camera does NOT use the parameter `optical_frame_id` correctly any more and publishes the data with an incorrect frame_id.
21
37
38
+
### Usage
22
39
23
-
# Example Usage in URDF
40
+
In your robots URDF....
24
41
25
-
In your robots urdf.xacro include the desired Realsense model along with its Gazebo description.
42
+
1. Include and run your camera's description xacro:
> Note: Gazebo plugins can only be included once so the xacros in this repo assume that a parent will include/run the required Sensors plugin when starting simulation.
42
59
This plugin can be started from your URDF or world.sdf file.
43
60
```xml
@@ -48,18 +65,44 @@ This plugin can be started from your URDF or world.sdf file.
48
65
</gazebo>
49
66
```
50
67
51
-
you can also refer to the the [example.urdf.xacro](./urdf/example_d415_gazebo.urdf.xacro) included.
52
-
53
-
## Gazebo only features
54
-
55
-
Gazebo offers a triggered based RGB camera that can be enabled by passing `triggered="true"` to the Gazebo description xacro.
56
-
Currently this feature does not appear to not work with the RGBD sensor, but will hopefully be added soon.
57
-
Switching the camera to only `trigger` when requested allows developers to better control the computation load required by each sensor.
58
-
Note triggering is not a feature the Realsense hardware offers unfortunately.
59
-
60
-
To trigger the camera from the command line you can publish on the Gazebo topic `camera_name/trigger`.
3. When simulating add to your robot's Gazebo launch file to start and configure the bridge `Node` so that you can see the simulated data as ROS topics:
Then call the desired macro and specify the same `name` and camera properties.
12
+
```xml
13
+
<xacro:ifvalue="${type == 'rgbd'}">
14
+
<xacro:gazebo_rgbdname="${name}"
15
+
fps="${fps}"
16
+
gz_topic_name="${gz_topic_name}"
17
+
image_width="${image_width}"
18
+
image_height="${image_height}"
19
+
h_fov="${camera_h_fov}"
20
+
v_fov="${camera_v_fov}"
21
+
min_depth="${min_depth}"
22
+
max_depth="${max_depth}"/>
23
+
</xacro:if>
24
+
<xacro:ifvalue="${type == 'rgb'}">
25
+
<xacro:gazebo_rgbname="${name}"
26
+
fps="${fps}"
27
+
gz_topic_name="${gz_topic_name}"
28
+
image_width="${image_width}"
29
+
image_height="${image_height}"
30
+
h_fov="${camera_h_fov}"
31
+
v_fov="${camera_v_fov}"
32
+
triggered="${triggered}"/>
33
+
</xacro:if>
34
+
```
35
+
36
+
> Note: Gazebo plugins can only be included once so the xacros in this repo assume that a parent will include/run the required Sensors plugin when starting simulation.
37
+
This plugin can be started from your URDF or world.sdf file.
0 commit comments