Robotics StackExchange | Archived questions

i have created my own model and attached a lidar to it i can view the output in the gazebo topic viewerr. But How exactly do i view the output of the lidar in rviz?

i cant seem to view any of the lidar data in rviz tho i can view the image of the outline in the gazebo topic viewer

Asked by Rajnunes on 2016-04-11 02:12:20 UTC

Comments

Answers

You have to use a gazebo_ros plugin that will publish a topic that you will be able to view in rviz.

A code that I am using (model is in urdf format) :

    <link name="safety_lidar_front_left">
    <visual>
        <geometry>
            <cylinder radius="0.0525" length="0.152"/>
        </geometry>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.0525" length="0.152"/>
        </geometry>
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia
        ixx="0.0025" ixy="0.0" ixz="0.0"
        iyy="0.0025" iyz="0.0"
        izz="0.0012"/>
    </inertial>
   </link>
<!--Set lidar parameters-->
<gazebo reference="safety_lidar_front_left">
    <gravity>0</gravity>
    <sensor type="gpu_ray" name="safety_lidar_front_left_sensor">
      <pose>0 0 0.036 0 0 0.785</pose>
      <visualize>true</visualize>
      <update_rate>40</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>720</samples>
            <resolution>1</resolution>
            <min_angle>-2.36</min_angle>
            <max_angle>2.36</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.5</min>
          <max>50.0</max>
          <resolution>0.01</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
          <topicName>scan_front_left</topicName>
          <frameName>safety_lidar_front_left</frameName>
      </plugin>
    </sensor>
</gazebo>

Asked by Brosseau.F on 2016-04-11 10:07:10 UTC

Comments

is it possible for you to share with me your plugin ..?

Asked by Rajnunes on 2016-04-11 11:02:31 UTC

OMG Never mind Thanks it worked @Brosseau.F :)

Asked by Rajnunes on 2016-04-11 11:16:42 UTC