Gazebo | Ignition | Community
Ask Your Question

Ray sensor not showing on urdf robot

asked 2020-10-20 03:46:38 -0500

MichelleMouse gravatar image


I don't know if this is the right place to post this question, but this issue is driving me crazy. I couldn't solve it myself and thought I could run it over with everyone here, see if someone had the same issue.

I have created a URDF model of my robot following gazebo tutorial. This robot has a Velodyne sensor at the front, the mesh is showing, and it is somehow rotating when I press play, the ray is not showing. I do not know if I have written something wrong because the sensor tag is showing on gazebo when I select the Velodyne link, but the ray is not showing at all. Is it normal? I have not connected to my ROS project yet, and I do not know how to check if I am getting data otherwise (first time using Gazebo).

This is the part of the URDF where the Velodyne is, it is inside <robot> tag

<link name="velodyne_base">
  <origin xyz="0 0 0.029335" rpy="0 0 0" />
    <mass value="1.2" />
    <inertia ixx="0.00108747" iyy="0.00108747" izz="0.00109244" ixy="0" ixz="0" iyz="0"/>
  <collision name="base_collision">
      <cylinder radius="0.04267" length="0.029335" />
  <visual name="base_visual">
    <pose frame="">0 0 -0.029335 0 -0 0</pose>
      <mesh filename="model://mower_description/meshes/velodyne_base.dae" />
<link name="velodyne_top">
  <origin xyz="0 0 0.095455" rpy="0 0 0" />
    <mass value="0.1" />
    <inertia ixx="0.000090623" iyy="0.000090623" izz="0.000091036" ixy="0" ixz="0" iyz="0" />
  <collision name="top_collision">
      <cylinder radius="0.04267" length="0.07357" />
  <visual name="top_visual">
      <mesh filename="model://mower_description/meshes/velodyne_top.dae"/>
<gazebo reference="velodyne_base">
 <gazebo reference="velodyne_top">
  <sensor name="sensor" type="ray">
    <pose frame=''>0 0 -0.004645 0 -0 0</pose>

And this is the joint between the velodyne links

<joint name="velodyne_joint" type="revolute">
    <parent link="velodyne_base" />
    <child link="velodyne_top" />
    <limit lower="-1e+16" upper="1e+16" effort="-1" velocity="-1" />
    <origin xyz="0 0 0.05867" rpy="0 -0 0" />
    <axis xyz="0 0 1" />

The sensor tag on the code, I also tried just adding it by not using <gazebo> tag, as urdf supports it, but still nothing showing the ray working area that I specified. When I open gazebo and insert the Velodyne sensor SDF model by itself, it shows the working area, but once I insert my URDF robot model, the sensor on it does not show any ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-23 17:59:20 -0500

MichelleMouse gravatar image

Hi, at the end ended up solving the issue by creating a master model and including my URDF and velodyne SDF files in it, then added a joint to fix them together.

 <model name="mower_complete">
      <pose>0 0 0 0 0 0</pose>
      <pose>1.15 0 0.6 0 0 0</pose>
    <joint type="fixed" name="sensor_to_mower_joint">
      <pose>0 0 -0.036785 0 0 0</pose>

The Velodyne sensor ray is working now and the topic is being published. I do not know if this is the best practice or recommended, but it is working!

Please let me know if there is a better way to include this, as the gazebo tag did not work on Gazebo 9 Ros Medolic.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2020-10-19 14:27:00 -0500

Seen: 351 times

Last updated: Oct 23 '20