Compare commits

...

127 Commits

Author SHA1 Message Date
Ramon Roche 2eb2b2a17f github: test file changed action 2022-08-16 10:01:40 -07:00
Ramon Roche bba589ece2 docker: pass on CI env variables 2022-08-16 09:36:46 -07:00
Ramon Roche ad827fc806 ubuntu: alphabetize list 2022-08-16 09:36:46 -07:00
Ramon Roche 606cfba407 docker: single tag to rule them all
the new docker images are defaulting to a hardcoded tag that can be
traced back to source code which is why we are adding the string to the
build and run scripts
2022-08-16 09:36:46 -07:00
Ramon Roche 598e7e65b7 ubuntu: consolidate dependencies 2022-08-16 09:36:04 -07:00
JacobCrabill c83e1eb175 Tools: Docker: Add dummy file for COPY command
Allows the main target of teh COPY command to fail if the file doesn't
exist ('COPY' requires at least one valid file to copy).
2022-08-03 08:42:44 -07:00
Ramon Roche ba9b23c2d1 docker: new build interface script
The new build script can pass arguments directly to ubuntu.sh when
building, this is good for when you want a special build for example
when you don't need RTPS or Simulation

```
./Tools/docker_build.sh --no-sim-tools
```

In the future it can be extended if needed to generate multiple docker
images based on the same Dockerfile, if for example we only want to
build arm targets
2022-08-02 09:52:55 -07:00
Ramon Roche 38fc86cf3b setup: ubuntu help options 2022-08-02 09:38:25 -07:00
Ramon Roche a3d0ca9800 docker: cleanup verbose script output 2022-08-02 09:30:39 -07:00
Ramon Roche 34b9dc880f docker: cleanup run script
* add verbose output
2022-08-02 07:53:05 -07:00
Ramon Roche 04e08c5edb setup: alphabetize list 2022-08-02 07:52:17 -07:00
Ramon Roche 2668510295 docker: multiarch development image
To run the image you need to use the docker_run.sh script found in the
Tools directory as shown below:

./Tools/docker_run.sh make all_variants_px4_fmu-v5x
2022-07-28 10:50:43 -07:00
Ramon Roche 5388f7f911 ubuntu.sh: updated dependencies and output
I double checked each new dependency and made sure to build each target
with the new install script as well as test FastRTPS and Simulations

* removed unused dependencies
* settled on the absolute most updated JDK we could possibly use given
our dependencies (JDK 14)
* added conditional support for use in a container environment via a new
flag --from-docker
* added multi-platform build tools for development
2022-07-28 10:49:19 -07:00
Beniamino Pozzan a20483ed11 msg/position_controller_landing_status.msg: fix constant name conventions
- msg constant names now comply with ROS conventions:
uppercase alphanumeric characters with underscores for separating words

partially fix #19917

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
2022-07-28 11:29:03 -04:00
Daniel Agar 9ed861e0a3 lib/mixer_module: split functions into separate headers
- this arguably improves visibility/discoverability
2022-07-28 08:08:58 +02:00
bresch f7ff0a9961 WindEstimator: add test case for airspeed fusion singularity 2022-07-27 08:19:40 -04:00
Daniel Agar 38c02ea29a wind_estimator: cmake add symforce generation helper target (wind_estimator_generate_airspeed_fusion) 2022-07-27 08:19:40 -04:00
bresch 26190a7799 WindEstimator: use SymForce auto-generated function for airspeed fusion 2022-07-27 08:19:40 -04:00
Hamish Willee e6eed43648 Spelling errors (#19935) 2022-07-27 14:33:16 +10:00
RomanBapst 97f632a408 vtol_takeoff: reset reposition triplet before handing over to loiter mode
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-25 14:48:18 +02:00
Igor Mišić d6488fafc3 serial_test: fix first write_count_value for next write 2022-07-25 11:48:36 +02:00
Igor Mišić 32ca7ad706 serial_test: fix write for max buffer size 2022-07-25 11:48:36 +02:00
Taylor Nelms 21cb0ef50f Component: flash parameter storage on stm32h7. Fixes #15331.
As per the discussion in #15331, fixed issue where stm32h7 chips
    use hardware ECC bits in program memory that disallow overwriting
    32-byte flash line that has already been written. As such,
    this change allows for a variant implementation of the flashfs system
    that uses more space in the flash entry header in order to
    allow an entire line to be reserved for erasing an entry.

Signed-off-by: Taylor Nelms <tnelms@roboticresearch.com>
2022-07-25 08:19:00 +02:00
Thomas Stastny 6a0f394d46 rtl: reset rtl state only on activation
rtl state was getting reset on inactive, which meant that the state which triggered resuming e.g. mission landing would be overwritten, and the navigator mode would switch back and forth between rtl and mission. this commit:
1. moves the reset of rtl state to the on activation function (removing it from the on inactive function)
2. functionalizes the rtl state input to the rtl time estimator so that rtl time can still be calculated from state=none while inactive
2022-07-22 14:59:20 +02:00
Thomas Stastny e512d77b89 RTL: expose RTL state 2022-07-22 14:59:20 +02:00
Silvan Fuhrer 85a621303d VtolLandDetector: remove airspeed check
This commit removes the additional airspeed check (airspeed for VTOLs in
hover below LNDFW_AIRSPD_MAX), as it is not a required condition in the
landed state (headwind blowing into the airspeed sensor won't stop
once on the gruond). In FW mode the check would make more sense, but there
the land detector is currently simply disabled.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-22 08:31:32 +02:00
Daniel Agar 32c6ec061e sensors: add kconfig options to skip angular velocity and acceleration 2022-07-21 11:27:09 -04:00
Silvan Fuhrer c9c62b860c ROMFS: add generic tiltrotor VTOL (13200)
Add geometry for a quad tiltrotor VTOL, with only front motors tiltable,
two ailerons and a V-tail.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-21 10:09:12 -04:00
Silvan Fuhrer 3ffc37d988 ROMFS: generic tailsitter VTOL: enable CA by default and remove legacy mixer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-21 10:09:12 -04:00
Silvan Fuhrer ab58717313 ROMFS: standard VTOL: enable CA by default and remove legacy mixer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-21 10:09:12 -04:00
Silvan Fuhrer 607c53e873 ROMFS: flying wing: enable CA by default and remove legacy mixer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-21 10:09:12 -04:00
Silvan Fuhrer 4dabc8b7ed ROMFS: standard plane: enable CA by default and remove legacy mixer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-21 10:09:12 -04:00
Daniel Agar 70e95812e7 ekf2: reset mag_lpf (by zeroing _mag_counter) when resetting mag bias (or changing mags)
- so that there's new filtered data avaiable for reset
2022-07-21 09:24:28 -04:00
Daniel Agar ecdade3638 ekf2: mag in air reset fall back to regular resetMagHeading() if realignYawGPS() fails 2022-07-21 09:24:28 -04:00
Daniel Agar 05133aed27 ekf2: clear test ratios, flags, etc when stopping mag fusion 2022-07-21 09:24:28 -04:00
Daniel Agar 65a587e56a ekf2: mag fusion don't update all states if mag_fault or mag_field_disturbed 2022-07-21 09:24:28 -04:00
Daniel Agar a41a0e7e80 ekf2: resetMagHeading() split out simple init case 2022-07-21 09:24:28 -04:00
Daniel Agar 9efadad06a ekf2: move checkMagFieldStrength() to magFieldStrengthDisturbed() const method 2022-07-21 09:24:28 -04:00
Daniel Agar a7f573e150 ekf2: delete isStrongMagneticDisturbance() 2022-07-21 09:24:28 -04:00
Daniel Agar e6e27e694e ekf2: delete isYawResetAuthorized() 2022-07-21 09:24:28 -04:00
Daniel Agar 0f1f6daa1a ekf2: delete isMagBiasObservable() 2022-07-21 09:24:28 -04:00
Daniel Agar d160229f47 ekf2: delete isYawAngleObservable() 2022-07-21 09:24:28 -04:00
Daniel Agar b0c979f745 ekf2: add copyright header to EKFGSF_yaw and utils 2022-07-21 09:24:28 -04:00
Daniel Agar 4fee059696 ekf2: simplify mag yaw reset request when transitioning to mag enabled 2022-07-21 09:24:28 -04:00
Daniel Agar f254b55523 ekf2: add mag fusion timestamps 2022-07-21 09:24:28 -04:00
Jukka Laitinen e3e067d640 stub_keystore: Allow using also with other that SW_CRYPTO driver
Remove "depends on DRIVERS_SW_CRYPTO"

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-07-21 08:08:14 +02:00
Jukka Laitinen 026bd073b5 Don't error on CONFIG_CRYPTO_RANDOM_POOL not defined
px4_secure_random can be implemented also outside NuttX for some platform

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2022-07-21 08:08:14 +02:00
Thomas Stastny d6fb1114ff rtl: fix printout of rtl delay time 2022-07-20 14:15:12 +02:00
Thomas Stastny 1ec62c4063 rtl: let fixed-wing RTL all the way to the loiter/delay state
also fix home vs destination alt discrepancy on RTL
2022-07-20 14:15:12 +02:00
Daniel Agar 2f3cb97872 sensors/vehicle_magnetometer: don't advertise vehicle_magnetometer instance if mag has been disable
- if using multi-EKF across all magnetometers then an instance of
vehicle_magnetometer is advertised immediately for every sensor_mag
instance
 - this can become problematic if EKF2 multi-mag is enabled, but with
only 1 IMU (EKF2_MULTI_MAG) because you will be stuck with no magnetometer data
2022-07-20 01:18:19 -04:00
Daniel Agar e5be0e776e ekf2: if multi-mag disabled (EKF2_MULTI_MAG <= 1) properly re-enable sensors hub selection (SENS_MAG_MODE)
- this prevents potential misconfiguration if trying to disable ekf2 multi mag
2022-07-20 01:16:55 -04:00
Daniel Agar 8ccd8fbed1 px4io: minimal backup scheduling regardless of dynamic mixing
- even if there's no configured output we still need to run to grab RC
data
2022-07-20 01:15:36 -04:00
Daniel Agar 8f8615e6c2 delete CBRK_RATE_CTRL 2022-07-20 01:14:53 -04:00
Beat Küng 67107f4978 .clang-tidy: exclude some warnings
Some are too verbose, others don't apply to the code base
2022-07-20 01:14:04 -04:00
Beat Küng 84b0a889a4 cmake: add clion support 2022-07-20 01:14:04 -04:00
Beat Küng f22dc80ecc system: add missing includes (added indirectly via visibility.h for normal builds) 2022-07-20 01:14:04 -04:00
Beat Küng ea136e73be ekf2: remove unused variables 2022-07-20 01:14:04 -04:00
Thomas Schneider cd66a262ee Robustify RTPS bridge stream parsing. 2022-07-20 01:13:47 -04:00
Peter van der Perk 089fbdccc9 UAVCANNODE NuttX SocketCAN driver
Change init mode for CAN driver so it get executed in a single context
2022-07-20 01:12:43 -04:00
Peter van der Perk 47aaa38d5f Added DroneCAN SocketCAN driver Skeleton 2022-07-20 01:12:43 -04:00
Daniel Agar 14df1ee917 boards: px4_fmu-v5x_rtps disable systemcmds/gpio to save flash 2022-07-20 01:05:28 -04:00
Daniel Agar 2ece92abd0 sagetech_mxs: module.yaml remove invalid default 2022-07-20 01:00:15 -04:00
Daniel Agar ace80e2b9d fw_att_control: add simple backup scheduling if vehicle_attitude unavailable (or stops) 2022-07-20 00:53:37 -04:00
jasta 1603883dc9 Configure SCALED_PRESSURE so temperature data is available to QGroundControl 2022-07-20 00:49:11 -04:00
jasta a110032dc0 Fix typo in SCALED_PRESSURE*_HPP defines
This was preventing SCALED_PRESSURE* from being added to the list of
streams, so even if it was configured it still wouldn't work.
2022-07-20 00:49:11 -04:00
Thomas Stastny 413ce8a3c4 fw pos ctrl: absorb fw_lnd_rel_ter into fw_lnd_useter parameter 2022-07-19 22:37:09 -04:00
Thomas Stastny de3ac12ecd fw pos ctrl params: clarify landing parameters, change defaults
FW_LND_USETER defaulted to 1 and FW_LND_ABORT terrain based bits all enabled. why? because using a distance sensor is critical to detecting when to flare, and we want to force the user to actively disable these safety settings if they so choose, so that they understand the implications.
2022-07-19 22:37:09 -04:00
Thomas Stastny 26cb55ec2c fw pos ctrl: takeoff and landing nudging enabled by default 2022-07-19 22:37:09 -04:00
Thomas Stastny 121cc1fce8 fw pos ctrl: rework landing abort status
abort boolean and reasons no longer separated, single status field with corresponding abort triggers
2022-07-19 22:37:09 -04:00
Thomas Stastny 694d36050a fw pos ctrl: update landing parameter descriptions 2022-07-19 22:37:09 -04:00
Thomas Stastny 888e72661f fw pos ctrl: add option to fix the glide slope reference altitude
- new param, FW_LND_TER_REL
- fixing the glide slope helps keep the landing glide behavior steady (avoiding bumps in the altitude setpoint from e.g. trees)
- flare is still triggered via the distance sensor, if enabled by FW_LND_USETERR
2022-07-19 22:37:09 -04:00
Thomas Stastny c60b215574 fw pos ctrl: allow negative landing glide slope relative altitude
when the vehicle did not track the slope well (e.g. at an offset above the track) and the altitude setpoint flattening on intersection with terrain, the throttle would spool up to smoothly intersect the newly flattened altitude setpoint, this could happen before the flare altitude was reached, which is bad. now the steady state glide behavior will be maintained, and flare can trigger at the appropriate time
2022-07-19 22:37:09 -04:00
Thomas Stastny 4953fdd1ab fw pos ctrl: variable min calibrated airsp in auto airspeed adjuster 2022-07-19 22:37:09 -04:00
Thomas Stastny 6612d4696d fw pos ctrl: fix glide slope calculation, from geometry, not param 2022-07-19 22:37:09 -04:00
Thomas Stastny d73b2e8625 fw pos ctrl params: update flaring param values and docs 2022-07-19 22:37:09 -04:00
Thomas Stastny 7283cd7c9d fw pos ctrl: fix virtual waypoint calculation typo 2022-07-19 22:37:09 -04:00
Thomas Stastny 8f5b274e72 fw pos ctrl: refactor terrain estimate and land abort
- improve terrain estiamte documentation
- add landing abort condition bitmasked parameter to choose abort conditions
- refactor terrain estimate getter with landing abort logic
- log abort status and inform user
- log flaring status
2022-07-19 22:37:09 -04:00
Thomas Stastny c98153e044 fw pos ctrl: enumerate landing nudging options, add to param documenation 2022-07-19 22:37:09 -04:00
Thomas Stastny 9fab914687 fw pos ctrl: use max function for landing approach entrance rel alt 2022-07-19 22:37:09 -04:00
Thomas Stastny 217efcb12d fw pos ctrl: set idle throttle in landed conditions
also set the default idle throttle to zero as most PX4 applications use electric motors
2022-07-19 22:37:09 -04:00
Thomas Stastny ceb432aacb mission feasibility checker: use param_find() to check fixed-wing land angle 2022-07-19 22:37:09 -04:00
Thomas Stastny 4b0a8565fe fw pos ctrl: lower underspeed detection bound for landing airspeed 2022-07-19 22:37:09 -04:00
Thomas Stastny 41b0a6c62c fw pos ctrl: open up desired max sink rate limits for landing slope
- the target_sink_rate param could possibly constrain the maximum commanded sink rate to something less than that of the landing glide slope, which would make it impossible to track. this commit allows opening up the desired max sink rate up to the performance limits of the aircraft, if necessary, for the landing case
2022-07-19 22:37:09 -04:00
Thomas Stastny d1aca4032d mission feasibility / fw pos ctrl: add limited landing checks back, allow glide slopes below max 2022-07-19 22:37:09 -04:00
Thomas Stastny 87e09ad9f5 fw pos ctrl: auto landing refactor
- landing slope/curve library removed
- flare curve removed (the position setpoints will not be tracked during a flare, and were being ignored by open-loop maneuvers anyway)
- flare curve replaced by simply commanding a constant glide slope to the ground from the approach entrance, and commanding a sink rate once below flaring alt
- flare is now time-to-touchdown -based to account for differing descent rates (e.g. due to wind)
- flare pitch limits and height rate commands are ramped in from the previous iteration's values at flare onset to avoid jumpy commands
- TECS controls all aspects of the auto landing airspeed and altitude/height rate, and is only constrained by pitch and throttle limits (lessening unintuitive open loop manuever overrides)
- throttle is killed on flare
- flare is the singular point of no return during landing
- lateral manual nudging of the touchdown point is configurable via parameter, allowing the operator to nudge (via remote) either the touchdown point itself (adjusting approach vector) or shifting the entire approach path to the left or right. this helps when GCS map or GNSS uncertainties set the aircraft on a slightly offset approach"
2022-07-19 22:37:09 -04:00
bresch f962399ba1 ekf2: rename BaroBiasEstimator -> BiasEstimator 2022-07-19 20:46:53 -04:00
Daniel Agar 39453405a0 ekf2: cleanup zero innovation heading fusion
- refactor updateQuaternion() to compute the yaw jacobian directly (respecting  the rotation sequence determination)
 - fuseHeading()/fuseYaw321()/fuseYaw312() helpers are eliminated and now mag heading fusion and EV yaw fusion compute the innovation in place
 - clear up logic for performing zero innovation heading fusion when quaternion variance exceeds threshold (no more _is_yaw_fusion_inhibited flag manipulation)
 - when at rest continue fusing last static heading with very low variance even if other heading sources are active
2022-07-19 11:58:27 -04:00
Roman Dvořák ed14151734 Update Flight-gear bridge, Add support of TF-G2 autogyro flight-gear model (#19122)
* Add Transfer of RPM from FG to PX4,
	-switch FG_bridge module to ThudnderFlyaerospace

* Add TF-G2 flightgear sim target

* Add simulator support, fix astyle

* Update SITL TF-G2 airframe, update fg bridge

Co-authored-by: Vit Hanousek <vithanousek@seznam.cz>
2022-07-19 09:11:44 +02:00
Daniel Agar 1a513153be ekf2: update range sample fix ekf2_timestamps
- this is necessary to use distance_sensor data in replay
2022-07-18 14:39:12 -04:00
Ramon Roche e5e74f65d7 README: Project governance and trademarks
We need to ensure the Dronecode logo is prominently displayed
and linked to the PX4 brand for trademark protection of PX4 and Dronecode.
If you have any questions about this, please feel free to reach out directly to me.
2022-07-18 11:16:55 -04:00
Silvan Fuhrer 1e0235d87b ROMFS: remove outdated RWTO_MAX_ROLL from all configs
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2022-07-18 10:49:27 -04:00
Thomas Stastny 69bc5d37bc fw pos ctrl: mark completed manual takeoff true if rotary wing and armed 2022-07-18 10:49:27 -04:00
Thomas Stastny b4e066f056 fw pos ctrl: use hardcoded buffer altitude instead of parameter for clearance altitude buffer 2022-07-18 10:49:27 -04:00
Thomas Stastny 67b0f5e07e runway takeoff params: improve descriptions 2022-07-18 10:49:27 -04:00
Thomas Stastny 81d6fdfe8c fw pos ctrl params: update defaults and bounds on wing geometry 2022-07-18 10:49:27 -04:00
Thomas Stastny 7e12f6ba5a fw pos ctrl: dont use terrain alt for takeoff 2022-07-18 10:49:27 -04:00
Thomas Stastny ec02413387 fw pos ctrl: remove vtol condition from manual takeoff completion 2022-07-18 10:49:27 -04:00
Thomas Stastny a12e40b1d8 tecs: convert tas error and soft bounds to percentage of trim airspeed 2022-07-18 10:49:27 -04:00
Thomas Stastny 1782f9cd3e tecs: zero guard ste rates and airspeed setpoint rates 2022-07-18 10:49:27 -04:00
Thomas Stastny 63e4ea23b7 vehicle_rates_setpoint: log wheel controller yaw rate on common yaw rate channel 2022-07-18 10:49:27 -04:00
Thomas Stastny c447064596 fw pos ctrl: rename position control mode variable 2022-07-18 10:49:27 -04:00
Thomas Stastny 5648deb5a1 fw pos ctrl: organize state variables 2022-07-18 10:49:27 -04:00
Thomas Stastny 2d5f1a5c6b fw pos ctrl: head straight for next waypoint after takeoff 2022-07-18 10:49:27 -04:00
Thomas Stastny 721131a135 fw pos/att ctrl: pass manual nose wheel increments during takeoff ground roll 2022-07-18 10:49:27 -04:00
Thomas Stastny fcee314646 fw att ctrl: log the yaw rate command controlled by the wheel 2022-07-18 10:49:27 -04:00
Thomas Stastny 4d3f05479d fw pos ctrl: refactor takeoff mode
- post takeoff, the aircraft follows the infinite line sourced from the launch point in the direction of the takeoff waypoint
- takeoff waypoint altitude is used as a clearance altitude, set such that once above, the aircraft has cleared all ground occlusions and may proceed with the mission
- runway takeoff state machine simplified to throttle ramp, clamped to runway, climbout, and fly
- throttle ramp must complete before switching to next state to avoid a jump in throttle setpoint just after takeoff if the takeoff airspeed is reached before the ramp is complete
- roll constraints near ground post takeoff removed from runway takeoff class (handled externally now)
- minimum airspeed in TECS is reduced to takeoff speed (if necessary) to lower the underspeed detection bound
- lateral-directional guidance uses a different period parameter during ground roll
2022-07-18 10:49:27 -04:00
Thomas Stastny 7c6ce436ca fw pos ctrl: encapsulate wing tip strike constraint for roll angle
- apply constraint only for takeoff and landing modes
- add two params, wing span and wing height, to calculate a reasonable height at which roll limits can be opened
2022-07-18 10:49:27 -04:00
Thomas Stastny 5241f016f7 fw pos ctrl: rework manual takeoff aid
- takeoff situational knowledge removed from all other modes except manual (or actual takeoff mode)
- manual takeoff is marked complete if at a controllable airspeed
- minimum pitch bounds TECS until manual takeoff complete
- remove individual roll constraints during manual takeoff (ground proximity constraints coming in subsequent commit)
2022-07-18 10:49:27 -04:00
Thomas Stastny 73010cc69b TECS: speed (only) -based underspeed detection
- underspeed condition only determined by true airspeed undershoot
- change binary underspeed condition to a continuous percent undersped
- ramp-in max throttle, pitch speed weight, and TAS setpoint reduction during underspeed to avoid jumpy commands at the true airspeed error boundary
- let true airspeed filter reach zero airspeed
2022-07-18 10:49:27 -04:00
Thomas Stastny eed073887d remove in air vs landed knowledge from TECS
- create integral and trajectory generator reset methods
- always run TECS unless in rotary-wing mode (or in transition)
- constantly reset TECS integrals and trajectory generators when landed
2022-07-18 10:49:27 -04:00
Thomas Stastny ddeca2538c fw pos ctrl: handle takeoff detection when switching to takeoff mode while in air
- simplify takeoff reset method
- removes _last_manual variable in favor of _skipping_takeoff_detection, which is handled in the control mode setter
- takeoff detection (both launch and runway) is skipped if entering takeoff mode from any other mode while having already been in the air
- added method to runway takeoff class for force setting the fly state when we want to skip the takeoff detection
2022-07-18 10:49:27 -04:00
bresch 8cc6d02af3 ekf2: add missing mag fuse type in enum 2022-07-15 15:57:17 +02:00
alexklimaj f9b8ca1326 Support two RTCM links with the same corrections
Add selected_rtcm_instance to sensor_gps message to track loss of rtcm links

Publish _rate_rtcm_injection
2022-07-15 08:20:27 +02:00
Raffaele Rossi 1e55b69fdb ADS1115 ADC: start internal ADC as well (#19880)
But only publish the system power.
2022-07-15 08:15:26 +02:00
Daniel Agar c71cc5b815 drivers/imu/bosch: new BMI085 driver
- very similar to the BMI088 with minor differences in accel range
2022-07-14 18:20:13 -04:00
Daniel Agar 077547f31e rm3100: fix trivial whitespace style failure 2022-07-14 14:44:59 -04:00
alexklimaj 768565ed6f Enable GPS Blending by default 2022-07-14 10:20:59 -04:00
Daniel Agar ea4a1bfb6a sagetech_mxs: don't run by default 2022-07-14 10:20:20 -04:00
Bruce Meagher c5f72fb5d9 Fixed formatting to pass check_format 2022-07-14 09:43:59 -04:00
Bruce Meagher e66683a059 Fixed rm3100 self-test bug 2022-07-14 09:43:59 -04:00
Junwoo Hwang 1a620b450d Change min > max notation to [min, max] in Parameters Markdown (#19911)
* Change min > max notation to [min, max] in Parameters Markdown

* Update src/lib/parameters/px4params/markdownout.py

Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Thomas Stastny <thomas.stastny@auterion.com>
2022-07-14 09:13:49 +10:00
Daniel Agar a2f83269e9 airspeed_selector: don't consider vehicle_local_position valid if dead_reckoning 2022-07-13 09:01:33 +02:00
Daniel Agar ac209c2e78 ekf2: vehicle_local_position add dead_reckoning flag 2022-07-13 09:01:33 +02:00
RomanBapst 9886660862 gps_inject_data: fixed integer overflow
- array length of data was increased without changing the data type of
the variable holding the length

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2022-07-13 07:49:47 +02:00
Hamish Willee 5f953fd1da commander_params: COM_RC_IN_MODE - comment out of date (#19634) 2022-07-13 15:26:32 +10:00
Daniel Agar e99da22cbe delete CBRK_VELPOSERR circuit breaker 2022-07-12 13:51:13 -04:00
bresch de74f45e2d ekf2: do not run rng kinematic consistency check for fixed-wings
As they are always moving horizontally, the check doesn't make sense
for fixed-wings.
Also don't run the check while on ground to prevent getting a failed
check during pre-takeoff manipulation.
2022-07-12 13:45:59 -04:00
286 changed files with 9353 additions and 3919 deletions
+10 -2
View File
@@ -1,11 +1,17 @@
---
Checks: '*,
-*-avoid-c-arrays,
-*-uppercase-literal-suffix,
-*-magic-numbers,
-altera-id-dependent-backward-branch,
-altera-unroll-loops,
-android*,
-bugprone-integer-division,
-cert-dcl50-cpp,
-cert-env33-c,
-cert-err34-c,
-cert-err58-cpp,
-cert-flp30-c,
-cert-msc30-c,
-cert-msc50-cpp,
-clang-analyzer-core.CallAndMessage,
@@ -18,6 +24,7 @@ Checks: '*,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.FloatLoopCounter,
-clang-analyzer-security.insecureAPI.strcpy,
-clang-analyzer-unix.API,
-clang-analyzer-unix.cstring.BadSizeArg,
@@ -37,8 +44,7 @@ Checks: '*,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments,
-fuchsia-overloaded-operator,
-fuchsia-*,
-google-build-using-namespace,
-google-explicit-constructor,
-google-global-names-in-headers,
@@ -62,6 +68,7 @@ Checks: '*,
-hicpp-use-equals-delete,
-hicpp-use-override,
-hicpp-vararg,
-llvmlibc-*,
-llvm-header-guard,
-llvm-include-order,
-llvm-namespace-comment,
@@ -84,6 +91,7 @@ Checks: '*,
-modernize-use-override,
-modernize-use-trailing-return-type,
-modernize-use-using,
-modernize-use-trailing-return-type,
-performance-inefficient-string-concatenation,
-readability-avoid-const-params-in-decls,
-readability-container-size-empty,
+14
View File
@@ -0,0 +1,14 @@
name: docker-dev
on: [push, pull_request]
jobs:
changes:
runs-on: ubuntu-latest
steps:
- id: file_changes
uses: trilom/file-changes-action@v1.2.3
- name: test
run: |
echo '${{ steps.file_changes.outputs.files}}'
echo '${{ steps.file_changes.outputs.files_modified}}'
echo '${{ steps.file_changes.outputs.files_added}}'
echo '${{ steps.file_changes.outputs.files_removed}}'
+6
View File
@@ -175,6 +175,12 @@ include(kconfig)
message(STATUS "PX4 config: ${PX4_CONFIG}")
message(STATUS "PX4 platform: ${PX4_PLATFORM}")
if($ENV{CLION_IDE})
# CLion automatically executes some compiler commands after configuring the
# project. This would fail on NuttX, as visibility.h tries to (indirectly)
# include nuttx/config.h, which at that point does not exist yet
add_definitions(-DPX4_DISABLE_GCC_POISON)
endif()
if(${PX4_PLATFORM} STREQUAL "posix")
if(ENABLE_LOCKSTEP_SCHEDULER)
+8
View File
@@ -120,3 +120,11 @@ Additional information about supported hardware can be found in [PX4 user Guide
## Project Roadmap
A high level project roadmap is available [here](https://github.com/orgs/PX4/projects/25).
## Project Governance
The PX4 Autopilot project including all of its trademarks is hosted under [Dronecode](https://www.dronecode.org/), part of the Linux Foundation.
<a href="https://www.dronecode.org/" style="padding:20px" ><img src="https://mavlink.io/assets/site/logo_dronecode.png" alt="Dronecode Logo" width="110px"/></a>
<a href="https://www.linuxfoundation.org/projects" style="padding:20px;"><img src="https://mavlink.io/assets/site/logo_linux_foundation.png" alt="Linux Foundation Logo" width="80px" /></a>
<div style="padding:10px">&nbsp;</div>
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
param set-default FW_LND_AIRSPD_SC 1
param set-default FW_LND_ANG 8
param set-default FW_THR_LND_MAX 0
param set-default FW_L1_PERIOD 12
@@ -7,12 +7,9 @@
param set-default FW_LND_AIRSPD_SC 1.1
param set-default FW_LND_ANG 5
param set-default FW_THR_LND_MAX 0
param set-default FW_LND_HHDIST 30
param set-default FW_LND_FL_PMIN 9.5
param set-default FW_LND_FL_PMAX 20
param set-default FW_LND_FLALT 5
param set-default FW_LND_TLALT 15
param set-default FW_L1_PERIOD 25
@@ -38,7 +35,6 @@ param set-default NAV_DLL_ACT 2
param set-default RWTO_TKOFF 1
param set-default RWTO_MAX_PITCH 20
param set-default RWTO_MAX_ROLL 10
param set-default RWTO_PSP 8
param set-default RWTO_AIRSPD_SCL 1.8
@@ -7,12 +7,9 @@
param set-default FW_LND_AIRSPD_SC 1.1
param set-default FW_LND_ANG 5
param set-default FW_THR_LND_MAX 0
param set-default FW_LND_HHDIST 30
param set-default FW_LND_FL_PMIN 9.5
param set-default FW_LND_FL_PMAX 20
param set-default FW_LND_FLALT 5
param set-default FW_LND_TLALT 15
param set-default FW_L1_PERIOD 25
@@ -38,7 +35,6 @@ param set-default NAV_DLL_ACT 2
param set-default RWTO_TKOFF 1
param set-default RWTO_MAX_PITCH 20
param set-default RWTO_MAX_ROLL 10
param set-default RWTO_PSP 8
param set-default RWTO_AIRSPD_SCL 1.8
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
param set-default FW_LND_AIRSPD_SC 1
param set-default FW_LND_ANG 8
param set-default FW_THR_LND_MAX 0
param set-default FW_L1_PERIOD 15
@@ -7,12 +7,9 @@
param set-default FW_LND_AIRSPD_SC 1.1
param set-default FW_LND_ANG 5
param set-default FW_THR_LND_MAX 0
param set-default FW_LND_HHDIST 30
param set-default FW_LND_FL_PMIN 9.5
param set-default FW_LND_FL_PMAX 20
param set-default FW_LND_FLALT 5
param set-default FW_LND_TLALT 15
param set-default FW_L1_PERIOD 25
@@ -37,7 +34,6 @@ param set-default NAV_DLL_ACT 2
param set-default RWTO_TKOFF 1
param set-default RWTO_MAX_PITCH 20
param set-default RWTO_MAX_ROLL 10
param set-default RWTO_PSP 8
param set-default RWTO_AIRSPD_SCL 1.8
@@ -10,7 +10,6 @@ param set-default EKF2_MAG_YAWLIM 0
param set-default FW_LND_AIRSPD_SC 1
param set-default FW_LND_ANG 8
param set-default FW_THR_LND_MAX 0
param set-default FW_L1_PERIOD 12
@@ -0,0 +1,55 @@
#!/bin/sh
#
# @name ThunderFly TF-G2
# ThunderFly TF-G2 autogyro airframe. Only for FlightGear simulator
#
# @type Autogyro
# @class Autogyro
#
# @url https://github.com/ThunderFly-aerospace/TF-G2/
#
#
. ${R}etc/init.d/rc.fw_defaults
param set-default FW_AIRSPD_STALL 5
param set-default FW_P_RMAX_NEG 20.0
param set-default FW_W_RMAX 10
param set-default FW_W_EN 1
param set-default FW_RR_P 0.08
param set-default MIS_LTRMIN_ALT 50
param set-default MIS_TAKEOFF_ALT 7
param set-default NAV_ACC_RAD 20
param set-default NAV_DLL_ACT 2
param set-default NAV_LOITER_RAD 50
param set-default RWTO_TKOFF 0
# Parameters related to autogyro takeoff PR
#param set-default AG_TKOFF 1
#param set-default AG_PROT_TYPE 1
#param set-default AG_PROT_MIN_RPM 50.0
#param set-default AG_PROT_TRG_RPM 900.0
#param set-defoult AG_ROTOR_RPM 900.0
param set-default FW_ARSP_SCALE_EN 0
param set-default FW_AIRSPD_MAX 35
param set-default FW_AIRSPD_MIN 7
param set-default FW_P_LIM_MAX 25
param set-default FW_P_LIM_MIN -5
param set-default FW_R_LIM 30
param set-default FW_MAN_P_MAX 30.0
param set-default FW_MAN_R_MAX 30.0
param set-default FW_THR_CRUISE 0.8
param set-default FW_THR_IDLE 0
param set-default COM_DISARM_PRFLT 0
set MIXER_FILE etc/mixers-sitl/autogyro_sitl.main.mix
set MIXER custom
@@ -78,6 +78,7 @@ px4_add_romfs_files(
3010_quadrotor_x
3011_hexarotor_x
17001_tf-g1
17002_tf-g2
2507_cloudship
6011_typhoon_h480
6011_typhoon_h480.post
@@ -29,9 +29,6 @@ param set-default FW_L1_DAMPING 0.74
param set-default FW_L1_PERIOD 16
param set-default FW_LND_ANG 15
param set-default FW_LND_FLALT 5
param set-default FW_LND_HVIRT 13
param set-default FW_LND_TLALT 5
param set-default FW_THR_LND_MAX 0
param set-default FW_PR_FF 0.35
param set-default FW_PR_P 0.2
param set-default FW_RR_FF 0.6
@@ -1,22 +1,10 @@
#!/bin/sh
#
# @name Generic Quadplane VTOL
# @name Generic Standard VTOL
#
# @type Standard VTOL
# @class VTOL
#
# @maintainer
#
# @output MAIN1 motor 1
# @output MAIN2 motor 2
# @output MAIN3 motor 3
# @output MAIN4 motor 4
# @output AUX1 Aileron 1
# @output AUX2 Aileron 2
# @output AUX3 Elevator
# @output AUX4 Rudder
# @output AUX5 Throttle
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
@@ -24,21 +12,21 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 2
param set-default CA_ROTOR_COUNT 5
param set-default CA_ROTOR0_PX 0.15
param set-default CA_ROTOR0_PY 0.15
param set-default CA_ROTOR1_PX -0.15
param set-default CA_ROTOR1_PY -0.15
param set-default CA_ROTOR2_PX 0.15
param set-default CA_ROTOR2_PY -0.15
param set-default CA_ROTOR0_PX 1
param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR1_PX -1
param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR2_PX 1
param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -0.15
param set-default CA_ROTOR3_PY 0.15
param set-default CA_ROTOR3_PX -1
param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default CA_ROTOR4_AX 1.0
param set-default CA_ROTOR4_AZ 0.0
param set-default CA_ROTOR4_PX 0.2
param set-default CA_SV_CS_COUNT 4
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS0_TRQ_R -0.5
@@ -48,16 +36,5 @@ param set-default CA_SV_CS2_TYPE 3
param set-default CA_SV_CS2_TRQ_P 1.0
param set-default CA_SV_CS3_TRQ_Y 1.0
param set-default CA_SV_CS3_TYPE 4
param set-default PWM_AUX_DIS5 950
param set-default VT_TYPE 2
param set-default VT_MOT_ID 1234
param set-default VT_FW_MOT_OFFID 1234
param set-default MAV_TYPE 22
set MIXER quad_x
set MIXER_AUX vtol_AAERT
set PWM_OUT 1234
@@ -0,0 +1,44 @@
#!/bin/sh
#
# @name Generic Tiltrotor VTOL
#
# @type VTOL Tiltrotor
# @class VTOL
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.vtol_defaults
param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 3
param set-default CA_ROTOR_COUNT 4
param set-default CA_ROTOR0_PX 1
param set-default CA_ROTOR0_PY 1
param set-default CA_ROTOR0_TILT 2
param set-default CA_ROTOR1_PX -1
param set-default CA_ROTOR1_PY -1
param set-default CA_ROTOR2_PX 1
param set-default CA_ROTOR2_PY -1
param set-default CA_ROTOR2_TILT 1
param set-default CA_ROTOR2_KM -0.05
param set-default CA_ROTOR3_PX -1
param set-default CA_ROTOR3_PY 1
param set-default CA_ROTOR3_KM -0.05
param set-default CA_SV_CS_COUNT 4
param set-default CA_SV_CS0_TYPE 1
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 2
param set-default CA_SV_CS1_TRQ_R 0.5
param set-default CA_SV_CS2_TYPE 7
param set-default CA_SV_CS2_TRQ_P 0.5
param set-default CA_SV_CS2_TRQ_Y 0.5
param set-default CA_SV_CS3_TYPE 8
param set-default CA_SV_CS3_TRQ_P 0.5
param set-default CA_SV_CS3_TRQ_Y -0.5
param set-default CA_SV_TL_COUNT 2
param set-default MAV_TYPE 21
param set-default VT_TYPE 1
@@ -1,17 +1,10 @@
#!/bin/sh
#
# @name Generic Tailsitter
# @name Generic VTOL Tailsitter
#
# @type VTOL Duo Tailsitter
# @type VTOL Tailsitter
# @class VTOL
#
# @output MAIN1 motor right
# @output MAIN2 motor left
# @output MAIN5 elevon right
# @output MAIN6 elevon left
#
# @maintainer Roman Bapst <roman@px4.io>
#
# @board px4_fmu-v2 exclude
# @board bitcraze_crazyflie exclude
# @board holybro_kakutef7 exclude
@@ -19,18 +12,13 @@
. ${R}etc/init.d/rc.vtol_defaults
param set-default MAV_TYPE 19
param set-default VT_ELEV_MC_LOCK 0
param set-default VT_MOT_COUNT 2
param set-default VT_TYPE 0
param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 4
param set-default CA_ROTOR_COUNT 2
param set-default CA_ROTOR0_KM -0.05
param set-default CA_ROTOR0_PY 0.2
param set-default CA_ROTOR1_KM -0.05
param set-default CA_ROTOR1_PY -0.2
param set-default CA_ROTOR0_PY -0.2
param set-default CA_ROTOR1_KM 0.05
param set-default CA_ROTOR1_PY 0.2
param set-default CA_SV_CS_COUNT 2
param set-default CA_SV_CS0_TRQ_P 0.5
param set-default CA_SV_CS0_TRQ_Y 0.5
@@ -39,6 +27,6 @@ param set-default CA_SV_CS1_TRQ_P 0.5
param set-default CA_SV_CS1_TRQ_Y -0.5
param set-default CA_SV_CS1_TYPE 6
set MIXER vtol_tailsitter_duo
set PWM_OUT 1234
param set-default MAV_TYPE 19
param set-default VT_TYPE 0
param set-default VT_ELEV_MC_LOCK 0
@@ -1,28 +1,16 @@
#!/bin/sh
#
# @name Standard Plane
# @name Generic Standard Plane
#
# @type Standard Plane
# @class Plane
#
# @output MAIN1 aileron
# @output MAIN2 elevator
# @output MAIN3 throttle
# @output MAIN4 rudder
# @output MAIN5 flaps
# @output MAIN6 gear
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer Lorenz Meier <lorenz@px4.io>
#
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.fw_defaults
param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 1
param set-default CA_ROTOR_COUNT 1
param set-default CA_ROTOR0_PX 0.3
@@ -34,11 +22,3 @@ param set-default CA_SV_CS2_TRQ_P 1.0
param set-default CA_SV_CS2_TYPE 3
param set-default CA_SV_CS3_TRQ_Y 1.0
param set-default CA_SV_CS3_TYPE 4
param set-default PWM_AUX_RATE 50
param set-default PWM_MAIN_RATE 50
set MIXER AETRFG
# Rate must be set by group (see pwm info).
# Throttle is in the same group as servos.
@@ -5,19 +5,20 @@
# @type Flying Wing
# @class Plane
#
# @output MAIN1 left aileron
# @output MAIN2 right aileron
# @output MAIN4 throttle
#
# @output AUX1 feed-through of RC AUX1 channel
# @output AUX2 feed-through of RC AUX2 channel
# @output AUX3 feed-through of RC AUX3 channel
#
# @maintainer
#
# @board bitcraze_crazyflie exclude
#
. ${R}etc/init.d/rc.fw_defaults
set MIXER fw_generic_wing
param set-default SYS_CTRL_ALLOC 1
param set-default CA_AIRFRAME 1
param set-default CA_ROTOR_COUNT 1
param set-default CA_ROTOR0_PX 0.15
param set-default CA_SV_CS_COUNT 2
param set-default CA_SV_CS0_TYPE 5
param set-default CA_SV_CS0_TRQ_P 0.5
param set-default CA_SV_CS0_TRQ_R -0.5
param set-default CA_SV_CS1_TYPE 6
param set-default CA_SV_CS1_TRQ_P 0.5
param set-default CA_SV_CS1_TRQ_R 0.5
@@ -30,9 +30,6 @@ param set-default FW_L1_DAMPING 0.74
param set-default FW_L1_PERIOD 16
param set-default FW_LND_ANG 15
param set-default FW_LND_FLALT 5
param set-default FW_LND_HVIRT 13
param set-default FW_LND_TLALT 5
param set-default FW_THR_LND_MAX 0
param set-default FW_PR_FF 0.35
param set-default FW_RR_FF 0.6
param set-default FW_RR_P 0.04
@@ -32,9 +32,6 @@ param set-default FW_L1_DAMPING 0.74
param set-default FW_L1_PERIOD 16
param set-default FW_LND_ANG 15
param set-default FW_LND_FLALT 5
param set-default FW_LND_HVIRT 13
param set-default FW_LND_TLALT 5
param set-default FW_THR_LND_MAX 0
param set-default FW_PR_FF 0.35
param set-default FW_RR_FF 0.6
param set-default FW_RR_P 0.04
@@ -27,9 +27,6 @@ param set-default FW_AIRSPD_TRIM 16.5
param set-default FW_L1_PERIOD 15
param set-default FW_LND_ANG 15
param set-default FW_LND_FLALT 8
param set-default FW_LND_HVIRT 13
param set-default FW_LND_TLALT 10
param set-default FW_THR_LND_MAX 0
param set-default FW_P_LIM_MAX 20
param set-default FW_P_LIM_MIN -30
param set-default FW_R_LIM 45
@@ -124,6 +124,7 @@ px4_add_romfs_files(
13007_vtol_AAVVT_quad
13008_QuadRanger
13009_vtol_spt_ranger
13100_generic_vtol_tiltrotor
13012_convergence
13013_deltaquad
13014_vtol_babyshark
@@ -5,7 +5,7 @@ Tailsitter duo mixer
This file defines a mixer for a generic duo tailsitter VTOL (eg TBS Caipirinha tailsitter edition). This vehicle
has two motors in total, one attached to each wing. It also has two elevons which
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
on the main PWM output port, two at 400Hz for the motors, and two at 50Hz for the
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
@@ -4,7 +4,7 @@ Tailsitter duo mixer
This file defines a mixer for a generic duo tailsitter VTOL (eg TBS Caipirinha tailsitter edition). This vehicle
has two motors in total, one attached to each wing. It also has two elevons which
are located in the slipstream of the propellers. This mixer generates 4 PWM outputs
on the main PWM ouput port, two at 400Hz for the motors, and two at 50Hz for the
on the main PWM output port, two at 400Hz for the motors, and two at 50Hz for the
elevon servos. Channels 1-4 are configured to run at 400Hz, while channels 5-8 run
at the default rate of 50Hz. Note that channels 3 and 4 are assigned but not used.
@@ -17,6 +17,7 @@ exec find boards msg src platforms test \
-path src/lib/crypto/monocypher -prune -o \
-path src/lib/events/libevents -prune -o \
-path src/lib/parameters/uthash -prune -o \
-path src/lib/wind_estimator/python/generated -prune -o \
-path src/modules/ekf2/EKF -prune -o \
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
-path src/modules/mavlink/mavlink -prune -o \
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
if [[ -z "${DOCKER_TAG}" ]]; then
# the default tag for docker images
# follows the pattern below, and we recommend
# that any images pushed to the registry continue
# to use the pattern for consistency
TAG_NAME="`date +"%Y-%m-%d"`"
else
TAG_NAME="${DOCKER_TAG}"
fi
PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:$TAG_NAME"
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SRC_DIR=$PWD/../
echo "[docker_build.sh]: Building [$PX4_DOCKER_REPO]"
docker build \
-t ${PX4_DOCKER_REPO} \
-f Tools/setup/Dockerfile "${SRC_DIR}"
+19 -57
View File
@@ -1,67 +1,29 @@
#! /bin/bash
#!/bin/bash
if [ -z ${PX4_DOCKER_REPO+x} ]; then
echo "guessing PX4_DOCKER_REPO based on input";
if [[ $@ =~ .*px4_fmu.* ]]; then
# nuttx-px4fmu-v{1,2,3,4,5}
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-09-08"
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*beaglebone.* ]] || [[ $@ =~ .*pilotpi.default ]]; then
# beaglebone_blue_default, emlid_navio2_default, px4_raspberrypi_default, scumaker_pilotpi_default
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-08-18"
elif [[ $@ =~ .*pilotpi.arm64 ]]; then
# scumaker_pilotpi_arm64
PX4_DOCKER_REPO="px4io/px4-dev-aarch64:latest"
elif [[ $@ =~ .*navio2.* ]] || [[ $@ =~ .*raspberry.* ]] || [[ $@ =~ .*bebop.* ]]; then
# posix_rpi_cross, posix_bebop_default
PX4_DOCKER_REPO="px4io/px4-dev-armhf:2021-08-18"
elif [[ $@ =~ .*clang.* ]] || [[ $@ =~ .*scan-build.* ]]; then
# clang tools
PX4_DOCKER_REPO="px4io/px4-dev-clang:2021-02-04"
elif [[ $@ =~ .*tests* ]]; then
# run all tests with simulation
PX4_DOCKER_REPO="px4io/px4-dev-simulation-bionic:2021-12-11"
fi
if [[ -z "${DOCKER_TAG}" ]]; then
# The default tag name should be hardcoded
# to whatever we are currently using in CI on this branch
TAG_NAME="2022-08-16"
else
echo "PX4_DOCKER_REPO is set to '$PX4_DOCKER_REPO'";
TAG_NAME="${DOCKER_TAG}"
fi
# otherwise default to nuttx
if [ -z ${PX4_DOCKER_REPO+x} ]; then
PX4_DOCKER_REPO="px4io/px4-dev-nuttx-focal:2021-09-08"
fi
PX4_DOCKER_REPO="ghcr.io/px4/px4-dev:$TAG_NAME"
# docker hygiene
#Delete all stopped containers (including data-only containers)
#docker rm $(docker ps -a -q)
#Delete all 'untagged/dangling' (<none>) images
#docker rmi $(docker images -q -f dangling=true)
echo "PX4_DOCKER_REPO: $PX4_DOCKER_REPO";
echo "[docker_run.sh]: Running '$PX4_DOCKER_REPO'"
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
SRC_DIR=$PWD/../
CCACHE_DIR=${HOME}/.ccache
mkdir -p "${CCACHE_DIR}"
docker run -it --rm -w "${SRC_DIR}" \
--env=AWS_ACCESS_KEY_ID \
--env=AWS_SECRET_ACCESS_KEY \
--env=BRANCH_NAME \
--env=CCACHE_DIR="${CCACHE_DIR}" \
--env=CI \
--env=CODECOV_TOKEN \
--env=COVERALLS_REPO_TOKEN \
--env=LOCAL_USER_ID="$(id -u)" \
--env=PX4_ASAN \
--env=PX4_MSAN \
--env=PX4_TSAN \
--env=PX4_UBSAN \
--env=TRAVIS_BRANCH \
--env=TRAVIS_BUILD_ID \
--publish 14556:14556/udp \
--volume=${CCACHE_DIR}:${CCACHE_DIR}:rw \
--volume=${SRC_DIR}:${SRC_DIR}:rw \
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
--env=LOCAL_USER_ID="$(id -u)" \
--env=AWS_ACCESS_KEY_ID \
--env=AWS_SECRET_ACCESS_KEY \
--env=BRANCH_NAME \
--env=CCACHE_DIR="${CCACHE_DIR}" \
--env=CI \
--publish 14556:14556/udp \
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
--volume=/tmp:/tmp:rw \
--volume=${SRC_DIR}:${SRC_DIR}:rw \
${PX4_DOCKER_REPO} /bin/bash -c "$1 $2 $3"
+4 -4
View File
@@ -3019,7 +3019,7 @@ class MAVLink(object):
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
temperature : Temperature measurement (0.01 degrees Celsius) (int16_t)
'''
msg = MAVLink_scaled_pressure_message(time_boot_ms, press_abs, press_diff, temperature)
@@ -3035,7 +3035,7 @@ class MAVLink(object):
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
press_abs : Absolute pressure (hectopascal) (float)
press_diff : Differential pressure 1 (hectopascal) (float)
temperature : Temperature measurement (0.01 degrees celsius) (int16_t)
temperature : Temperature measurement (0.01 degrees Celsius) (int16_t)
'''
return self.send(self.scaled_pressure_encode(time_boot_ms, press_abs, press_diff, temperature))
@@ -4879,7 +4879,7 @@ class MAVLink(object):
abs_pressure : Absolute pressure in millibar (float)
diff_pressure : Differential pressure in millibar (float)
pressure_alt : Altitude calculated from pressure (float)
temperature : Temperature in degrees celsius (float)
temperature : Temperature in degrees Celsius (float)
fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t)
'''
@@ -4904,7 +4904,7 @@ class MAVLink(object):
abs_pressure : Absolute pressure in millibar (float)
diff_pressure : Differential pressure in millibar (float)
pressure_alt : Altitude calculated from pressure (float)
temperature : Temperature in degrees celsius (float)
temperature : Temperature in degrees Celsius (float)
fields_updated : Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature (uint16_t)
'''
+7 -4
View File
@@ -14,12 +14,14 @@ class MarkdownOutput():
result = """
# Modules & Commands Reference
The following pages document the PX4 modules, drivers and commands. They
describe the provided functionality, high-level implementation overview and how
The following pages document the PX4 modules, drivers and commands.
They describe the provided functionality, high-level implementation overview and how
to use the command-line interface.
> **Note** **This is auto-generated from the source code** and contains the
> most recent modules documentation.
:::note
**This is auto-generated from the source code** and contains the most recent modules documentation.
:::
It is not a complete list and NuttX provides some additional commands
as well (such as `free`). Use `help` on the console to get a list of all
@@ -29,6 +31,7 @@ Since this is generated from source, errors must be reported/fixed
in the [PX4-Autopilot](https://github.com/PX4/PX4-Autopilot) repository.
The documentation pages can be generated by running the following command from
the root of the PX4-Autopilot directory:
```
make module_documentation
```
+51
View File
@@ -0,0 +1,51 @@
#
# PX4 base development environment
#
FROM ubuntu:20.04
LABEL maintainer="Daniel Agar <daniel@agar.ca>, Ramon Roche <mrpollo@gmail.com>"
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# Installing required utilities
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
ca-certificates \
gnupg \
lsb-core \
lsb-release \
sudo \
software-properties-common \
wget \
gosu \
;
# Install PX4 Requirements
COPY Tools/setup/requirements.txt /tmp/requirements.txt
COPY Tools/setup/ubuntu.sh /tmp/ubuntu.sh
# The PATH env is set within ubuntu.sh, but given how we
# are running the image using `gosu` to avoid read-only problems
# with the filesystem the env variable does not persist
ENV PATH="/opt/gcc-arm-none-eabi-9-2020-q2-update/bin:$PATH"
RUN bash /tmp/ubuntu.sh --from-docker
ENV DISPLAY :99
ENV FASTRTPSGEN_DIR="/usr/local/bin/"
ENV TERM=xterm
ENV TZ=UTC
# SITL UDP PORTS
EXPOSE 14556/udp
EXPOSE 14557/udp
# create user with id 1001 (jenkins docker workflow default)
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
# create and start as LOCAL_USER_ID
COPY Tools/setup/docker-entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
echo "[docker-entrypoint.sh] Starting entrypoint"
# Start virtual X server in the background
# - DISPLAY default is :99, set in dockerfile
# - Users can override with `-e DISPLAY=` in `docker run` command to avoid
# running Xvfb and attach their screen
if [[ -x "$(command -v Xvfb)" && "$DISPLAY" == ":99" ]]; then
echo "[docker-entrypoint.sh] Starting Xvfb"
Xvfb :99 -screen 0 1600x1200x24+32 &
fi
# Check if the ROS_DISTRO is passed and use it
# to source the ROS environment
if [ -n "${ROS_DISTRO}" ]; then
source "/opt/ros/$ROS_DISTRO/setup.bash"
fi
# Use the LOCAL_USER_ID if passed in at runtime
if [ -n "${LOCAL_USER_ID}" ]; then
echo "[docker-entrypoint.sh] Starting with UID : $LOCAL_USER_ID"
# modify existing user's id
usermod -u $LOCAL_USER_ID user
# run as user
exec gosu user "$@"
else
exec "$@"
fi
+2
View File
@@ -26,3 +26,5 @@ requests
setuptools>=39.2.0
six>=1.12.0
toml>=0.9
symforce>=0.5.0
sympy>=1.10.1
+123 -72
View File
@@ -2,20 +2,18 @@
set -e
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04, 16.04).
## Bash script to setup PX4 development environment on Ubuntu LTS (20.04, 18.04).
## Can also be used in docker.
##
## Installs:
## - Common dependencies and tools for nuttx, jMAVSim, Gazebo
## - Common dependencies and tools for NuttX, and Gazebo
## - NuttX toolchain (omit with arg: --no-nuttx)
## - jMAVSim and Gazebo9 simulator (omit with arg: --no-sim-tools)
##
## Not Installs:
## - FastRTPS and FastCDR
## - Gazebo simulator (omit with arg: --no-sim-tools)
INSTALL_NUTTX="true"
INSTALL_SIM="true"
INSTALL_ARCH=`uname -m`
INSIDE_DOCKER="false"
# Parse arguments
for arg in "$@"
@@ -28,19 +26,22 @@ do
INSTALL_SIM="false"
fi
done
# detect if running in docker
if [ -f /.dockerenv ]; then
echo "Running within docker, installing initial dependencies";
apt-get --quiet -y update && DEBIAN_FRONTEND=noninteractive apt-get --quiet -y install \
ca-certificates \
gnupg \
lsb-core \
sudo \
wget \
;
fi
if [[ $arg == "--from-docker" ]]; then
INSIDE_DOCKER="true"
fi
if [[ $arg == "--help" ]]; then
echo "#⚡️ PX4 Dependency Installer for Ubuntu"
echo "# Options:
#
# --no-nuttx boolean
# --no-sim-tools boolean"
echo "#"
exit
fi
done
# script directory
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@@ -69,9 +70,22 @@ elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
echo "Ubuntu 20.04"
fi
VERBOSE_BAR="####################"
echo
echo $VERBOSE_BAR
echo "#⚡️ Starting PX4 Dependency Installer for Ubuntu ${UBUNTU_RELEASE} (${INSTALL_ARCH})"
echo "# Options:
#
# - Install NuttX = ${INSTALL_NUTTX}
# - Install Simulation = ${INSTALL_SIM}"
echo $VERBOSE_BAR
echo
echo
echo "Installing PX4 general dependencies"
echo $VERBOSE_BAR
echo "🍻 Installing System Dependencies"
echo $VERBOSE_BAR
echo
sudo apt-get update -y --quiet
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
@@ -85,6 +99,7 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
gdb \
git \
lcov \
libssl-dev \
libxml2-dev \
libxml2-utils \
make \
@@ -100,32 +115,42 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends i
zip \
;
# Python3 dependencies
# Python 3 dependencies
echo
echo "Installing PX4 Python3 dependencies"
echo $VERBOSE_BAR
echo "🍻 Installing Python dependencies"
echo $VERBOSE_BAR
echo
if [ -n "$VIRTUAL_ENV" ]; then
# virtual envrionments don't allow --user option
# virtual environments don't allow --user option
python -m pip install -r ${DIR}/requirements.txt
else
# older versions of Ubuntu require --user option
python3 -m pip install --user -r ${DIR}/requirements.txt
if [[ $INSIDE_DOCKER == "true" ]]; then
# when running inside a docker container we don't need to install
# under --user since the installer user is root
# its best to install packages globaly for any user to find
python3 -m pip install -r /tmp/requirements.txt
else
python3 -m pip install --user -r ${DIR}/requirements.txt
fi
fi
# NuttX toolchain (arm-none-eabi-gcc)
if [[ $INSTALL_NUTTX == "true" ]]; then
echo
echo "Installing NuttX dependencies"
echo $VERBOSE_BAR
echo "🍻 Installing NuttX dependencies"
echo $VERBOSE_BAR
echo
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
automake \
binutils-dev \
bison \
build-essential \
flex \
g++-multilib \
gcc-multilib \
gdb-multiarch \
genromfs \
gettext \
gperf \
@@ -145,7 +170,12 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
u-boot-tools \
util-linux \
vim-common \
g++-arm-linux-gnueabihf \
gcc-arm-linux-gnueabihf \
g++-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
;
if [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
kconfig-frontends \
@@ -158,32 +188,47 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
sudo usermod -a -G dialout $USER
fi
# arm-none-eabi-gcc
NUTTX_GCC_VERSION="9-2020-q2-update"
NUTTX_GCC_VERSION_SHORT="9-2020q2"
echo
echo $VERBOSE_BAR
echo "🍻 Verifying proper gcc version (${NUTTX_GCC_VERSION}), and installing if not found"
echo
source $HOME/.profile # load changed path for the case the script is reran before relogin
if [ $(which arm-none-eabi-gcc) ]; then
GCC_VER_STR=$(arm-none-eabi-gcc --version)
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
GCC_VER_FOUND=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
fi
if [[ "$GCC_FOUND_VER" == "1" ]]; then
echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation"
if [[ $(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}") == "1" ]]; then
echo "📌 Skipping installation, the arm cross compiler was found"
echo $VERBOSE_BAR
echo
else
echo "Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
wget -O /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-${INSTALL_ARCH}-linux.tar.bz2 && \
sudo tar -jxf /tmp/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}-linux.tar.bz2 -C /opt/;
echo "📌 The arm cross compiler was not found";
echo " * Installing arm-none-eabi-gcc-${NUTTX_GCC_VERSION}";
COMPILER_NAME="gcc-arm-none-eabi-${NUTTX_GCC_VERSION}"
COMPILER_PATH="/tmp/$COMPILER_NAME-linux.tar.bz2"
wget -O $COMPILER_PATH https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/${NUTTX_GCC_VERSION_SHORT}/${COMPILER_NAME}-${INSTALL_ARCH}-linux.tar.bz2
sudo tar -jxf $COMPILER_PATH -C /opt/;
# add arm-none-eabi-gcc to user's PATH
exportline="export PATH=/opt/gcc-arm-none-eabi-${NUTTX_GCC_VERSION}/bin:\$PATH"
if grep -Fxq "$exportline" $HOME/.profile; then
exportline="export PATH=\"/opt/${COMPILER_NAME}/bin:\$PATH\""
if [[ $INSIDE_DOCKER == "true" ]]; then
# when running on a docker container its best to set the environment globally
# since we don't know which user is going to be running commands on the container
touch /etc/profile.d/px4env.sh
echo $exportline >> /etc/profile.d/px4env.sh
elif grep -Fxq "$exportline" $HOME/.profile; then
echo "${NUTTX_GCC_VERSION} path already set.";
else
echo $exportline >> $HOME/.profile;
fi
echo " * arm-none-eabi-gcc (${NUTTX_GCC_VERSION}) Installed Succesful to /opt/${COMPILER_NAME}/bin"
echo $VERBOSE_BAR
echo
fi
fi
@@ -191,45 +236,32 @@ fi
if [[ $INSTALL_SIM == "true" ]]; then
echo
echo "Installing PX4 simulation dependencies"
echo $VERBOSE_BAR
echo "🍻 Installing PX4 Simulation Tools"
echo
# default and Ubuntu 20.04
gazebo_version=11
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
gazebo_version=9
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
gazebo_version=11
gazebo_packages="gazebo libgazebo-dev"
fi
echo " * Gazebo Version $gazebo_version"
echo $VERBOSE_BAR
# General simulation dependencies
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
bc \
;
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
java_version=11
elif [[ "${UBUNTU_RELEASE}" == "20.04" ]]; then
java_version=13
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
java_version=11
else
java_version=14
fi
# Java (jmavsim or fastrtps)
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
ant \
openjdk-$java_version-jre \
openjdk-$java_version-jdk \
libvecmath-java \
;
# Set Java 11 as default
sudo update-alternatives --set java $(update-alternatives --list java | grep "java-$java_version")
# Gazebo
if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then
gazebo_version=9
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then
gazebo_packages="gazebo libgazebo-dev"
else
# default and Ubuntu 20.04
gazebo_version=11
gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev"
fi
# Installing Gazebo and dependencies
# Setup OSRF Gazebo repository
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
# Update list, since new gazebo-stable.list has been added
@@ -257,7 +289,26 @@ if [[ $INSTALL_SIM == "true" ]]; then
fi
fi
if [[ $INSTALL_NUTTX == "true" ]]; then
echo
echo "Relogin or reboot computer before attempting to build NuttX targets"
if [[ $INSIDE_DOCKER == "true" ]]; then
# cleanup installation
rm -rf /tmp/
fi
if [[ $INSIDE_DOCKER == "false" ]] && [[ $INSTALL_NUTTX == "true" ]]; then
echo
echo $VERBOSE_BAR
echo "💡 We recommend you relogin/reboot before attempting to build NuttX targets"
echo $VERBOSE_BAR
echo
fi
echo
echo
echo $VERBOSE_BAR
echo "#⚡️ PX4 Dependency Installer Ended Succesfully
#
# For more information on PX4 Autopilot check out our docs
# at docs.px4.io, if you find a bug please file an issue
# on GitHub https://github.com/px4/px4-autopilot"
echo $VERBOSE_BAR
echo
+4 -3
View File
@@ -13,6 +13,7 @@ CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_IMU_BOSCH_BMI085=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20602=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
@@ -38,6 +39,7 @@ CONFIG_MODULES_ATTITUDE_ESTIMATOR_Q=y
CONFIG_MODULES_BATTERY_STATUS=y
CONFIG_MODULES_CAMERA_FEEDBACK=y
CONFIG_MODULES_COMMANDER=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_DATAMAN=y
CONFIG_MODULES_EKF2=y
CONFIG_MODULES_ESC_BATTERY=y
@@ -46,6 +48,7 @@ CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
CONFIG_MODULES_FW_ATT_CONTROL=y
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_FW_POS_CONTROL_L1=y
CONFIG_MODULES_GIMBAL=y
CONFIG_MODULES_GYRO_CALIBRATION=y
CONFIG_MODULES_GYRO_FFT=y
CONFIG_MODULES_LAND_DETECTOR=y
@@ -61,7 +64,6 @@ CONFIG_MODULES_MC_AUTOTUNE_ATTITUDE_CONTROL=y
CONFIG_MODULES_MC_HOVER_THRUST_ESTIMATOR=y
CONFIG_MODULES_MC_POS_CONTROL=y
CONFIG_MODULES_MC_RATE_CONTROL=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_ROVER_POS_CONTROL=y
@@ -70,10 +72,9 @@ CONFIG_MODULES_SIH=y
CONFIG_MODULES_TEMPERATURE_COMPENSATION=y
CONFIG_MODULES_UUV_ATT_CONTROL=y
CONFIG_MODULES_UUV_POS_CONTROL=y
CONFIG_MODULES_GIMBAL=y
CONFIG_MODULES_VTOL_ATT_CONTROL=y
CONFIG_SYSTEMCMDS_BL_UPDATE=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_BL_UPDATE=y
CONFIG_SYSTEMCMDS_DMESG=y
CONFIG_SYSTEMCMDS_DUMPFILE=y
CONFIG_SYSTEMCMDS_GPIO=y
+8 -2
View File
@@ -8,8 +8,14 @@ board_adc start
icm20602 -s -b 1 -R 8 start
# Internal SPI bus BMI088 accel & gyro
bmi088 -A -s -b 5 -R 8 start
bmi088 -G -s -b 5 -R 8 start
if bmi088 -A -s -b 5 -R 8 start
then
bmi088 -G -s -b 5 -R 8 start
else
# otherwise try BMI085
bmi085 -A -s -b 5 -R 8 start
bmi085 -G -s -b 5 -R 8 start
fi
# Internal ICM-20948 (with magnetometer)
icm20948 -s -b 1 -R 8 -M start
+2
View File
@@ -47,6 +47,8 @@ constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
initSPIBus(SPI::Bus::SPI5, {
initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}),
initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}),
initSPIDevice(DRV_GYR_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin10}, SPI::DRDY{GPIO::PortF, GPIO::Pin3}),
initSPIDevice(DRV_ACC_DEVTYPE_BMI085, SPI::CS{GPIO::PortF, GPIO::Pin6}, SPI::DRDY{GPIO::PortF, GPIO::Pin1}),
}),
initSPIBusExternal(SPI::Bus::SPI6, {
initSPIConfigExternal(SPI::CS{GPIO::PortG, GPIO::Pin9}),
+1 -1
View File
@@ -110,7 +110,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
VDD_3V3_SENSORS_EN(true);
up_mdelay(2);
/* Restore all the CS to ouputs inactive */
/* Restore all the CS to outputs inactive */
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
+1 -1
View File
@@ -124,7 +124,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
VDD_3V3_SENSORS_EN(true);
up_mdelay(2);
/* Restore all the CS to ouputs inactive */
/* Restore all the CS to outputs inactive */
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
@@ -35,7 +35,7 @@
****************************************************************************/
/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address,
* 0x0060:0000, Upto 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
* 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
* beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this
* configuration.
*
@@ -43,7 +43,7 @@
* 256Kib to OCRRAM, 128Kib ITCM and 128Kib DTCM.
* This can be changed by using a dcd by minipulating
* IOMUX GPR16 and GPR17.
* The configuartion we will use is 384Kib to OCRRAM, 0Kib ITCM and
* The configuration we will use is 384Kib to OCRRAM, 0Kib ITCM and
* 128Kib DTCM.
*
* This is the OCRAM inker script.
@@ -35,7 +35,7 @@
****************************************************************************/
/* The FMURT1062 has 8MiB of QSPI FLASH beginning at address,
* 0x0060:0000, Upto 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
* 0x0060:0000, Up to 512Kb of DTCM RAM beginning at 0x2000:0000, and 1MiB OCRAM
* beginning at 0x2020:0000. Neither DTCM or SDRAM are used in this
* configuratin.
*/
+4
View File
@@ -0,0 +1,4 @@
CONFIG_DRIVERS_CYPHAL=y
CONFIG_CYPHAL_CLIENT=y
CONFIG_CYPHAL_APP_DESCRIPTOR=y
CONFIG_CYPHAL_UORB_SENSOR_GPS_PUBLISHER=y
+5 -4
View File
@@ -4,14 +4,14 @@ CONFIG_BOARD_ROMFSROOT="cannode"
CONFIG_BOARD_CONSTRAINED_MEMORY=y
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS1"
CONFIG_DRIVERS_BOOTLOADERS=y
CONFIG_DRIVERS_DISTANCE_SENSOR_TFMINI=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_LIGHTS_RGBLED_PWM=y
CONFIG_DRIVERS_PWM_OUT=y
CONFIG_DRIVERS_CYPHAL=y
CONFIG_CYPHAL_CLIENT=y
CONFIG_CYPHAL_APP_DESCRIPTOR=y
CONFIG_CYPHAL_UORB_SENSOR_GPS_PUBLISHER=y
CONFIG_BOARD_UAVCAN_INTERFACES=1
CONFIG_DRIVERS_UAVCANNODE=y
CONFIG_MODULES_CONTROL_ALLOCATOR=y
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=y
CONFIG_SYSTEMCMDS_I2CDETECT=y
CONFIG_SYSTEMCMDS_LED_CONTROL=y
CONFIG_SYSTEMCMDS_MFT=y
@@ -23,5 +23,6 @@ CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
CONFIG_SYSTEMCMDS_UORB=y
CONFIG_SYSTEMCMDS_VER=y
CONFIG_SYSTEMCMDS_WORK_QUEUE=y
@@ -6,4 +6,9 @@
pwm_out mode_pwm1 start
ifup can0
cyphal start
# Start Cyphal when enabled
if param compare -s CYPHAL_ENABLE 1
then
cyphal start
fi
@@ -112,6 +112,6 @@ CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSTEM_I2CTOOL=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_SPITOOL=y
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_USERMAIN_STACKSIZE=2176
CONFIG_USER_ENTRYPOINT="nsh_main"
CONFIG_WATCHDOG=y
+1 -1
View File
@@ -93,7 +93,7 @@ __EXPORT void board_spi_reset(int ms, int bus_mask)
}
}
/* Restore all the CS to ouputs inactive */
/* Restore all the CS to outputs inactive */
for (int bus = 0; bus < SPI_BUS_MAX_BUS_ITEMS; ++bus) {
if (px4_spi_buses[bus].bus == PX4_BUS_NUMBER_TO_PX4(1)) {
for (int i = 0; i < SPI_BUS_MAX_DEVICES; ++i) {
+1
View File
@@ -12,6 +12,7 @@ fi
if param compare -s ADC_ADS1115_EN 1
then
ads1115 start -X
board_adc start -n
else
board_adc start
fi
+1
View File
@@ -4,6 +4,7 @@ CONFIG_DRIVERS_OSD=n
CONFIG_EXAMPLES_FAKE_GPS=n
CONFIG_SYSTEMCMDS_ACTUATOR_TEST=n
CONFIG_SYSTEMCMDS_DUMPFILE=n
CONFIG_SYSTEMCMDS_GPIO=n
CONFIG_SYSTEMCMDS_MOTOR_TEST=n
CONFIG_SYSTEMCMDS_REFLECT=n
CONFIG_SYSTEMCMDS_SD_BENCH=n
+1
View File
@@ -40,6 +40,7 @@
#include <px4_platform_common/tasks.h>
#include <board_config.h>
#include <stdio.h>
#include <stdlib.h>
#if defined(BOARD_HAS_POWER_CONTROL)
int board_register_power_state_notification_cb(power_button_state_notification_t cb)
@@ -68,7 +68,7 @@ class MavrosOffboardAttctlTest(MavrosTestCommon):
self.att_setpoint_pub = rospy.Publisher(
'mavros/setpoint_raw/attitude', AttitudeTarget, queue_size=1)
# send setpoints in seperate thread to better prevent failsafe
# send setpoints in separate thread to better prevent failsafe
self.att_thread = Thread(target=self.send_att, args=())
self.att_thread.daemon = True
self.att_thread.start()
@@ -73,7 +73,7 @@ class MavrosOffboardPosctlTest(MavrosTestCommon):
self.pos_setpoint_pub = rospy.Publisher(
'mavros/setpoint_position/local', PoseStamped, queue_size=1)
# send setpoints in seperate thread to better prevent failsafe
# send setpoints in separate thread to better prevent failsafe
self.pos_thread = Thread(target=self.send_pos, args=())
self.pos_thread.daemon = True
self.pos_thread.start()
@@ -66,7 +66,7 @@ class MavrosOffboardYawrateTest(MavrosTestCommon):
self.att_setpoint_pub = rospy.Publisher(
'mavros/setpoint_raw/attitude', AttitudeTarget, queue_size=1)
# send setpoints in seperate thread to better prevent failsafe
# send setpoints in separate thread to better prevent failsafe
self.att_thread = Thread(target=self.send_att, args=())
self.att_thread.daemon = True
self.att_thread.start()
+1 -1
View File
@@ -5,6 +5,6 @@ float32 indicated_airspeed_m_s # indicated airspeed in m/s
float32 true_airspeed_m_s # true filtered airspeed in m/s
float32 air_temperature_celsius # air temperature in degrees celsius, -1000 if unknown
float32 air_temperature_celsius # air temperature in degrees Celsius, -1000 if unknown
float32 confidence # confidence value from 0 to 1 for this sensor
+1 -1
View File
@@ -21,7 +21,7 @@ uint16 capacity # actual capacity of the battery
uint16 cycle_count # number of discharge cycles the battery has experienced
uint16 average_time_to_empty # predicted remaining battery capacity based on the average rate of discharge in min
uint16 serial_number # serial number of the battery pack
uint16 manufacture_date # manufacture date, part of serial number of the battery pack. formated as: Day + Month×32 + (Year1980)×512
uint16 manufacture_date # manufacture date, part of serial number of the battery pack. Formatted as: Day + Month×32 + (Year1980)×512
uint16 state_of_health # state of health. FullChargeCapacity/DesignCapacity, 0-100%.
uint16 max_error # max error, expected margin of error in % in the state-of-charge calculation with a range of 1 to 100%
uint8 id # ID number of a battery. Should be unique and consistent for the lifetime of a vehicle. 1-indexed.
+1 -1
View File
@@ -17,7 +17,7 @@ uint8 CELLULAR_STATUS_FLAG_CONNECTED=12 # One or more packet data bearers is ac
uint8 CELLULAR_NETWORK_FAILED_REASON_NONE=0 # No error
uint8 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN=1 # Error state is unknown
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING=2 # SIM is required for the modem but missing
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR=3 # SIM is available, but not usuable for connection
uint8 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR=3 # SIM is available, but not usable for connection
uint16 status # Status bitmap 1: Roaming is active
uint8 failure_reason #Failure reason when status in in CELLUAR_STATUS_FAILED
+1 -1
View File
@@ -5,6 +5,6 @@ uint32 device_id # unique device ID for the sensor that does
float32 differential_pressure_pa # differential pressure reading in Pascals (may be negative)
float32 temperature # Temperature provided by sensor in celcius, NAN if unknown
float32 temperature # Temperature provided by sensor in degrees Celsius, NAN if unknown
uint32 error_count # Number of errors detected by driver
+1 -1
View File
@@ -30,7 +30,7 @@ bool gps_data_stopped_using_alternate # 3 - true when the gps data has stoppe
bool height_sensor_timeout # 4 - true when the height sensor has not been used to correct the state estimates for a significant time period
bool stopping_navigation # 5 - true when the filter has insufficient data to estimate velocity and position and is falling back to an attitude, height and height rate mode of operation
bool invalid_accel_bias_cov_reset # 6 - true when the filter has detected bad acceerometer bias state esitmstes and has reset the corresponding covariance matrix elements
bool bad_yaw_using_gps_course # 7 - true when the fiter has detected an invalid yaw esitmate and has reset the yaw angle to the GPS ground course
bool bad_yaw_using_gps_course # 7 - true when the filter has detected an invalid yaw estimate and has reset the yaw angle to the GPS ground course
bool stopping_mag_use # 8 - true when the filter has detected bad magnetometer data and is stopping further use of the magnetomer data
bool vision_data_stopped # 9 - true when the vision system data has stopped for a significant time period
bool emergency_yaw_reset_mag_stopped # 10 - true when the filter has detected bad magnetometer data, has reset the yaw to anothter source of data and has stopped further use of the magnetomer data
+2 -2
View File
@@ -18,8 +18,8 @@ float32 rng_vpos # range sensor height innovation (m) and innovation variance (m
float32 baro_vpos # barometer height innovation (m) and innovation variance (m**2)
# Auxiliary velocity
float32[2] aux_hvel # horizontal auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
float32 aux_vvel # vertical auxiliar velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
float32[2] aux_hvel # horizontal auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
float32 aux_vvel # vertical auxiliary velocity innovation from landing target measurement (m/sec) and innovation variance ((m/sec)**2)
# Optical flow
float32[2] flow # flow innvoation (rad/sec) and innovation variance ((rad/sec)**2)
+1 -1
View File
@@ -9,7 +9,7 @@ bool cs_yaw_align # 1 - true if the filter yaw alignment is complet
bool cs_gps # 2 - true if GPS measurement fusion is intended
bool cs_opt_flow # 3 - true if optical flow measurements fusion is intended
bool cs_mag_hdg # 4 - true if a simple magnetic yaw heading fusion is intended
bool cs_mag_3d # 5 - true if 3-axis magnetometer measurement fusion is inteded
bool cs_mag_3d # 5 - true if 3-axis magnetometer measurement fusion is intended
bool cs_mag_dec # 6 - true if synthetic magnetic declination measurements fusion is intended
bool cs_in_air # 7 - true when the vehicle is airborne
bool cs_wind # 8 - true when wind velocity is being estimated
+1 -1
View File
@@ -3,7 +3,7 @@
uint64 timestamp # time since system start (microseconds)
uint8 instance # Instance of GNSS reciever
uint8 instance # Instance of GNSS receiver
uint8 len # length of data, MSB bit set = message to the gps device,
# clear = message from the device
+3 -1
View File
@@ -2,8 +2,10 @@ uint64 timestamp # time since system start (microseconds)
uint32 device_id # unique device ID for the sensor that does not change between power cycles
uint8 len # length of data
uint16 len # length of data
uint8 flags # LSB: 1=fragmented
uint8[300] data # data to write to GPS device (RTCM message)
uint8 ORB_QUEUE_LENGTH = 8
uint8 MAX_INSTANCES = 2
+2 -2
View File
@@ -29,8 +29,8 @@ int32 rssi # receive signal strength indicator (RSSI): < 0: Undefined, 0: no
bool rc_failsafe # explicit failsafe flag: true on TX failure or TX out of range , false otherwise. Only the true state is reliable, as there are some (PPM) receivers on the market going into failsafe without telling us explicitly.
bool rc_lost # RC receiver connection status: True,if no frame has arrived in the expected time, false otherwise. True usually means that the receiver has been disconnected, but can also indicate a radio link loss on "stupid" systems. Will remain false, if a RX with failsafe option continues to transmit frames after a link loss.
uint16 rc_lost_frame_count # Number of lost RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike funtionality.
uint16 rc_total_frame_count # Number of total RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike funtionality.
uint16 rc_lost_frame_count # Number of lost RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike functionality.
uint16 rc_total_frame_count # Number of total RC frames. Note: intended purpose: observe the radio link quality if RSSI is not available. This value must not be used to trigger any failsafe-alike functionality.
uint16 rc_ppm_frame_length # Length of a single PPM frame. Zero for non-PPM systems
uint8 input_source # Input source
+1 -1
View File
@@ -4,7 +4,7 @@ uint16 tx_buf_write_index # current size of the tx buffer
uint16 rx_buf_read_index # the rx buffer is parsed up to that index
uint16 rx_buf_end_index # current size of the rx buffer
uint16 failed_sbd_sessions # number of failed sbd sessions
uint16 successful_sbd_sessions # number of successfull sbd sessions
uint16 successful_sbd_sessions # number of successful sbd sessions
uint16 num_tx_buf_reset # number of times the tx buffer was reset
uint8 signal_quality # current signal quality, 0 is no signal, 5 the best
uint8 state # current state of the driver, see the satcom_state of IridiumSBD.h for the definition
+1 -1
View File
@@ -24,7 +24,7 @@ uint8 MODE_BLINK_FAST = 5
uint8 MODE_BREATHE = 6 # continuously increase & decrease brightness (solid color if driver does not support it)
uint8 MODE_FLASH = 7 # two fast blinks (on/off) with timing as in MODE_BLINK_FAST and then off for a while
uint8 MAX_PRIORITY = 2 # maxium priority (minimum is 0)
uint8 MAX_PRIORITY = 2 # maximum priority (minimum is 0)
uint8 led_mask # bitmask which LED(s) to control, set to 0xff for all
+14 -7
View File
@@ -1,9 +1,16 @@
uint64 timestamp # time since system start (microseconds)
uint64 timestamp # [us] time since system start
float32 lateral_touchdown_offset # [m] lateral touchdown position offset manually commanded during landing
bool flaring # true if the aircraft is flaring
float32 horizontal_slope_displacement
# abort status is:
# 0 if not aborted
# >0 if aborted, with the singular abort criterion which triggered the landing abort enumerated by the following abort reasons
uint8 abort_status
float32 slope_angle_rad
float32 flare_length
bool abort_landing # true if landing should be aborted
# abort reasons
# after the manual operator abort, corresponds to individual bits of param FW_LND_ABORT
uint8 NOT_ABORTED = 0
uint8 ABORTED_BY_OPERATOR = 1
uint8 TERRAIN_NOT_FOUND = 2 # FW_LND_ABORT (1 << 0)
uint8 TERRAIN_TIMEOUT = 3 # FW_LND_ABORT (1 << 1)
uint8 UNKNOWN_ABORT_CRITERION = 4
+1 -1
View File
@@ -1,4 +1,4 @@
uint64 timestamp # time since system start (microseconds)
float32 indicated_frequency_rpm # indicated rotor Frequency in Revolution per minute
float32 estimated_accurancy_rpm # estimated accurancy in Revolution per minute
float32 estimated_accurancy_rpm # estimated accuracy in Revolution per minute
+3
View File
@@ -46,4 +46,7 @@ float32 heading # heading angle of XYZ body frame rel to NED. Set to NaN if no
float32 heading_offset # heading offset of dual antenna array in body frame. Set to NaN if not applicable. (rad, [-PI, PI])
float32 heading_accuracy # heading accuracy (rad, [0, 2PI])
float32 rtcm_injection_rate # RTCM message injection rate Hz
uint8 selected_rtcm_instance # uorb instance that is being used for RTCM corrections
# TOPICS sensor_gps vehicle_gps_position
+1 -1
View File
@@ -3,6 +3,6 @@ uint64 timestamp_sample
uint32 device_id # unique device ID for the sensor that does not change between power cycles
float32 temperature # Temperature provided by sensor (Celcius)
float32 temperature # Temperature provided by sensor (Celsius)
float32 humidity # Humidity provided by sensor
+2 -2
View File
@@ -1,4 +1,4 @@
# Status of the takeoff state machine currently just availble for multicopters
# Status of the takeoff state machine currently just available for multicopters
uint64 timestamp # time since system start (microseconds)
@@ -11,4 +11,4 @@ uint8 TAKEOFF_STATE_FLIGHT = 5
uint8 takeoff_state
float32 tilt_limit # limited tilt feasability during takeoff, contains maximum tilt otherwise
float32 tilt_limit # limited tilt feasibility during takeoff, contains maximum tilt otherwise
@@ -253,10 +253,14 @@ void micrortps_start_topics(const uint32_t &datarate, struct timespec &begin, ui
while (!_should_exit_task) {
@[if recv_topics]@
while (0 < (read = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
read = transport_node->read();
if (read > 0) {
total_rcvd += read;
rx_last_sec_read += read;
}
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
uint64_t read_time = hrt_absolute_time();
switch (topic_ID) {
+6 -2
View File
@@ -364,10 +364,14 @@ int main(int argc, char **argv)
if (!receiving) { start = std::chrono::steady_clock::now(); }
// Publish messages received from UART
if (0 < (length = transport_node->read(&topic_ID, data_buffer, BUFFER_SIZE))) {
length = transport_node->read();
if (length > 0) {
total_read += length;
}
while (transport_node->parse(&topic_ID, data_buffer, BUFFER_SIZE)) {
topics->publish(topic_ID, data_buffer, sizeof(data_buffer));
++received;
total_read += length;
receiving = true;
end = std::chrono::steady_clock::now();
}
+118 -78
View File
@@ -113,14 +113,8 @@ uint16_t Transport_node::crc16(uint8_t const *buffer, size_t len)
return crc;
}
ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer_len)
ssize_t Transport_node::read()
{
if (nullptr == out_buffer || nullptr == topic_id || !fds_OK()) {
return -1;
}
*topic_id = 255;
ssize_t len = node_read((void *)(_rx_buffer + _rx_buff_pos), sizeof(_rx_buffer) - _rx_buff_pos);
if (len < 0) {
@@ -143,85 +137,141 @@ ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer
_rx_buff_pos += len;
// We read some
size_t header_size = sizeof(struct Header);
return len;
}
// but not enough
if (_rx_buff_pos < header_size) {
return 0;
#ifndef PX4_DEBUG
void Transport_node::print_buffer_debug()
{
for (uint32_t i = 0; i < BUFFER_SIZE; ++i) {
if (i >= _rx_buff_pos) {
printf(".");
continue;
}
printf("%" PRIi8, _rx_buffer[i]);
if (_rx_buffer[i] == '>') {
printf("(X)");
}
printf(" ");
}
uint32_t msg_start_pos = 0;
printf("\n_rx_buff_pos: %" PRIu32 "\n", _rx_buff_pos);
}
for (msg_start_pos = 0; msg_start_pos <= _rx_buff_pos - header_size; ++msg_start_pos) {
if ('>' == _rx_buffer[msg_start_pos] && memcmp(_rx_buffer + msg_start_pos, ">>>", 3) == 0) {
#endif /* PX4_DEBUG */
bool Transport_node::parse(
uint8_t *topic_id, char out_buffer[], size_t buffer_len)
{
if (nullptr == out_buffer || nullptr == topic_id || !fds_OK()) {
return false;
}
*topic_id = 255;
static constexpr size_t header_size = sizeof(struct Header);
// No need to look for a message if not even a header fits into the buffer.
if (_rx_buff_pos < header_size) {
return false;
}
// Try to find the start of a message using the magic start sequence of '>>>'.
int32_t msg_start_pos = -1;
for (uint32_t i = 0; i <= _rx_buff_pos; ++i) {
if ('>' == _rx_buffer[i] && memcmp(_rx_buffer + i, ">>>", 3) == 0) {
msg_start_pos = i;
break;
}
}
// Start not found
if (msg_start_pos > (_rx_buff_pos - header_size)) {
auto DropDataBeforeIndex = [&](uint32_t index) {
if (index == 0) {
return;
}
if (index > _rx_buff_pos) {
index = _rx_buff_pos;
#ifndef PX4_DEBUG
if (_debug) { printf("\033[1;33m[ micrortps_transport ]\t (↓↓ %" PRIu32 ")\033[0m\n", msg_start_pos); }
if (_debug) { printf("\033[0;31m[ micrortps_transport ]\t clamped index from %" PRIu32 " to %" PRIu32 "\033[0m\n", index, _rx_buff_pos); }
#else
if (_debug) { PX4_DEBUG(" (↓↓ %" PRIu32 ")", msg_start_pos); }
if (_debug) { PX4_ERR("ERROR: clamped index from %" PRIu32 " to %" PRIu32 "\n", index, _rx_buff_pos); }
#endif /* PX4_DEBUG */
}
// All we've checked so far is garbage, drop it - but save unchecked bytes
memmove(_rx_buffer, _rx_buffer + msg_start_pos, _rx_buff_pos - msg_start_pos);
_rx_buff_pos -= msg_start_pos;
return -1;
memmove(_rx_buffer, _rx_buffer + index, _rx_buff_pos - index);
_rx_buff_pos -= index;
};
// No start sequence has been found in the buffer. We can drop all data up to
// 2 characters before the end (to account for a non-complete start sequence).
if (msg_start_pos == -1) {
// Note, _rx_buff_pos should always be larger than 2 as we enforce a min.
// buffer content corresponding to a header length some lines above.
int32_t drop_before_idx = _rx_buff_pos - 2;
DropDataBeforeIndex(drop_before_idx);
return false;
}
// [>,>,>,topic_id,sys_id,seq,payload_length_H,payload_length_L,CRCHigh,CRCLow,payloadStart, ... ,payloadEnd]
struct Header *header = (struct Header *)&_rx_buffer[msg_start_pos];
uint32_t payload_len = ((uint32_t)header->payload_len_h << 8) | header->payload_len_l;
// A start sequence has been found. We can drop everything before this index
// in the buffer. This could happen at the startup when syncing to the
// stream or with noise on the data stream.
DropDataBeforeIndex(msg_start_pos);
// We have found a start sequence. Let's check if the header is in the buffer.
// [>,>,>,topic_id,sys_id,seq,payload_length_H,payload_length_L,CRCHigh,CRCLow,payloadStart,
// ... ,payloadEnd]
if (header_size > _rx_buff_pos) {
// Header not yet in the buffer.
return false;
}
struct Header *header = (struct Header *)&_rx_buffer[0];
uint32_t payload_len =
((uint32_t)header->payload_len_h << 8) | header->payload_len_l;
// The message won't fit the output or processing buffer. This could happen
// with a corrupted header or by an actual message that is too large for our
// buffers. Let's drop it.
uint32_t message_length = header_size + payload_len;
if (message_length > buffer_len || (message_length + 3) > BUFFER_SIZE) {
DropDataBeforeIndex(3 + header_size);
return false;
}
// Let's check if all payload data according to the message length in the
// header is already in the buffer.
if ((header_size + payload_len) > _rx_buff_pos) {
// The buffer does not yet contain the full message. We need to wait for
// more data.
return false;
}
// The received message comes from this system. Discard it.
// This might happen when:
// 1. The same UDP port is being used to send a rcv packets or
// 2. The same topic on the agent is being used for outgoing and incoming data
// 2. The same topic on the agent is being used for outgoing and incoming
// data
if (header->sys_id == _sys_id) {
// Drop the message and continue with the read buffer
memmove(_rx_buffer, _rx_buffer + msg_start_pos + 1, _rx_buff_pos - (msg_start_pos + 1));
_rx_buff_pos -= (msg_start_pos + 1);
return -1;
}
// The message won't fit the buffer.
if (buffer_len < header_size + payload_len) {
// Drop the message and continue with the read buffer
memmove(_rx_buffer, _rx_buffer + msg_start_pos + 1, _rx_buff_pos - (msg_start_pos + 1));
_rx_buff_pos -= (msg_start_pos + 1);
return -EMSGSIZE;
}
// We do not have a complete message yet
if (msg_start_pos + header_size + payload_len > _rx_buff_pos) {
// If there's garbage at the beginning, drop it
if (msg_start_pos > 0) {
#ifndef PX4_DEBUG
if (_debug) { printf("\033[1;33m[ micrortps_transport ]\t (↓ %" PRIu32 ")\033[0m\n", msg_start_pos); }
#else
if (_debug) { PX4_DEBUG(" (↓ %" PRIu32 ")", msg_start_pos); }
#endif /* PX4_DEBUG */
memmove(_rx_buffer, _rx_buffer + msg_start_pos, _rx_buff_pos - msg_start_pos);
_rx_buff_pos -= msg_start_pos;
}
return 0;
DropDataBeforeIndex(3);
return false;
}
// Check the CRC of the message.
uint16_t read_crc = ((uint16_t)header->crc_h << 8) | header->crc_l;
uint16_t calc_crc = crc16((uint8_t *)_rx_buffer + msg_start_pos + header_size, payload_len);
uint16_t calc_crc = crc16((uint8_t *)_rx_buffer + header_size, payload_len);
if (read_crc != calc_crc) {
#ifndef PX4_DEBUG
@@ -234,26 +284,16 @@ ssize_t Transport_node::read(uint8_t *topic_id, char out_buffer[], size_t buffer
#endif /* PX4_DEBUG */
// Drop garbage up just beyond the start of the message
memmove(_rx_buffer, _rx_buffer + (msg_start_pos + 1), _rx_buff_pos);
// If there is a CRC error, the payload len cannot be trusted
_rx_buff_pos -= (msg_start_pos + 1);
len = -1;
} else {
// copy message to outbuffer and set other return values
memmove(out_buffer, _rx_buffer + msg_start_pos + header_size, payload_len);
*topic_id = header->topic_id;
len = payload_len + header_size;
// discard message from _rx_buffer
_rx_buff_pos -= msg_start_pos + header_size + payload_len;
memmove(_rx_buffer, _rx_buffer + msg_start_pos + header_size + payload_len, _rx_buff_pos);
DropDataBeforeIndex(3);
return false;
}
return len;
// Copy message to output buffer and drop it from the buffer.
memmove(out_buffer, _rx_buffer + header_size, payload_len);
*topic_id = header->topic_id;
DropDataBeforeIndex(header_size + payload_len);
return true;
}
size_t Transport_node::get_header_length()
+7 -1
View File
@@ -56,7 +56,9 @@ public:
virtual int init() {return 0;}
virtual uint8_t close() {return 0;}
ssize_t read(uint8_t *topic_id, char out_buffer[], size_t buffer_len);
ssize_t read();
bool parse(uint8_t *topic_id, char out_buffer[], size_t buffer_len);
/**
* write a buffer
@@ -76,6 +78,10 @@ public:
size_t get_header_length();
private:
#ifndef PX4_DEBUG
void print_buffer_debug();
#endif /* PX4_DEBUG */
struct __attribute__((packed)) Header {
char marker[3];
uint8_t topic_id;
+1 -1
View File
@@ -413,7 +413,7 @@ def convert_dir(format_idx, inputdir, outputdir, package, templatedir):
def copy_changed(inputdir, outputdir, prefix='', quiet=False):
"""
Copies files from inputdir to outputdir if they don't exist in
ouputdir or if their content changed
outputdir or if their content changed
"""
# Make sure output directory exists:
+2 -2
View File
@@ -8,8 +8,8 @@ uint32 sessionid # UWB SessionID
uint32 time_offset # Time between Ranging Rounds in ms
uint16 status # status feedback #
uint16[12] anchor_distance # distance in cm to each UWB Anchor (UWB Device wich takes part in Ranging)
uint16[12] anchor_distance # distance in cm to each UWB Anchor (UWB Device which takes part in Ranging)
bool[12] nlos # Visual line of sight yes/no
float32[12] aoafirst # Angle of arrival of first incomming RX msg
float32[12] aoafirst # Angle of arrival of first incoming RX msg
float32[3] position # Position of the Landing point in relation to the Drone (x,y,z in Meters NED)
+1 -1
View File
@@ -99,7 +99,7 @@ uint16 VEHICLE_CMD_FIXED_MAG_CAL_YAW = 42006 # Magnetometer calibrati
# PX4 vehicle commands (beyond 16 bit mavlink commands)
uint32 VEHICLE_CMD_PX4_INTERNAL_START = 65537 # start of PX4 internal only vehicle commands (> UINT16_MAX)
uint32 VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN = 100000 # Sets the GPS co-ordinates of the vehicle local origin (0,0,0) position. |Empty|Empty|Empty|Empty|Latitude|Longitude|Altitude|
uint32 VEHICLE_CMD_SET_GPS_GLOBAL_ORIGIN = 100000 # Sets the GPS coordinates of the vehicle local origin (0,0,0) position. |Empty|Empty|Empty|Empty|Latitude|Longitude|Altitude|
uint8 VEHICLE_MOUNT_MODE_RETRACT = 0 # Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization |
uint8 VEHICLE_MOUNT_MODE_NEUTRAL = 1 # Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory. |
+2
View File
@@ -64,6 +64,8 @@ float32 epv # Standard deviation of vertical position error, (metres)
float32 evh # Standard deviation of horizontal velocity error, (metres/sec)
float32 evv # Standard deviation of horizontal velocity error, (metres/sec)
bool dead_reckoning # True if this position is estimated through dead-reckoning
# estimator specified vehicle limits
float32 vxy_max # maximum horizontal speed - set to 0 when limiting not required (meters/sec)
float32 vz_max # maximum vertical speed - set to 0 when limiting not required (meters/sec)
+1 -1
View File
@@ -32,7 +32,7 @@ float32 y # East position
float32 z # Down position
# Orientation quaternion. First value NaN if invalid/unknown
float32[4] q # Quaternion rotation from FRD body frame to refernce frame
float32[4] q # Quaternion rotation from FRD body frame to reference frame
float32[4] q_offset # Quaternion rotation from odometry reference frame to navigation frame
# Row-major representation of 6x6 pose cross-covariance matrix URT.
+4 -3
View File
@@ -1,8 +1,9 @@
uint64 timestamp # time since system start (microseconds)
float32 roll # body angular rates in NED frame
float32 pitch # body angular rates in NED frame
float32 yaw # body angular rates in NED frame
# body angular rates in NED frame
float32 roll # [rad/s] roll rate setpoint
float32 pitch # [rad/s] pitch rate setpoint
float32 yaw # [rad/s] yaw rate setpoint
# For clarification: For multicopters thrust_body[0] and thrust[1] are usually 0 and thrust[2] is the negative throttle demand.
# For fixed wings thrust_x is the throttle demand and thrust_y, thrust_z will usually be zero.
-1
View File
@@ -29,7 +29,6 @@ bool circuit_breaker_engaged_power_check
bool circuit_breaker_engaged_airspd_check
bool circuit_breaker_flight_termination_disabled
bool circuit_breaker_engaged_usb_check
bool circuit_breaker_engaged_posfailure_check # set to true when the position valid checks have been disabled
bool circuit_breaker_vtol_fw_arming_check # set to true if for VTOLs arming in fixed-wing mode should be allowed
bool offboard_control_signal_lost
@@ -854,7 +854,7 @@ __EXPORT void board_get_uuid32(uuid_uint32_t uuid_words); // DEPRICATED use boar
*
* Input Parameters:
* format_buffer - A pointer to a bufferer of at least PX4_CPU_UUID_WORD32_FORMAT_SIZE
* that will contain a 0 terminated string formated as described
* that will contain a 0 terminated string formatted as described
* the format string and optional separator.
* size - The size of the buffer (should be atleaset PX4_CPU_UUID_WORD32_FORMAT_SIZE)
* format - The fort mat specifier for the hex digit see CPU_UUID_FORMAT
@@ -870,7 +870,7 @@ __EXPORT void board_get_uuid32(uuid_uint32_t uuid_words); // DEPRICATED use boar
* 3238333641203833355110
*
* Returned Value:
* The format buffer is populated with a 0 terminated string formated as described.
* The format buffer is populated with a 0 terminated string formatted as described.
* Zero (OK) is returned on success;
*
************************************************************************************/
@@ -907,7 +907,7 @@ int board_get_mfguid(mfguid_t mfgid);
*
* Input Parameters:
* format_buffer - A pointer to a bufferer of at least PX4_CPU_MFGUID_FORMAT_SIZE
* that will contain a 0 terminated string formated as 0 prefixed
* that will contain a 0 terminated string formatted as 0 prefixed
* lowercase hex. 2 charaters per digit of the mfguid_t.
*
* Returned Value:
@@ -964,7 +964,7 @@ int board_get_px4_guid(px4_guid_t guid);
* manufactures Unique ID or define BOARD_OVERRIDE_PX4_GUID
*
* Input Parameters:
* format_buffer - A buffer to receive the 0 terminated formated px4
* format_buffer - A buffer to receive the 0 terminated formatted px4
* guid string.
* size - Size of the buffer provided. Normally this would
* be PX4_GUID_FORMAT_SIZE.
@@ -33,7 +33,7 @@
/**
* @file log.h
* Platform dependant logging/debug implementation
* Platform dependent logging/debug implementation
*/
#pragma once
@@ -38,10 +38,10 @@
* and hardfault log support
*/
#ifdef CONFIG_BOARD_CRASHDUMP
#include <board_config.h>
#ifdef CONFIG_BOARD_CRASHDUMP
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
@@ -31,6 +31,8 @@
*
****************************************************************************/
#include <board_config.h>
#if defined(CONFIG_SYSTEM_CDCACM)
__BEGIN_DECLS
#include <arch/board/board.h>
@@ -41,6 +41,4 @@ size_t px4_get_secure_random(uint8_t *out,
arc4random_buf(out, outlen);
return outlen;
}
#else
#error CONFIG_CRYPTO_RANDOM_POOL has to be defined
#endif
@@ -40,3 +40,4 @@ add_subdirectory(../s32k1xx/hrt hrt)
add_subdirectory(../s32k1xx/io_pins io_pins)
add_subdirectory(../s32k1xx/tone_alarm tone_alarm)
add_subdirectory(../s32k1xx/version version)
add_subdirectory(../s32k1xx/watchdog watchdog)
@@ -39,6 +39,7 @@
*/
#include <px4_platform_common/px4_config.h>
#include <systemlib/px4_macros.h>
#include <errno.h>
#include <nuttx/board.h>
#include <hardware/s32k1xx_rcm.h>
@@ -53,6 +54,26 @@ static int board_reset_enter_bootloader()
return OK;
}
static const uint32_t modes[] = {
/* to tb */
/* BOARD_RESET_MODE_CLEAR 5 y */ 0,
/* BOARD_RESET_MODE_BOOT_TO_BL 0 n */ 0xb007b007,
/* BOARD_RESET_MODE_BOOT_TO_VALID_APP 0 y */ 0xb0070002,
/* BOARD_RESET_MODE_CAN_BL 10 n */ 0xb0080000,
/* BOARD_RESET_MODE_RTC_BOOT_FWOK 0 n */ 0xb0093a26
};
int board_configure_reset(reset_mode_e mode, uint32_t arg)
{
int rv = -1;
if (mode < arraySize(modes)) {
//FIXME implemented this
}
return rv;
}
/****************************************************************************
* Name: board_reset
*
@@ -32,6 +32,8 @@
****************************************************************************/
#pragma once
#include <board_config.h>
#if defined(CONFIG_SPI)
#include "../../../stm32_common/include/px4_arch/spi_hw_description.h"
+1
View File
@@ -394,6 +394,7 @@ if(ENABLE_LOCKSTEP_SCHEDULER STREQUAL "no")
rascal
rascal-electric
tf-g1
tf-g2
tf-r1
)
set(all_posix_vmd_make_targets)
@@ -39,6 +39,7 @@
#include <memory>
#include <atomic>
#include <pthread.h>
#include <unistd.h>
#include "lockstep_components.h"
+1 -1
View File
@@ -541,7 +541,7 @@ int run_startup_script(const std::string &commands_file, const std::string &abso
void wait_to_exit()
{
while (!_exit_requested) {
// needs to be a regular sleep not dependant on lockstep (not px4_usleep)
// needs to be a regular sleep not dependent on lockstep (not px4_usleep)
usleep(100000);
}
}
+9 -3
View File
@@ -39,8 +39,9 @@
#include <nuttx/ioexpander/gpio.h>
#endif
ADC::ADC(uint32_t base_address, uint32_t channels) :
ADC::ADC(uint32_t base_address, uint32_t channels, bool publish_adc_report) :
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::hp_default),
_publish_adc_report(publish_adc_report),
_sample_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": sample")),
_base_address(base_address)
{
@@ -116,7 +117,10 @@ void ADC::Run()
_samples[i].am_data = sample(_samples[i].am_channel);
}
update_adc_report(now);
if (_publish_adc_report) {
update_adc_report(now);
}
update_system_power(now);
}
@@ -352,7 +356,8 @@ int ADC::custom_command(int argc, char *argv[])
int ADC::task_spawn(int argc, char *argv[])
{
ADC *instance = new ADC(SYSTEM_ADC_BASE, ADC_CHANNELS);
bool publish_adc_report = !(argc >= 2 && strcmp(argv[1], "-n") == 0);
ADC *instance = new ADC(SYSTEM_ADC_BASE, ADC_CHANNELS, publish_adc_report);
if (instance) {
_object.store(instance);
@@ -389,6 +394,7 @@ ADC driver.
PRINT_MODULE_USAGE_NAME("adc", "driver");
PRINT_MODULE_USAGE_COMMAND("start");
PRINT_MODULE_USAGE_COMMAND("test");
PRINT_MODULE_USAGE_PARAM_FLAG('n', "Do not publish ADC report, only system power", true);
PRINT_MODULE_USAGE_DEFAULT_COMMANDS();
return 0;
+4 -1
View File
@@ -64,7 +64,7 @@ using namespace time_literals;
class ADC : public ModuleBase<ADC>, public px4::ScheduledWorkItem
{
public:
ADC(uint32_t base_address = SYSTEM_ADC_BASE, uint32_t channels = ADC_CHANNELS);
ADC(uint32_t base_address = SYSTEM_ADC_BASE, uint32_t channels = ADC_CHANNELS, bool publish_adc_report = true);
~ADC() override;
@@ -102,6 +102,8 @@ private:
static const hrt_abstime kINTERVAL{10_ms}; /**< 100Hz base rate */
const bool _publish_adc_report;
perf_counter_t _sample_perf;
unsigned _channel_count{0};
@@ -110,6 +112,7 @@ private:
uORB::Publication<adc_report_s> _to_adc_report{ORB_ID(adc_report)};
uORB::Publication<system_power_s> _to_system_power{ORB_ID(system_power)};
#ifdef BOARD_GPIO_VDD_5V_COMP_VALID
int _5v_comp_valid_fd {-1};
#endif
+1 -1
View File
@@ -523,7 +523,7 @@ $ batt_smbus -X write_flash 19069 2 27 0
PRINT_MODULE_USAGE_COMMAND_DESCR("man_info", "Prints manufacturer info.");
PRINT_MODULE_USAGE_COMMAND_DESCR("unseal", "Unseals the devices flash memory to enable write_flash commands.");
PRINT_MODULE_USAGE_COMMAND_DESCR("seal", "Seals the devices flash memory to disbale write_flash commands.");
PRINT_MODULE_USAGE_COMMAND_DESCR("seal", "Seals the devices flash memory to disable write_flash commands.");
PRINT_MODULE_USAGE_COMMAND_DESCR("suspend", "Suspends the driver from rescheduling the cycle.");
PRINT_MODULE_USAGE_COMMAND_DESCR("resume", "Resumes the driver from suspension.");
@@ -35,7 +35,7 @@
* @file camera_trigger.cpp
*
* External camera-IMU synchronisation and triggering, and support for
* camera manipulation using PWM signals over FMU auxillary pins.
* camera manipulation using PWM signals over FMU auxiliary pins.
*
* @author Mohammed Kabir <kabir@uasys.io>
* @author Kelly Steich <kelly.steich@wingtra.com>
+2 -2
View File
@@ -41,7 +41,7 @@
* @reboot_required true
* @group Cyphal
*/
PARAM_DEFINE_INT32(CYPHAL_ENABLE, 0);
PARAM_DEFINE_INT32(CYPHAL_ENABLE, 1);
/**
* Cyphal Node ID.
@@ -123,7 +123,7 @@ PARAM_DEFINE_INT32(UCAN1_BMS_BS_SUB, -1);
PARAM_DEFINE_INT32(UCAN1_BMS_BP_SUB, -1);
/**
* Cyphal leagcy battery port ID.
* Cyphal legacy battery port ID.
*
* @min -1
* @max 6143
@@ -54,7 +54,7 @@
#include "api/argus_def.h"
/*!***************************************************************************
* @brief A printf-like function to print formated data to an debugging interface.
* @brief A printf-like function to print formatted data to an debugging interface.
*
* @details Writes the C string pointed by fmt_t to an output. If format
* includes format specifiers (subsequences beginning with %), the
@@ -482,10 +482,12 @@ int PGA460::print_usage(const char *reason)
PRINT_MODULE_DESCRIPTION(
R"DESCR_STR(
### Description
Ultrasonic range finder driver that handles the communication with the device and publishes the distance via uORB.
### Implementation
This driver is implented as a NuttX task. This Implementation was chosen due to the need for polling on a message
This driver is implemented as a NuttX task. This Implementation was chosen due to the need for polling on a message
via UART, which is not supported in the work_queue. This driver continuously takes range measurements while it is
running. A simple algorithm to detect false readings is implemented at the driver levelin an attemptto improve
the quality of data that is being published. The driver will not publish data at all if it deems the sensor data
+2 -2
View File
@@ -286,7 +286,7 @@ public:
int read_eeprom();
/**
* @brief Writes the user defined paramaters to device EEPROM.
* @brief Writes the user defined parameters to device EEPROM.
* @return Returns true if the EEPROM was successfully written to.
*/
int write_eeprom();
@@ -341,7 +341,7 @@ private:
int initialize_device_settings();
/**
* @brief Writes the user defined paramaters to device register map.
* @brief Writes the user defined parameters to device register map.
* @return Returns true if the thresholds were successfully written.
*/
int initialize_thresholds();
@@ -71,7 +71,7 @@ using namespace time_literals;
/**
* Assume standard deviation to be equal to sensor resolution.
* Static bench tests have shown that the sensor ouput does
* Static bench tests have shown that the sensor output does
* not vary if the unit is not moved.
*/
#define SENS_VARIANCE 0.045f * 0.045f

Some files were not shown because too many files have changed in this diff Show More