ros2

ros2 topic list
ros2 topic echo /fmu/out/vehicle_status_v1
ros2 run px4_ros_com offboard_control.py

PX4 <-> ROS2

uXRCE-DDS (PX4-ROS 2/DDS Bridge)

Self compile options works. Only issue was it changed a python library version which created copile issues with PX4

This is a PX4 Firmware bug as mentioned here and here. The python package ‘empy’ used by WSL must be downgraded to version 3.3.4. You can follow the below instructions.

    pip uninstall em
    pip uninstall empy
    pip install empy==3.3.4

To start the agent with settings for connecting to the uXRCE-DDS client running on the simulator:

MicroXRCEAgent udp4 -p 8888

Building the Workspace

  1. To create and build the workspace:

    Open a new terminal.

    Create and navigate into a new workspace directory using:

mkdir -p ws_sensor_combined/src/
cd ws_sensor_combined/src
  1. Clone the example repository and px4_msgs to the /src directory (the main branch is cloned by default, which corresponds to the version of PX4 we are running):
git clone https://github.com/PX4/px4_msgs.git
git clone https://github.com/PX4/px4_ros_com.git
  1. Source the ROS 2 development environment into the current terminal and compile the workspace using colcon:

Keep synced wrt to main and releases

https://github.com/PX4/px4_msgs?tab=readme-ov-file#px4_msgs

cd ..
ros2dev
colcon build

This builds all the folders under /src using the sourced toolchain.

  1. Launch the example.
ros2 run px4_ros_com offboard_control

Resources

PX4 ROS 2 Offboard Control Python offboarding https://github.com/mavlink/MAVSDK-Python/blob/main/examples/telemetry_takeoff_and_land.py

https://github.com/dheera/rosshow

Did not work :

Previous
Next