ROS2 lidar integration - via python launch file?

Does something like a python launch file template/example exist?
Or maybe some other way to interact with a lidar sensor in ROS2

For some time now i am trying to:

  1. Launch multiple drones in gazebo and control them via ros2 (got this :white_check_mark: )
  2. Add lidar to each drone that would then communicate to my corresponding ros2 nodes (nope :red_circle: )

Has one of you done something like that before/ got a hint for me?

I am stuck with the way of launching multiple drones such that i could add the lidar capability. does give me drones but of cause no way of such an interaction.

The closest thing of a python launch file that possibly would enable me to implement that I found here:

But I still have trouble adapting it to my problem.

Also having one separate command console for each drone instance would be very beneficial.


thank you very much for your post, I am new to ROS2 and looking for some guidance. I am actually trying to make the first point of your question work and really hope you can help me with that.

In particular, I am trying to “Launch multiple drones in gazebo and control them via ros2 (got this :white_check_mark: )”

So far, from what I understood, after running Gazebo with multiple vehicles, I need to open multiple px4 shells and run micrortps_client for each vehicle. Furthermore, on this post, they mention a launch file that is needed but I am not sure how to run it.

Therefore, can you please elaborate more on how to run Gazebo with multiple vehicles while controlling each vehicle using ROS2? How do you do it step by step?

So far I got the Gazebo running with multiple vehicles by running this command inside the PX4-Autopilot/Tools folder:

./ -n 6 -t px4_sitl_rtps

After this how can I open a px4 shell for each vehicle so that I can run a micrortps_client for each vehicle?

Thank you very much dor your time and availability