Open dagar opened 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
A few thoughts about having ROS 2 nodes in tree and building them with colcon
We should have different packages in tree:
Node that "manages" existing PX4 full SITL use case builds and deploys embedded PX4 (eg px4_fmu-v5x)
in @dagar initial post
Node that wraps micro XRCE DDS agent Node that translates existing PX4 topics to ROS2 standard (odometry, sensors, etc) could be a good place to handle logging, parameters bidirectionally
in the initial post.
in this way we can keep everything well organized without splitting everything in different repos. Long term goal, having the possibility to do sudo apt install ros-"some version"-px4
would be pretty nice.
PX4-Autopilot
├── PX4-core # the current PX4-Autopilot
├── PX4-coms # communication package
├── PX4-tutorials # tutorial package
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)
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
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
PX4-Autopilot fully building in colcon (optionally)