Skip to content

Commit

Permalink
Gazebo ignition multirobots (#39)
Browse files Browse the repository at this point in the history
* added namespaces for astra rplidar

Signed-off-by: Jakub Delicat <[email protected]>

* added namespace gazebo to other rplidars

Signed-off-by: Jakub Delicat <[email protected]>

* Tabs + ns

---------

Signed-off-by: Jakub Delicat <[email protected]>
Co-authored-by: rafal-gorecki <[email protected]>
  • Loading branch information
delihus and rafal-gorecki authored Jan 11, 2024
1 parent d57d797 commit 4c98e10
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 41 deletions.
18 changes: 12 additions & 6 deletions urdf/orbbec_astra.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
params="parent_link xyz rpy
tf_prefix:=None
camera_name:=camera
namespace:=None
simulation_engine:=gazebo-classic">

<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${tf_prefix == 'None'}">
<xacro:property name="prefix" value="" />
</xacro:if>
Expand Down Expand Up @@ -90,7 +98,7 @@
<always_on>true</always_on>
<update_rate>20.0</update_rate>

<topic>${camera_name}</topic>
<topic>${ns}${camera_name}</topic>
<!-- It is not possible to split the frame of the color and the depth stream.
The frame of color stream should be ${prefix}${camera_name}_color_optical_frame -->
<ignition_frame_id>${prefix}${camera_name}_depth_optical_frame</ignition_frame_id>
Expand All @@ -107,13 +115,11 @@
<far>8.0</far>
</clip>
</camera>
<ros>
<namespace>${ns}</namespace>
</ros>
</sensor>
</gazebo>
<!-- <gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo> -->
</xacro:if>

<xacro:if value="${simulation_engine == 'gazebo-classic'}">
Expand Down
20 changes: 13 additions & 7 deletions urdf/slamtec_rplidar_a2.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@
topic:=scan
frame_id:=laser
model:=A2M12
namespace:=None
simulation_engine:=gazebo-classic">

<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${use_gpu}">
<xacro:if value="${simulation_engine == 'gazebo-classic'}">
<xacro:property name="ray_type" value="gpu_ray" />
Expand Down Expand Up @@ -100,9 +108,9 @@

<xacro:if value="${simulation_engine == 'ignition-gazebo'}">
<gazebo reference="${prefix}${frame_id}">
<sensor type="${ray_type}" name="${prefix}rplidar_a2_sensor">
<sensor type="${ray_type}" name="${ns}${prefix}rplidar_a2_sensor">

<topic>${topic}</topic>
<topic>${ns}${topic}</topic>
<frame_id>${prefix}${frame_id}</frame_id>
<ignition_frame_id>${prefix}${frame_id}</ignition_frame_id>

Expand All @@ -129,13 +137,11 @@
</ray>
<always_on>true</always_on>
<visualize>false</visualize>
<ros>
<namespace>${ns}</namespace>
</ros>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
</xacro:if>

<xacro:if value="${simulation_engine == 'gazebo-classic'}">
Expand Down
21 changes: 14 additions & 7 deletions urdf/slamtec_rplidar_a3.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
tf_prefix:=None
topic:=scan
frame_id:=laser
namespace:=None
simulation_engine:=gazebo-classic">


<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${use_gpu}">
<xacro:if value="${simulation_engine == 'gazebo-classic'}">
<xacro:property name="ray_type" value="gpu_ray" />
Expand Down Expand Up @@ -75,9 +84,9 @@

<xacro:if value="${simulation_engine == 'ignition-gazebo'}">
<gazebo reference="${prefix}${frame_id}">
<sensor type="${ray_type}" name="${prefix}rplidar_a3_sensor">
<sensor type="${ray_type}" name="${ns}${prefix}rplidar_a3_sensor">

<topic>${topic}</topic>
<topic>${ns}${topic}</topic>
<frame_id>${prefix}${frame_id}</frame_id>
<ignition_frame_id>${prefix}${frame_id}</ignition_frame_id>

Expand Down Expand Up @@ -105,13 +114,11 @@
</ray>
<always_on>true</always_on>
<visualize>false</visualize>
<ros>
<namespace>${ns}</namespace>
</ros>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
</xacro:if>

<xacro:if value="${simulation_engine == 'gazebo-classic'}">
Expand Down
21 changes: 14 additions & 7 deletions urdf/slamtec_rplidar_s1.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
tf_prefix:=None
topic:=scan
frame_id:=laser
namespace=None
simulation_engine:=gazebo-classic">


<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${use_gpu}">
<xacro:if value="${simulation_engine == 'gazebo-classic'}">
<xacro:property name="ray_type" value="gpu_ray" />
Expand Down Expand Up @@ -83,9 +92,9 @@

<xacro:if value="${simulation_engine == 'ignition-gazebo'}">
<gazebo reference="${prefix}${frame_id}">
<sensor type="${ray_type}" name="${prefix}rplidar_s1_sensor">
<sensor type="${ray_type}" name="${ns}${prefix}rplidar_s1_sensor">

<topic>${topic}</topic>
<topic>${ns}${topic}</topic>
<frame_id>${prefix}${frame_id}</frame_id>
<ignition_frame_id>${prefix}${frame_id}</ignition_frame_id>

Expand All @@ -112,13 +121,11 @@
</ray>
<always_on>1</always_on>
<visualize>false</visualize>
<ros>
<namespace>${ns}</namespace>
</ros>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
</xacro:if>

<xacro:if value="${simulation_engine == 'gazebo-classic'}">
Expand Down
20 changes: 13 additions & 7 deletions urdf/slamtec_rplidar_s2.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
tf_prefix:=None
topic:=scan
frame_id:=laser
namespace=None
simulation_engine:=gazebo-classic">

<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${use_gpu}">
<xacro:if value="${simulation_engine == 'gazebo-classic'}">
<xacro:property name="ray_type" value="gpu_ray" />
Expand Down Expand Up @@ -75,9 +83,9 @@

<xacro:if value="${simulation_engine == 'ignition-gazebo'}">
<gazebo reference="${prefix}${frame_id}">
<sensor type="${ray_type}" name="${prefix}rplidar_s2_sensor">
<sensor type="${ray_type}" name="${ns}${prefix}rplidar_s2_sensor">

<topic>${topic}</topic>
<topic>${ns}${topic}</topic>
<frame_id>${prefix}${frame_id}</frame_id>
<ignition_frame_id>${prefix}${frame_id}</ignition_frame_id>

Expand All @@ -104,13 +112,11 @@
</ray>
<always_on>1</always_on>
<visualize>false</visualize>
<ros>
<namespace>${ns}</namespace>
</ros>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
</gazebo>
</xacro:if>

<xacro:if value="${simulation_engine == 'gazebo-classic'}">
Expand Down
20 changes: 13 additions & 7 deletions urdf/slamtec_rplidar_s3.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
tf_prefix:=None
topic:=scan
frame_id:=laser
namespace=None
simulation_engine:=gazebo-classic">

<xacro:if value="${namespace == 'None'}">
<xacro:property name="ns" value="" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
<xacro:property name="ns" value="${namespace}/" />
</xacro:unless>

<xacro:if value="${use_gpu}">
<xacro:if value="${simulation_engine == 'gazebo-classic'}">
<xacro:property name="ray_type" value="gpu_ray" />
Expand Down Expand Up @@ -75,9 +83,9 @@

<xacro:if value="${simulation_engine == 'ignition-gazebo'}">
<gazebo reference="${prefix}${frame_id}">
<sensor type="${ray_type}" name="${prefix}rplidar_s3_sensor">
<sensor type="${ray_type}" name="${ns}${prefix}rplidar_s3_sensor">

<topic>${topic}</topic>
<topic>${ns}${topic}</topic>
<frame_id>${prefix}${frame_id}</frame_id>
<ignition_frame_id>${prefix}${frame_id}</ignition_frame_id>

Expand Down Expand Up @@ -105,11 +113,9 @@
<always_on>1</always_on>
<visualize>false</visualize>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>
<ros>
<namespace>${ns}</namespace>
</ros>
</gazebo>
</xacro:if>

Expand Down

0 comments on commit 4c98e10

Please sign in to comment.