PX4 Autopilot Software
Go to file
Beat Küng bae275898b rc/sbus: restart parser after sucessful decoding & increase time limit
Instead of directly passing the next packet to the parser after successful
parsing, switch the state to SBUS2_DECODE_STATE_SBUS_START and search for
the start byte again.

The timeout is increased as the IO main loop also takes a bit of time
(max ~0.7ms).

Tested on v5x with Futaba R7008SB (60Hz update rate) and FrSky X8R (111Hz
update rate).

Background:
When using the Futaba R7008SB, I noticed there's additional bytes added in
between packets. Often it's a null byte, but sometimes more. There's some
consistency but I did not find any documentation for it.
Sample data:
a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05 ec
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 c0 8b
00 0f 04 ec 1f a8 fb 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00
14 00 0f 04 ec 1f a8 fb 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80
00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10
80 00 34 00 0f 05 ec 1f 30 60 bf 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 34 00 0f 07 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 04 00 03 c0 31 00 0f 05 fc 1f a8 fb 07 16 5b 81 05 d4
a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 05 fc 1f a8 fb 07 16 5b 81 05
d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 04 ec 1f a8 fd 07 16 5b 81
05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 04 ec 1f a8 fd 07 16 5b
81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03 c4 00 00 0f 04 ec 1f
a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 04 ec
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 04
ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f
05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00
03 c0 31 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02
10 80 00 14 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00
02 10 80 00 24 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40
00 02 10 80 00 34 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80
00 04 00 03 c0 31 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00
01 08 40 00 02 10 80 00 34 00 0f 05 f4 1f a8 fb 07 16 5b 81 05 d4 a0 06 20
00 01 08 40 00 02 10 80 00 04 00 03 c4 00 00 b0 60 7f 1c bd 07 16 5b 81 05
d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81
05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b
81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05 ec 1f a8 fb 07 16
5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03 c0 31 00 b0 60 bf
1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 14 00 0f 04 f4
1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 24 00 30 70
7f 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 34 00 0f 05
f4 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10 80 00 04 00 03
c4 00 00 0f 05 fc 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01 08 40 00 02 10
80 00 14 00 0f 05 ec 1f b0 60 bf 1c bd 07 16 5b 81 05 d4 a0 06 20 00 01 08
40 00 02 10 80 00 14 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00 01
08 40 00 02 10 80 00 24 00 0f 05 ec 1f a8 fd 07 16 5b 81 05 d4 a0 06 20 00

This was causing the parser to skip entire packets resulting in an update
rate of ~31Hz on the FMU side.
With this patch the update rate increases to 42-48Hz.

The investigation was triggered by an RC glitch with a packet containing
random channel data. It's likely, although not completely verified that
the frequent desync randomly happend to pass the CRC check with garbage
data.
2022-08-23 21:07:18 -04:00
.ci Jenkins: reboot after ostest completes 2022-05-31 01:41:07 -07:00
.clusterfuzzlite Add clusterfuzzlite to fuzz in CI 2022-01-07 10:17:12 -05:00
.devcontainer ci: update container versions to 2021-09-08 2021-09-09 09:43:15 +02:00
.github Docs are now in user guide and main (#19977) 2022-08-01 11:39:39 +10:00
.vscode new Ignition Gazebo simulation interface architecture (#20057) 2022-08-22 10:58:19 -04:00
Documentation DriverFramework purge 2020-01-13 14:07:03 -05:00
ROMFS new Ignition Gazebo simulation interface architecture (#20057) 2022-08-22 10:58:19 -04:00
Tools new Ignition Gazebo simulation interface architecture (#20057) 2022-08-22 10:58:19 -04:00
boards boards: modalai_fc-v2 configure SPI6, disable unused SPI3/4 (#20093) 2022-08-22 20:58:44 -04:00
cmake new Ignition Gazebo simulation interface architecture (#20057) 2022-08-22 10:58:19 -04:00
integrationtests/python_src/px4_it Spelling errors (#19935) 2022-07-27 14:33:16 +10:00
launch Fix roslaunch multivehicle regression caused by #16497 2021-01-12 21:19:36 +01:00
msg FW attitue controller: fix publishing of rate controller status 2022-08-19 09:40:48 +02:00
platforms platforms/nuttx: Fix hard coded path for karch library 2022-08-23 21:05:41 -04:00
posix-configs drivers/differential_pressure: remove lib/drivers/airspeed dependency and cleanup 2022-04-26 08:39:19 -04:00
src rc/sbus: restart parser after sucessful decoding & increase time limit 2022-08-23 21:07:18 -04:00
test FollowMe : Replace First order target position filter with Second order position and velocity filter 2022-06-16 16:14:57 -04:00
test_data lib/rc: Fix DSM2/DSMX guessing routine and DSM range checking (#18270) 2022-04-13 17:29:08 -04:00
validation Spelling errors (#19935) 2022-07-27 14:33:16 +10:00
.ackrc ack: add .ackrc to ignore the Documentation directory 2016-04-11 11:23:01 +02:00
.clang-tidy .clang-tidy: exclude some warnings 2022-07-20 01:14:04 -04:00
.gitattributes gitattributes eol=lf for nearly all file types 2020-08-05 11:32:26 -04:00
.github_changelog_generator Changelog generator default params 2017-12-30 11:27:57 +01:00
.gitignore dataman: add SYS_DM_BACKEND parameter 2021-12-10 09:10:02 -05:00
.gitmodules new Ignition Gazebo simulation interface architecture (#20057) 2022-08-22 10:58:19 -04:00
.travis.yml travis: change coverity to run on master 2020-01-16 13:31:41 -05:00
.ycm_extra_conf.py update C++ standard (c++11 -> c++14) 2020-01-21 21:49:10 -05:00
CMakeLists.txt cmake: add clion support 2022-07-20 01:14:04 -04:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-07-30 19:18:49 +02:00
CONTRIBUTING.md Docs are now in user guide and main (#19977) 2022-08-01 11:39:39 +10:00
CTestConfig.cmake gather test results 2017-01-02 10:14:41 +01:00
Firmware.sublime-project boards new split VENDOR_MODEL naming convention 2018-11-26 14:40:14 -08:00
Jenkinsfile CI - build on main as well (#20001) 2022-08-02 16:52:17 -07:00
Kconfig Added experimental LTO kconfig option 2022-05-02 10:07:54 -04:00
LICENSE Update current year in LICENSE 2022-01-17 08:10:57 +01:00
Makefile Update all H7 Bootloders 2022-05-27 14:25:25 -04:00
README.md Docs are now in user guide and main (#19977) 2022-08-01 11:39:39 +10:00
appveyor.yml appveyor: switch to Cygwin toolchain v0.9 2020-03-24 13:31:41 +00:00
eclipse.cproject boards new split VENDOR_MODEL naming convention 2018-11-26 14:40:14 -08:00
eclipse.project boards new split VENDOR_MODEL naming convention 2018-11-26 14:40:14 -08:00
package.xml Remove eigen leftovers 2019-10-07 12:04:50 +02:00

README.md

PX4 Drone Autopilot

Releases DOI

Nuttx Targets SITL Tests

Slack

This repository holds the PX4 flight control solution for drones, with the main applications located in the src/modules directory. It also contains the PX4 Drone Middleware Platform, which provides drivers and middleware to run drones.

PX4 is highly portable, OS-independent and supports Linux, NuttX and MacOS out of the box.

Building a PX4 based drone, rover, boat or robot

The PX4 User Guide explains how to assemble supported vehicles and fly drones with PX4. See the forum and chat if you need help!

Changing code and contributing

This Developer Guide is for software developers who want to modify the flight stack and middleware (e.g. to add new flight modes), hardware integrators who want to support new flight controller boards and peripherals, and anyone who wants to get PX4 working on a new (unsupported) airframe/vehicle.

Developers should read the Guide for Contributions. See the forum and chat if you need help!

Weekly Dev Call

The PX4 Dev Team syncs up on a weekly dev call.

Note The dev call is open to all interested developers (not just the core dev team). This is a great opportunity to meet the team and contribute to the ongoing development of the platform. It includes a QA session for newcomers. All regular calls are listed in the Dronecode calendar.

Maintenance Team

See also maintainers list (px4.io) and the contributors list (Github).

Supported Hardware

This repository contains code supporting Pixhawk standard boards (best supported, best tested, recommended choice) and proprietary boards.

Pixhawk Standard Boards

Manufacturer and Community supported

Additional information about supported hardware can be found in PX4 user Guide > Autopilot Hardware.

Project Roadmap

A high level project roadmap is available here.

Project Governance

The PX4 Autopilot project including all of its trademarks is hosted under Dronecode, part of the Linux Foundation.

Dronecode Logo Linux Foundation Logo