Alternatives to "gpu_ray" sensor type

asked 2022-04-16 16:15:02 -0500

isiko gravatar image

I'm trying to implement the Nav2 Stack with my robot for basic navigation and was just using the provided XML for a Lidar, until I discovered that putting "ray" as the sensor type somehow broke some other unrelated code (the robot wasn't subscribing to the /cmd_vel topic anymore). The fix I found was to use "gpu_ray" as the sensor type, but as my Laptop doesn't have a real GPU this really hurts the performance of the simulation.

So my question is: Is there an alternative to the "gpu_ray"? Or is there something else that could be the Problem?

Here's the working XML from my urdf, the only difference to the buggy Version is in line 2, just swap out the type for "ray":

<gazebo reference="lidar_link">
    <sensor name="lidar" type="gpu_ray">
      <always_on>true</always_on>
      <visualize>true</visualize>
      <update_rate>30</update_rate>
      <ray>
        <scan>
          <horizontal>
            <samples>360</samples>
            <resolution>1.000000</resolution>
            <min_angle>0.000000</min_angle>
            <max_angle>6.280000</max_angle>
          </horizontal>
        </scan>
        <range>
          <min>0.200000</min>
          <max>3.5</max>
          <resolution>0.015000</resolution>
        </range>
        <noise>
          <type>gaussian</type>
          <mean>0.0</mean>
          <stddev>0.01</stddev>
        </noise>
      </ray>
      <plugin name="scan" filename="libgazebo_ros_ray_sensor.so">
        <ros>
          <namespace>/robot</namespace>
          <argument>~/out:=scan</argument>
        </ros>
        <output_type>sensor_msgs/LaserScan</output_type>
        <frame_name>lidar_link</frame_name>
      </plugin>
    </sensor>
  </gazebo>
edit retag flag offensive close merge delete