Gazebo | Ignition | Community
Ask Your Question
1

Set intensity for an object so gazebo_ros_laser will notice

asked 2013-10-08 08:47:16 -0600

annah.do gravatar image

updated 2013-10-10 10:43:35 -0600

nkoenig gravatar image

Hey, I'm very new to ros and gazebo.

I'm trying to make the gazeboroslaser notice a reflecting Object. But when I check this->parent_ray_sensor_->GetLaserShape()->GetRetro(ja) in the gazebo_ros_laser.cpp it is set to zero.

in my urdf file i set the laser retro value to 200

    <robot name="reflector">
  <link name="test_reflector">
    <inertial>
      <origin xyz="5 5 2" /> 
      <mass value="1.0" />
      <inertia  ixx="0.0" ixy="0.0"  ixz="0.0"  iyy="0.0"  iyz="0.0"  izz="0.0" />
    </inertial>
    <visual>
      <origin xyz="5 5 2"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
      <material name="Cyan">
    <color rgba="0 1.0 1.0 1.0"/>
      </material>
      <laserRetro>200.0</laserRetro>
    </visual>
    <collision>
      <origin xyz="5 5 2"/>
      <geometry>
        <box size="1 1 2" />
      </geometry>
      <laserRetro>200.0</laserRetro>
    </collision>
  </link>
 <gazebo reference="test_reflector">
    <material>Gazebo/Grey</material>
    <laserRetro>200</laserRetro>
    <turnGravityOff>true</turnGravityOff>
 </gazebo>

could you please tell me what I'm doing wrong?

Also I would really like to know how the information I specified in the urdf-file finally gets to the class RayShape. Should this not happen somewhere in urdf2gazebo.cpp?

Thanks for your help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-10-10 10:47:00 -0600

nkoenig gravatar image

Try wrapping the laser retro values inside a <gazebo> element. Also, change <laserRetro> to <laser_retro>. Your use of camel case in your URDF suggests that your using a very old version of Gazebo. Can you check that you're using a recent version (1.9 or greater is ideal).

Example laser retro:

<gazebo>
  <laser_retro>200</laser_retro>
</gazebo>
edit flag offensive delete link more

Comments

I'm using gazebo 1.0.2. (with ros fuerte). Unfortunately I'm kinda bound to that version for now :( I tried what you suggested. but it doesn't seem to make a difference. I wrapped the laser retro value inside a gazebo element and tried with both laserRetro and laserretro. I also edited my code from above and replaced all the laserRetro with laserretro but nothing. Do you have any other suggestions? Thx

annah.do gravatar imageannah.do ( 2013-10-11 04:26:40 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2013-10-08 08:47:16 -0600

Seen: 3,792 times

Last updated: Oct 10 '13