PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.17k stars 13.36k forks source link

ROS2 PX4 Colcon build notes/ideas #21668

Open dagar opened 1 year ago

dagar commented 1 year ago

PX4-Autopilot fully building in colcon (optionally)

bradenwagstaff commented 1 year ago

I took Jae's stuff and expanded on it a little bit. The main change I made is you can launch a simulation without QGC, fly that quad using keyboard teleop controls to control velocity setpoints instead of position setpoints. It also all runs under one launch file and runs a node that manages MicroDDS and PX4

I'm currently making an in depth tutorial targeted at new ROS2/PX4 users to help them get this example running and will film a tutorial walk through within the next week. A lot of this is motivated from the recent ROS call and the expressed need for tutorials that help people get started

https://github.com/ARK-Electronics/ws_ROS2_PX4_Simulation

Current example is setup as a new workspace, but I'm currently retrofitting it to be a package you can pull into any workspace

beniaminopozzan commented 1 year ago

A few thoughts about having ROS 2 nodes in tree and building them with colcon

FYI: At the moment we have the ros2 target, and if we place PX4-Autopilot in a colcon workspace, colcon build will compile a package called px4 containing the PX4 msgs (a copy of the px4_msgs package but with different name). Well, this is true if you are using ROS Foxy but the compilation is broken in Humble (see #21128) the issue seems to arise from calling add_subdirectory in the CMakeLists.txt file.

Slightly off-topic: this action https://github.com/ros-tooling/action-ros-ci may be useful to test future ROS 2 nodes (see https://github.com/PX4/px4_msgs/pull/26)

Jaeyoung-Lim commented 1 year ago

Different packages must be placed in different folders and cannot be nested. I don't know if this can be accomplished without changing completely the PX4 tree like

@beniaminopozzan Probably we can try to make each of the px4 module a colcon package? we can then have a small meta package that runs the rcs

DronecodeBot commented 1 year ago

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-july-05-2023/32963/1