Skip to content

Communication Stack

VisionFlow-PX4 supports multiple communication protocols and middleware, enabling data exchange between the flight controller, simulation, ground station, and ROS2.

Communication Protocol Overview

uORB Message Bus

uORB (micro Object Request Broker) is PX4's internal message bus, using a publish-subscribe pattern.

Message Count

  • Approximately 180+ .msg files in total
  • Includes standard PX4 messages and custom messages

Custom Messages

MessagePurposePublisher
ArmJointState.msgArm joint stategamma_arm_dynamics
CollisionConstraints.msgCollision avoidance constraintspregme_pos_control
NeuralControl.msgNeural network control debuggingmc_nn_control
TrajectorySetpoint6dof.msg6-DOF trajectory setpointposition controller
Rover* seriesRover-specific control messagesrover_differential

Zenoh Middleware

Zenoh is a lightweight alternative to DDS, suitable for resource-constrained environments.

Features

  • Low overhead, suitable for embedded deployment
  • Supports both publish-subscribe and request-reply modes
  • Interoperable with standard DDS

Configuration

The Zenoh module is located at src/modules/zenoh/ and communicates with the flight control core via uORB messages.

uXRCE-DDS Client

uXRCE-DDS implements DDS communication over serial links (UART/CAN/USB).

Use Cases

  • Bridge PX4 data to remote ROS2 nodes
  • Support real-time control in low-bandwidth environments
  • Communication channel for hardware-in-the-loop simulation

Module

Located at src/modules/uxrce_dds_client/, communicates with tools like MAVROS via UDP ports 14540/14557.

MAVLink is the de facto standard communication protocol in the UAV domain.

Connection Configuration

DirectionAddressPurpose
SITL -> GCSudp://:14540@localhost:14557Send to QGroundControl
MAVROSudp://:14540@localhost:14557ROS2 to flight controller communication

MAVROS Launch

bash
source thirdparty/install/setup.bash && \
  ros2 launch mavros px4.launch fcu_url:=udp://:14540@localhost:14557

ros-gz Bridge

The ros-gz Bridge provides data bridging between Gazebo and ROS2.

Launch Commands

bash
# Data bridging
bash windshape_dev/data_stream/gz_bridge/bridge_gz_ros.sh

# Camera stream
bash windshape_dev/data_stream/image_stream/camera_stream.sh

Bridged Topic Examples

Gazebo TopicROS2 TopicDescription
/camera/image_raw/camera/image_rawCamera image
/imu/imuInertial measurement unit
/gps/fix/gps/fixGPS positioning
/joint_states/joint_statesJoint state