Browse Source

Add flag to visualize lidar in Gazebo

bugfix/gazebo_rviz
hello-binit 3 years ago
parent
commit
c7b832ec37
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="model" default="$(find stretch_gazebo)/urdf/stretch_gazebo.urdf.xacro"/>
<arg name="gpu_lidar" default="false"/>
<arg name="visualize_lidar" default="false"/>
<arg name="world" default="worlds/empty.world"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
@ -20,7 +21,7 @@
<arg name="verbose" value="true"/>
</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 -->
<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"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="stretch_description">
<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_aruco.xacro" />
@ -245,7 +246,7 @@
<material>Gazebo/Black</material>
<sensor type="ray" name="laser_sensor">
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<visualize>$(arg visualize_lidar)</visualize>
<update_rate>5.5</update_rate>
<ray>
<scan>
@ -281,7 +282,7 @@
<material>Gazebo/Black</material>
<sensor type="gpu_ray" name="laser_sensor">
<pose>0 0 0 0 0 0</pose>
<visualize>true</visualize>
<visualize>$(arg visualize_lidar)</visualize>
<update_rate>5.5</update_rate>
<ray>
<scan>

Loading…
Cancel
Save