Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Pose getting ignored in urdf

I am trying to get a sensor with the type ray on my robot. In order to get it working both on ROS and Gazebo i created multiple urdf-Files and combined them with xacro. The <sensor>-Tag does work but the <pose> -Tag gets ignored. The lidar is rotated to the wrong direction so i tried to rotate it 90° on the z-Axis. But it seems that it doesnt affect the sensor. Am I using the tag wrong or how am I supposed to change the direction and position of the sensor?

My Gazebo version is 9.9.0

<?xml version="1.0"?>
<robot name="lidar" xmlns:xacro="http://www.ros.org/wiki/xacro">
 <xacro:macro name="lidar">
     <link name="lidar">
         <visual>
             <geometry>
                 <mesh filename="package://titanic_description/meshes/lidar.dae"/>
              </geometry>
          </visual>
      </link>

      <joint name="lidar_to_base" type="fixed">
          <parent link="base_link"/>>
          <child link="lidar"/>
         <origin xyz="0 0.29 0.08" />
       </joint>

    <gazebo reference="lidar">
          <sensor type="ray" name="head_hokuyo_sensor">
              <pose>0 0 0 0 0 1.57070</pose>
              <visualize>true</visualize>
              <update_rate>10</update_rate>
              <ray>
                  <scan>
                      <horizontal>
                          <samples>100</samples>
                          <resolution>1</resolution>
                          <min_angle>-1.570796</min_angle>
                          <max_angle>1.570796</max_angle>
                      </horizontal>
                  </scan>
                  <range>
                      <min>0.10</min>
                      <max>30.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_
laser.so">
                  <topicName>scan</topicName>
                  <frameName>lidar</frameName>
              </plugin>
          </sensor>
      </gazebo>
  </xacro:macro>

</robot>

image description