Browse Source

Add flag to visualize lidar in Gazebo

pull/30/merge
hello-binit 3 years ago
parent
commit
ed5a91cd1b
2 changed files with 5 additions and 3 deletions
  1. +2
    -1
      stretch_gazebo/launch/gazebo.launch
  2. +3
    -2
      stretch_gazebo/urdf/stretch_gazebo.urdf.xacro

+ 2
- 1
stretch_gazebo/launch/gazebo.launch View File

@ -8,6 +8,7 @@
<arg name="rviz" default="false"/> <arg name="rviz" default="false"/>
<arg name="model" default="$(find stretch_gazebo)/urdf/stretch_gazebo.urdf.xacro"/> <arg name="model" default="$(find stretch_gazebo)/urdf/stretch_gazebo.urdf.xacro"/>
<arg name="gpu_lidar" default="false"/> <arg name="gpu_lidar" default="false"/>
<arg name="visualize_lidar" default="false"/>
<arg name="world" default="worlds/empty.world"/> <arg name="world" default="worlds/empty.world"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch"> <include file="$(find gazebo_ros)/launch/empty_world.launch">
@ -20,7 +21,7 @@
<arg name="verbose" value="true"/> <arg name="verbose" value="true"/>
</include> </include>
<param name="robot_description" command="$(find xacro)/xacro $(arg model) gpu_lidar:=$(arg gpu_lidar)" />
<param name="robot_description" command="$(find xacro)/xacro $(arg model) gpu_lidar:=$(arg gpu_lidar) visualize_lidar:=$(arg visualize_lidar)" />
<!-- push robot_description to factory and spawn robot in gazebo --> <!-- push robot_description to factory and spawn robot in gazebo -->
<node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"

+ 3
- 2
stretch_gazebo/urdf/stretch_gazebo.urdf.xacro View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="stretch_description"> <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="stretch_description">
<xacro:arg name="gpu_lidar" default="false" /> <xacro:arg name="gpu_lidar" default="false" />
<xacro:arg name="visualize_lidar" default="false" />
<xacro:include filename="$(find stretch_description)/urdf/stretch_main.xacro" /> <xacro:include filename="$(find stretch_description)/urdf/stretch_main.xacro" />
<xacro:include filename="$(find stretch_description)/urdf/stretch_aruco.xacro" /> <xacro:include filename="$(find stretch_description)/urdf/stretch_aruco.xacro" />
@ -245,7 +246,7 @@
<material>Gazebo/Black</material> <material>Gazebo/Black</material>
<sensor type="ray" name="laser_sensor"> <sensor type="ray" name="laser_sensor">
<pose>0 0 0 0 0 0</pose> <pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<visualize>$(arg visualize_lidar)</visualize>
<update_rate>5.5</update_rate> <update_rate>5.5</update_rate>
<ray> <ray>
<scan> <scan>
@ -281,7 +282,7 @@
<material>Gazebo/Black</material> <material>Gazebo/Black</material>
<sensor type="gpu_ray" name="laser_sensor"> <sensor type="gpu_ray" name="laser_sensor">
<pose>0 0 0 0 0 0</pose> <pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<visualize>$(arg visualize_lidar)</visualize>
<update_rate>5.5</update_rate> <update_rate>5.5</update_rate>
<ray> <ray>
<scan> <scan>

Loading…
Cancel
Save