Gazebo | Ignition | Community
Ask Your Question
0

help for installing lidar on a drone

asked 2023-07-31 09:27:11 -0500

SébastienL gravatar image

Hi all,

I'm trying to install a lidar on a drone (x500, model provided by PX4 repo).
I found several examples, but all seems outdated.

For the plugin, an example give the name of libgazebo_ros_ray_sensor.so, another libgazebo_ros_laser.so. Some doc points to https://github.com/ros-simulation/gaz... to get the plugin, but the list of available branch is huge, and I already installed libgz-sim7-plugins on my machine (which contains libgz-sensors7-lidar.so that "does not export any plugins").

Well I'm totally lost ! Which plugin should I used ?

I'm using gazebo garden on ubuntu 22.04. Here is part of my sdf file

<sdf version="1.10">
  <model name="x500_lidar">
    <include><uri>model://x500</uri>[...]</include>

  <!--add lidar-->
  <link name="hokuyo_link">
    <pose>0 0 0 0 0 0</pose>
    [...]
    <sensor type="gpu_ray" name="laser">
      <pose>0 0 0.3 0 0 1.57</pose>
      [...]
      <plugin name="hokuyo_node" filename="libgz-sensors7-lidar.so">
        <robotNamespace></robotNamespace>
        <topicName>/spur/laser/scan</topicName>
        <frameName>/hokuyo_sensor_link</frameName>
      </plugin>
    </sensor>
  </link>
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2023-08-01 03:57:09 -0500

SébastienL gravatar image

Answering my own question : I found solution in ros_gz/ros_gz_sim_demos/launch/gpu_lidar_bridge.launch.py

In there, I read that plugin gz-sim-sensors-system was the one to use, I have had this clue somewhere, but can't make it worked.
For the sensor itself it's almost the same i used, except the type which is 'gpu_lidar' (param value are also little differents, but I did not check yet how important this is).

Note this publish on gz topics, not ROS2, I have to use a bridge to be able to use those data in ROS (but that is expected).

<sensor name='gpu_lidar' type='gpu_lidar'>
  <pose>0 0 0 0 0 0</pose>
  <topic>lidar</topic>
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-07-31 09:27:11 -0500

Seen: 309 times

Last updated: Aug 01 '23