robot IR position [closed]

asked 2012-08-06 01:00:48 -0500

pmarinplaza gravatar image

updated 2014-01-28 17:13:15 -0500

ngrennan gravatar image

Hello,

I am trying to add one IR device in my robot using libgazebo_ros_laser.so to have the lectures at the left of the robot.

In the urdf file I already add this lines:

  <!-- IR SENSOR -->

  <joint name="ir_01_joint" type="fixed">
     <axis xyz="1 0 0" />
     <origin xyz="-0.31 0 0.5" rpy="0 0 0"/>
     <parent link="base_link"/>
     <child link="ir_01_link"/>
  </joint>
  <link name="ir_01_link" type="laser">
     <inertial>
       <mass value="0.001" />
       <origin xyz="0 0 1" rpy="0 0 0" />
       <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.000001" iyz="0" izz="0.0001" />
    </inertial>
  </link>

 <!-- IR Visual in gazebo/rviz -->
 <joint name="ir_01_box_joint" type="fixed">
    <origin xyz="0 0 0" rpy="0 0 0" />
    <parent link="ir_01_link" />
    <child link="ir_01_box_link"/>
  </joint>
  <link name="ir_01_box_link">
    <origin pose="0 0 0 0 0 0"/>
    <inertial>
      <mass value="0.01" />
      <origin xyz="0 0 0" rpy="0 0 0" />
      <inertia ixx="0.001"  ixy="0.0"  ixz="0.0"
               iyy="0.001"  iyz="0.0"
               izz="0.001" />
    </inertial>
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.02 0.05 0.02" />   
      </geometry>
    </visual>
    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <box size="0.02 0.05 0.02" />
      </geometry>
    </collision>
  </link>

  <gazebo reference="ir_01_box_link">
    <material>Gazebo/Grey</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
   <!-- IR controller -->
   <gazebo reference = "ir_01_link">
    <sensor:ray name="ir_01">
       <rayCount>2</rayCount>
       <rangeCount>2</rangeCount>
       <laserCount>1</laserCount>

       <origin>0.0 0.0 0.0</origin>
       <displayRays>true</displayRays>

       <minAngle>0</minAngle>
       <maxAngle>0.1</maxAngle>

       <minRange>0.03</minRange>
       <maxRange>10</maxRange>
       <resRange>0.001</resRange>
       <updateRate>10.0</updateRate>
       <controller:gazebo_ros_laser name="gazebo_ros_ir_01_controller" plugin="libgazebo_ros_laser.so">
         <gaussianNoise>0.005</gaussianNoise>
         <alwaysOn>true</alwaysOn>
         <updateRate>10.0</updateRate>
         <topicName>ir_01_topic</topicName>
         <frameName>ir_01_link</frameName>
         <interface:laser name="gazebo_ros_ir_01_iface" />
       </controller:gazebo_ros_laser>
    </sensor:ray>
   </gazebo>

The tf looks great, and the messages of laserscan display very well. The fact is that I want see the objects at the left of the robot not in front of it.

I try to change this line:

<joint name="ir_01_joint" type="fixed">
     <axis xyz="1 0 0" />
     <origin xyz="-0.31 0 0.5" rpy="0 0 1.57"/>

Rviz show me the laserscan at the left the robot (it is nice) but the lectures still be in front of the robot. I take a capture to explain better:

without obstacles: http://postimage.org/image/ae3oj2d4h/ (direct image: http://s16.postimage.org/ldovuo3jp/rviz1.png)

with obstacles: http://postimage.org/image/isfcso2d1/ (direct image: http://s10.postimage.org/6116m5sl5/total2.png)

The lectures are wrong :(

I don't know where I should change the rpy parameter to have the lectures correct. Any Idea? Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant. Please see http://wiki.ros.org/Support for more details. by tfoote
close date 2015-03-03 01:58:58.569745

Comments

Please ask gazebo questions at http://answers.gazebosim.org

tfoote gravatar image tfoote  ( 2015-03-03 01:58:53 -0500 )edit