Mon, Mar 07, 22, organized structure and tree map of px4 messages and parameters
This is a draft, the content is not complete and of poor quality!

px4 uorb_graph

fw_autotune_attitude_controlmc_autotune_attitude_controlangular_velocity_controllerlanding_target_estimatortemperature_compensationlocal_position_estimatorlightware_laser_serialattitude_estimator_qlightware_laser_i2cairship_att_controlflight_mode_managermag_bias_estimatorfw_pos_control_l1rover_pos_controlbattery_simulatorairspeed_selectorcontrol_allocatorvtol_att_controlgyro_calibrationtemplate_modulepca9685_pwm_outms5525_airspeedms4525_airspeedrgbled_ncp5623cfrsky_telemetrycamera_feedbacksensor_baro_simuuv_pos_controluuv_att_controlmc_rate_controlcamera_captureulanding_radarsdp3x_airspeedhott_telemetrycamera_triggermanual_controlsensor_gps_simsensor_mag_simmc_pos_controlmc_att_controlbattery_statusfw_att_controlactuator_testsafety_buttonland_detectortune_controlets_airspeedled_controlpwm_out_simmpu9250_i2cpps_capturespektrum_rclsm9ds1_magesc_batterymotor_testmicrobenchbmi088_i2cll40ls_pwmleddar_oneterarangerbatt_smbusuavcannodetone_alarmrgbled_pwmiridiumsbdsend_eventuavcan_v1adis16477adis16470adis16448adis16497icm42688picm40609dicm42670picm20608gpwm_inputtattu_canboard_adcrpi_rc_inmpl3115a2tcbp001tathoneflowlsm303agrcommandersimulatornavigatorrc_updateicm20602icm42605icm20689icm20649icm20948mappydoticp10111icp10100roboclawneopixelrc_inputvcm1193lqmc5883lgyro_fftload_monfailurelsm9ds1lsm303dmpu6000mpu9250mpu6500ads1115afbrs50vl53l1xcm8jl65vl53l0xgy_us42tap_esclps22hbmpc2520lps33hwpca9685pmw3901paw3902px4flowpwm_outist8308ist8310hmc5883ak09916lis3mdlsensorsina226ina228voxlpmina238heaterbmi055bmi088l3gd20uavcanmb12xxll40lspga460tfminiirlockdps310lps25hbmp280ms5611bmp388ms5837atxxxxrgbledbatmonbmm150rm3100ak8963gimballoggertestspx4iosrf05srf02dshotekf2gpsbstsihvehicle_global_position_groundtruthvehicle_local_position_groundtruthposition_controller_landing_statusautotune_attitude_control_statusvehicle_local_position_setpointgimbal_device_attitude_statusvehicle_attitude_groundtruthvehicle_angular_accelerationmagnetometer_bias_estimateposition_controller_statusactuator_controls_status_0vehicle_attitude_setpointestimator_selector_statusposition_setpoint_tripletcontrol_allocator_statusvehicle_angular_velocitymanual_control_switchesvehicle_global_positionvehicle_thrust_setpointvehicle_torque_setpointmanual_control_setpointvehicle_visual_odometryvehicle_local_positionestimator_status_flagsvehicle_rates_setpointvehicle_mocap_odometryestimator_sensor_biasvehicle_land_detecteddifferential_pressurevehicle_gps_positionvehicle_accelerationactuator_outputs_simvehicle_control_modevehicle_status_flagssensor_preflight_magactuator_servos_trimactuator_controls_2actuator_controls_0actuator_controls_1landing_target_posetrajectory_setpointvehicle_command_ackactuator_controls_3vehicle_constraintsvtol_vehicle_statusvehicle_imu_statuspower_button_stateairspeed_validatedsensors_status_imutransponder_reportsensor_correctionrtl_time_estimateiridiumsbd_statusestimator_statusvehicle_attitudevehicle_air_datasensor_gyro_fifoactuator_outputssensor_selectionsensor_gyro_fftdistance_sensorvehicle_commandgeofence_resultgps_inject_dataactuator_motorssensor_combinedactuator_armedbattery_statustakeoff_statusaction_requestvehicle_statuscamera_triggermission_resultactuator_testirlock_reporthome_positionoptical_flowpx4io_statuslanding_gearsystem_powertune_controlsensor_accelsensor_baropps_capturesensor_gyrovehicle_imuled_controlvehicle_roitecs_statustest_motoradc_reportesc_statussensor_gpssensor_magpwm_inputinput_rcairspeedcpuloadsafetywind

uORB Messaging

Introduction

The uORB is an asynchronous publish() / subscribe() messaging API used for inter-thread/inter-process communication.

Look at the tutorial to learn how to use it in C++.

uORB is automatically started early on bootup as many applications depend on it. It is started with uorb start. Unit tests can be started with uorb_tests.

Adding a new topic

New uORB topics can be added either within the main PX4/PX4-Autopilot repository, or can be added in an out-of-tree message definitions. For information on adding out-of-tree uORB message definitions, please see this section.

To add a new topic, you need to create a new .msg file in the msg/ directory and add the file name to the msg/CMakeLists.txt list. From this, the needed C/C++ code is automatically generated.

Have a look at the existing msg files for supported types. A message can also be used nested in other messages.

To each generated C/C++ struct, a field uint64_t timestamp will be added. This is used for the logger, so make sure to fill it in when publishing the message.

To use the topic in the code, include the header:

#include <uORB/topics/topic_name.h>

By adding a line like the following in the .msg file, a single message definition can be used for multiple independent topics:

# TOPICS mission offboard_mission onboard_mission

Then in the code, use them as topic id: ORB_ID(offboard_mission).

Publishing

Publishing a topic can be done from anywhere in the system, including interrupt context (functions called by the hrt_call API). However, advertising a topic is only possible outside of interrupt context. A topic has to be advertised in the same process as it’s later published.

Listing Topics and Listening in

:::note The listener command is only available on Pixracer (FMUv4) and Linux / OS X. :::

To list all topics, list the file handles:

ls /obj

To listen to the content of one topic for 5 messages, run the listener:

listener sensor_accel 5

The output is n-times the content of the topic:

TOPIC: sensor_accel #3
timestamp: 84978861
integral_dt: 4044
error_count: 0
x: -1
y: 2
z: 100
x_integral: -0
y_integral: 0
z_integral: 0
temperature: 46
range_m_s2: 78
scaling: 0

TOPIC: sensor_accel #4
timestamp: 85010833
integral_dt: 3980
error_count: 0
x: -1
y: 2
z: 100
x_integral: -0
y_integral: 0
z_integral: 0
temperature: 46
range_m_s2: 78
scaling: 0

:::tip On NuttX-based systems (Pixhawk, Pixracer, etc) the listener command can be called from within the QGroundControl MAVLink Console to inspect the values of sensors and other topics. This is a powerful debugging tool because it can be used even when QGC is connected over a wireless link (e.g. when the vehicle is flying). For more information see: Sensor/Topic Debugging. :::

uorb top Command

The command uorb top shows the publishing frequency of each topic in real-time:

update: 1s, num topics: 77
TOPIC NAME                        INST #SUB #MSG #LOST #QSIZE
actuator_armed                       0    6    4     0 1
actuator_controls_0                  0    7  242  1044 1
battery_status                       0    6  500  2694 1
commander_state                      0    1   98    89 1
control_state                        0    4  242   433 1
ekf2_innovations                     0    1  242   223 1
ekf2_timestamps                      0    1  242    23 1
estimator_status                     0    3  242   488 1
mc_att_ctrl_status                   0    0  242     0 1
sensor_accel                         0    1  242     0 1
sensor_accel                         1    1  249    43 1
sensor_baro                          0    1   42     0 1
sensor_combined                      0    6  242   636 1

The columns are: topic name, multi-instance index, number of subscribers, publishing frequency in Hz, number of lost messages per second (for all subscribers combined), and queue size.

Multi-instance

uORB provides a mechanism to publish multiple independent instances of the same topic through orb_advertise_multi. It will return an instance index to the publisher. A subscriber will then have to choose to which instance to subscribe to using orb_subscribe_multi (orb_subscribe subscribes to the first instance). Having multiple instances is useful for example if the system has several sensors of the same type.

Make sure not to mix orb_advertise_multi and orb_advertise for the same topic.

The full API is documented in platforms/common/uORB/uORBManager.hpp.

uorb tree source

pf7 implementation

Message/Field Deprecation

As there are external tools using uORB messages from log files, such as Flight Review, certain aspects need to be considered when updating existing messages:

  • Changing existing fields or messages that external tools rely on is generally acceptable if there are good reasons for the update. In particular for breaking changes to Flight Review, Flight Review must be updated before code is merged to master.
  • In order for external tools to reliably distinguish between two message versions, the following steps must be followed:
    • Removed or renamed messages must be added to the deprecated_msgs list in msg/CMakeLists.txt and the .msg file needs to be deleted.
    • Removed or renamed fields must be commented and marked as deprecated. For example uint8 quat_reset_counter would become # DEPRECATED: uint8 quat_reset_counter. This is to ensure that removed fields (or messages) are not re-added in future.
    • In case of a semantic change (e.g. the unit changes from degrees to radians), the field must be renamed as well and the previous one marked as deprecated as above.

The following wiki, pages and posts are tagged with

TitleTypeExcerpt
2021-09-26-thesis-indoor-drone.md post After launching a file, call the following services to initialize the drone in Gazebo and the Particle Filter algorithm
Udemy qt5 course by Packt Publishing post Tue, Oct 26, 21, Dive into custom model-views, showcasing the power and flexibility of the mvodel view architecture, with extensive www applications
Pilot handbook + drone resource wiki post Tue, Nov 02, 21, pilot's handbook summarized on top of key cocnepts from rapa drone-resource
Single rotor drone post Thu, Nov 04, 21, single rotor air vehilce with rudder and flap to navigate
Pilot's preflight checklist FAA post Tue, Nov 09, 21, preflight checklist with data mining, d3 visualization and google sheet implementation
final-project post Sat, Nov 27, 21, motion planning dashboard with django vue and fcnd
motion planning dashboard hardware setup post Wed, Dec 01, 21, master, raspi, database, video-streaming, api server setup
px4 mavlink and qgc integration with 4gremoteoperation post Tue, Jan 18, 22, powerful 3d simulation environment for autonomous robots suitable for testing object-avoidance and cv
Airlink by skydrone, youtube post Friday, airlink for mission flight, LTE connectivity and dl-ready
set up with raspi connected to fc post Tue, Jan 25, 22, ardupilot documentation
drone programming primer for software development post Mon, Jan 31, 22, flight stack with firmware middleware and api
runcam with fc connection post Tue, Feb 15, 22, runcam split 2 with fc
my new fixed wing AR Wing Pro, ready for dji HD fpv system post Thu, Feb 17, 22, setup guide after opening the package
realflight 7 setup and console game post Thu, Feb 24, 22, flight simulation with real flight 7
uavmatrix's cast pro docs post Tue, Mar 01, 22, another way to integrate devices to gcs
firmtech7 of naver cafe raspi drone project post Thu, Mar 03, 22, using raspi as fc to control small drone
Garupner Polaron ex post Sun, Mar 06, 22, polaron 2 channels dc charger
svg visualization messages and parameters post Mon, Mar 07, 22, organized structure and tree map of px4 messages and parameters
lx network, airlink, gcs and data transmission on smart radio, rf mesh and quantum encryption post Tue, Apr 26, 22, all about setup and how it operates and managed
Advanced Features page
Advanced Configuration page
Advanced Flight Controller Orientation Tuning page
rflysim tltr page
Bootloader Update page
Bootloader Flashing onto Betaflight Systems page
Compass Power Compensation page
drones.md page my drones I work with and at my disposal.
ESC Calibration page
Flight Termination Configuration page
my 100 supporters page my freelancers I work with since 2018.
index.md page My recent projects are leveraging generative AI across various domains, yielding significant achievements. These encompass Digital Twin, Voice-to-Command, RA...
Land Detector Configuration page
About this site and its author portfolio My portofolio site and its mission statement
🔭AIOT projects page summary.
contents deploy automation page Pilot test on the automation prototype.
pixhawk apm racing drone page summary.
Challenger Engineering Project page summary.
pixhawk tools page rFlyeval project details where Matlab Mathwor Simulink were used for complete process of UAV and UAS.
Korea drone companies page summary.
Racing drone, attck drone page summary.
Django Django Two scoops page summary.
docker learning curve page summary.
🔭 Ground Control Station web-based approach page summary.
gitlab page summary.
🔭lora monitoring app page summary.
🔭 MQTT pages page summary.
My course list page my course list from udemy, udacity, NCS and other sources
Nextcloud page summary.
Automation pipeline page summary.
Pixhawk 4 page summary.
Pixhawk overview page summary.
🔭raspberry pi project page summary.
🔭yuneec realsense obstacle avoidance page summary.
ROS topic for micro control page summary.
🔭 RQt-based gui page summary.
🔭sensor detection page RealSense with Open3D
🔭Serializer with API page summary.
Rules of thumb page Contact me for any support issues.
web-dev ops pages page
🔭 Webrtc page summary.
Parameter Reference page
Finding/Updating Parameters page
Precision Landing page
pixhawk tools advanced page rFlyeval project details where Matlab Mathwork Simulink were used for complete process of UAV and UAS.
pixhawk tools page rFlyeval project details where Matlab Mathwor Simulink were used for complete process of UAV and UAS.
RTK GPS page GNSS/GPS systems
Iridium/RockBlock Satellite Communication System page
Static Pressure Buildup page # Static Pressure Buildup Air flowing over an enclosed vehicle can cause the *static pressure* to change within the canopy/hull. Depending on the location of holes/leaks in the hull, you can end up with under or overpressure (similar to a wing). The change in pressure can affect barometer measurements, leading...
Air Traffic Avoidance: ADS-B/FLARM page
Air Traffic Avoidance: UAS Traffic Management (UTM) page
Using the ECL EKF page