The laser scanner shows vertically.

asked 2020-06-21 04:22:59 -0500

Ilya_novichok gravatar image

Hello. I have some problems with the lidar in Gazebo, he visualizes his viewing angle vertically (photo below). image description I understand that the problem is most likely in the urdf file and coordinates, but when changing the coordinates of the rpu, the position of the lidar relative to the base changes and becomes incorrect. I put the file description of the lidar and urdf. I use ubuntu 16.04, gazebo 7, ROS kinetic.

<gazebo reference="lidar_Link">
<sensor type="gpu_ray" name="head_hokuyo_sensor">
  <pose>0 0 0 1.57 0 0</pose>
  <visualize>true</visualize>
  <update_rate>40</update_rate>
  <ray>
    <scan>
      <horizontal>
        <samples>720</samples>
        <resolution>1</resolution>
        <min_angle>-1.57</min_angle>
        <max_angle>1.57</max_angle>
      </horizontal>
    </scan>
    <range>
      <min>0.10</min>
      <max>30.0</max>
      <resolution>0.01</resolution>
    </range>
    <noise>
      <type>gaussian</type>
      <!-- Noise parameters based on published spec for Hokuyo laser
           achieving "+-30mm" accuracy at range < 10m.  A mean of 0.0m and
           stddev of 0.01m will put 99.7% of samples within 0.03m of the true
           reading. -->
      <mean>0.0</mean>
      <stddev>0.01</stddev>
    </noise>
  </ray>
  <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
    <topicName>lidar</topicName>
    <frameName>lidar_Link</frameName>
  </plugin>
</sensor>

</gazebo>

     </joint>

  <link

    name="lidar_Link">

    <inertial>

      <origin

        xyz="-0.00748448520155036 0.0107642484685222 9.23258810867893E-05"

        rpy="0 0 0" />

       <mass
        value="1.32500692137329" />
      <inertia
        ixx="0.000608332242778497"
        ixy="0.000158213161725828"
        ixz="8.018601126292E-07"
        iyy="0.00108767494554066"
        iyz="3.10338854918562E-06"
        izz="0.000950463889297707" />

    </inertial>

    <visual>

      <origin

        xyz="0 0 0"

        rpy="0 0 0" />

      <geometry>

        <mesh

          filename="package://my_robot8/meshes/lidar_Link.STL" />

      </geometry>

      <material

        name="">

        <color

          rgba="0.792156862745098 0.819607843137255 0.933333333333333 1" />

      </material>

    </visual>

    <collision>

      <origin

        xyz="0 0 0"

        rpy="0 0 0" />

      <geometry>

        <mesh

          filename="package://my_robot8/meshes/lidar_Link.STL" />

      </geometry>

    </collision>

  </link>

  <joint

    name="lidar_Joint"

    type="fixed">

    <origin

      xyz="-0.00130997440115162 0.00362996782486146 0.083412672552623"

      rpy="1.57834120194613 -0.0293512866690902 1.57" />

    <parent

      link="base_link" />

    <child

      link="lidar_Link" />

    <axis

      xyz="0 0 0" />

Sorry for the visualization of the code, some problems...with my hands. Thanks in advance for your help!

edit retag flag offensive close merge delete