ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

cant visualize gpu ray in rviz

asked 2017-01-05 04:56:30 -0500

dinesh gravatar image

updated 2021-09-22 15:39:48 -0500

jayess gravatar image

When i try to use the gpu ray sensor in my velodyne model urdf file, it is not publishing any topic. When i put the same line of code for sensor in another urdf file of another robot it works fine and i can also visualize the topic in rviz, but i cant use the same sensor in below urdf file, what is the problem can anyone once check it. Here when i launch it in gazebo i can clearly see the blue laser coming out from the model.

<?xml version="1.0"?>
<robot name="laser">

  <link name="base">

    <visual>
      <origin rpy="0 0 0" xyz="0 0 0.017335"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_base.dae"/>
      </geometry>
    </visual>

    <collision>
      <origin rpy="0 0 0" xyz="0 0 0.029335"/>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_base.dae"/>
      </geometry>
    </collision>

    <inertial>
      <origin rpy="0 0 0" xyz="0 0 0.029335"/>
      <mass value="0.5"/>
      <inertia ixx="0.000090623" ixy="0.0" ixz="0.0" iyy="0.000090623" iyz="0.0" izz="0.000091036"/>
    </inertial>
  </link>

  <link name="top">
    <origin rpy="0 0 0" xyz="0 0 0.085455"/>

    <visual>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_top.dae"/>
      </geometry>
    </visual>

    <collision>
      <geometry>
        <mesh filename="package://myrobot1_description/meshes/velodyne_top.dae"/>
      </geometry>
    </collision>

    <inertial>
      <mass value="0.5"/>
      <inertia ixx="0.000090623" ixy="0.0" ixz="0.0" iyy="0.000090623" iyz="0.0" izz="0.000091036"/>
    </inertial>

  </link>

      <joint name="joint_1" type="revolute">
        <origin rpy="0 0 0" xyz="0 0 0.077"/>
        <axis xyz="0 0 1"/>
        <limit effort="1000.0" lower="-10000000000000000" upper="10000000000000000" velocity="0.5"/>
        <parent link="base"/>
        <child link="top"/>
      </joint>

      <gazebo reference="top">
        <sensor type="gpu_ray" name="head_hokuyo_sensor">
          <pose>0 0 0.025 1.5707 0 0</pose>
          <visualize>true</visualize>
          <update_rate>30</update_rate>
          <ray>
            <scan>
              <horizontal>
                <samples>30</samples>
                <resolution>0.01</resolution>
                <min_angle>-0.174</min_angle>
                <max_angle>0.173</max_angle>
              </horizontal>
            </scan>
            <range>
              <min>0.001</min>
              <max>100</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>/velodyne/laser/scan</topicName>
            <frameName>camera_link</frameName>
          </plugin>
        </sensor>
      </gazebo>

    </robot>

And confusing thing is that when i run rostopic list i cant see the topic /velodyne/laser/scan but when i run the command rostopic echo /velodyne/laser/scan i can see the information, like header, range distance etc. but when i launch rviz and put the fixed fram as camera frame than laser topic as /velodyne/laser/scan i can see nothing.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-09-22 06:39:29 -0500

jannkar gravatar image

Looks like your plugin is publishing laser data to wrong frame. This would explain why rviz cannot visualize your laser data, but you can see the data in the scan topic.

Change "camera_link" from the line

<frameName>camera_link</frameName>

to the frame which matches your laser frame.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-01-05 04:56:30 -0500

Seen: 1,021 times

Last updated: Sep 22 '21