20648 Commits

Author SHA1 Message Date
Florian Achermann
be35f5555c Add comment to explain iridium exception in the mavlink module 2020-02-28 07:54:25 +01:00
Florian Achermann
eb215358fc Fix crashing for the mavlink in the iridium mode
Special handling in the mavlink_open_uart function if mavlink is in the iridium mode.
2020-02-28 07:54:25 +01:00
Daniel Agar
d7e502ec72 uORB_tests increase stack 2020-02-27 21:12:49 +01:00
Matthias Grob
f90d3671c0 vehicle_attitude_setpoint: get rid of unused q_d_valid flag 2020-02-27 09:17:52 +01:00
Julian Oes
b53bd2b77f LPE: make compatible with lockstep simulation
This fixes SITL with lockstep when using LPE and q estimator.

The required changes are:
- Publish ekf2_timestamps because simulator_mavlink expects them.
- Run LPE at 250 Hz instead of 80 Hz in order to keep everything in
  lockstep running at 250 Hz.
2020-02-26 15:46:58 +01:00
Julian Oes
3be8b3d177 logger: style fix 2020-02-26 14:52:39 +01:00
Julian Kent
18754225c9 Update matrix library 2020-02-26 10:27:32 +01:00
Matthias Grob
46f76cb621 Commander: enable RC override in takeoff
and remaining auto modes which are used more rarely.
2020-02-26 10:22:33 +01:00
Paul Riseborough
d9ae242760 logger: fix unused variable build error 2020-02-26 18:44:20 +11:00
Daniel Agar
2a0fe169e6 logger: disable logger_status publiation in replay builds
- this is disabled in replay builds to ensure all data in ekf2 replay logs only contains the same time range, otherwise the plots can be unreadable using common tools
 - fixes #14230
2020-02-26 18:44:20 +11:00
CarlOlsson
7e00dcd382 EKF2: Fix GPS blending time jitter 2020-02-26 07:39:47 +01:00
Martina Rivizzigno
abe33af5b3 map mavlink orientation enum to uorb distance_sensor orientation 2020-02-26 07:27:09 +01:00
Beat Küng
d386591d0c logger: reduce rate_ctrl_status rate to 50 Hz for high-rate logging
The integral does not need to be logged at full rate
2020-02-25 09:59:52 +01:00
Julian Oes
f3fefd7d93
mavlink: support mission transfer cancellation (#14139)
This adds support for MAV_MISSION_OPERATION_CANCELLED which can be used
to cancel an ongoing upload or download of mission/geofence/rally items.
2020-02-24 07:47:08 +01:00
Silvan Fuhrer
6c8f39c5d8
MC rate controller: limit K and P values of PID controller to in pitch and roll (#14210) 2020-02-23 11:45:07 +01:00
Daniel Agar
af6213e85e invensense icm20689 improvements and fixes
- refactor Run() into simple state machine
 - perform reset and configuration in sensor bus thread
 - when using data ready interrupt skip checking FIFO count
 - fix periodic temperature sampling (rate limit to 1 Hz)
2020-02-22 12:15:52 -05:00
Daniel Agar
5ab4cf3d62 invensense mpu9250 improvements and fixes
- refactor Run() into simple state machine
 - perform reset and configuration in sensor bus thread
 - when using data ready interrupt skip checking FIFO count
 - fix periodic temperature sampling (rate limit to 1 Hz)
2020-02-22 12:15:52 -05:00
Daniel Agar
4bd665d169 invensense icm20608g improvements and fixes
- refactor Run() into simple state machine
 - perform reset and configuration in sensor bus thread
 - when using data ready interrupt skip checking FIFO count
 - fix periodic temperature sampling (rate limit to 1 Hz)
2020-02-22 12:15:52 -05:00
Daniel Agar
afc59f843c invensense icm20602 improvements
- refactor Run() into simple state machine
 - perform reset and configuration in sensor bus thread
 - when using data ready interrupt skip checking FIFO count
2020-02-22 12:15:52 -05:00
Beat Küng
0c6d558c50 bmp388: fix double free in case the driver probing fails
'interface' is freed in BMP388's destructor.
2020-02-22 10:51:42 -05:00
Beat Küng
c5a0d9077b bmp388: remove dead code 2020-02-22 10:51:42 -05:00
Timothy Scott
4c1adc088f Removed all swapping of uORB instances 2020-02-21 22:38:26 -08:00
Timothy Scott
6452b7e014 Changed commander to check every battery publication for prearm checks 2020-02-21 22:38:26 -08:00
SalimTerryLi
77a9135036
ADC driver report back vref alone with sample count (#14136)
* Introduce "px4_arch_adc_reference_v"

* Revert "Introduce "px4_arch_adc_reference_v""

This reverts commit 93691fbbd55a1b8da8c190e225b318067d90399b.

* use structure to return sample count and vref at the same time

* Revert "use structure to return sample count and vref at the same time"

This reverts commit 9cfd1c173cda51495f766a3f678c2202d67725fd.

* Revert "Revert "Introduce "px4_arch_adc_reference_v"""

This reverts commit edb7f7603e4471163ffb0fc6fc62ad2e30336e91.

* fix missed reference

* remove unecessary channel specific vref

* Update src/drivers/drv_adc.h

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

* Update src/drivers/drv_adc.h

Co-Authored-By: David Sidrane <David.Sidrane@Nscdg.com>

* Introduce BOARD_ADC_POS_REF_V

Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
2020-02-21 06:52:45 -08:00
Morten Fyhn Amundsen
0ac300f77a Rename generate virtual RC setter/getter
The old names were unclear to me, especially when
used in the mavlink_receiver.
2020-02-21 09:23:35 +01:00
Matthias Grob
1d89351149 Commander: clarify the rc override message
Message says novice understanable what happened.
2020-02-20 17:25:53 +01:00
Beat Küng
116a094e31 commander: fix broken 'commander arm/disarm' CLI
Regression from https://github.com/PX4/Firmware/pull/13613.

VEHICLE_CMD_COMPONENT_ARM_DISARM from CLI would enter the
ARMING_STATE_IN_AIR_RESTORE logic. This was never intended for disarming
(and leads to state machine transition failures), and IMO it is also not
intended for commands from CLI.
2020-02-20 10:06:07 -05:00
Julian Oes
20276d4ff8 simulator: improve misleading TCP message
Proposed first by @lovettchris.
2020-02-20 12:10:43 +01:00
Julian Oes
e46635b1de simulator: remove strange disarmed PWM
Before that we would send -0.1 instead of just 0.0.

First proposed by @lovettchris.
2020-02-20 12:10:43 +01:00
Julian Oes
a006d82abf simulator: add flag to indicate lockstep
This depends on:
https://github.com/mavlink/mavlink/pull/1311

First proposed by @lovettchris.
2020-02-20 12:10:43 +01:00
Beat Küng
ef1f677541 fix mavlink_log_handler: close file descriptor if still open in destructor 2020-02-20 10:31:41 +01:00
Julian Oes
e7c655ba52 rc_update: make specific RC loss check only on PPM
This makes the check more specific, so it's only active on PPM input.
2020-02-20 09:02:30 +01:00
bozkurthan
3f16eba3f7 RC Failsafe fix for RFD 868+/900 Modems
RC Failsafe isn't triggered when PPM signal is valid. These changes
update Failsafe trigger logic for RC input. RF Modules keep sending
valid PPM signal when the RC Transmitter is lost.
RF Modules which are in the air send PPM signal with same type when lost
the signal from ground.
2020-02-20 09:02:30 +01:00
Nicolas de Palezieux
a570aa9fac Commander: fix preflight check condition to fail if not in HIL mode 2020-02-20 08:46:30 +01:00
Daniel Agar
ffc3373492
invensense icm20689 improvements
- checked register mechanism and simple watchdog
   - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
2020-02-19 19:01:41 -05:00
Daniel Agar
1d226ad2ca invensense icm20608g improvements
- checked register mechanism and simple watchdog
  - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
2020-02-18 22:48:32 -05:00
Daniel Agar
89d4d6e4a9 invensense mpu9250 improvements
- checked register mechanism and simple watchdog
    - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
2020-02-18 19:21:20 -05:00
Daniel Agar
22499effb9 invensense icm20602 improvements
- checked register mechanism and simple watchdog
    - driver checks for errors gradually and can reconfigure itself
 - respect IMU_GYRO_RATEMAX at the driver level
 - fixed sensor INT16_MIN and INT16_MAX handling (y & z axis are flipped before publishing)
 - increased sensor_gyro_fifo max size (enables running the driver much slower, but still transferring all raw data)
 - PX4Accelerometer/PX4Gyroscope remove unnecessary memsets
2020-02-18 19:21:20 -05:00
Julian Kent
e7aa899746 AutoLineSmoothVel: don't use _velocity_setpoint for constraints
Unfortunately the constraints cannot be implemented using the
_constraints because the controller uses that directly. This
causes discontinuities in the velocity and/or accel at various
points of the flight. In particular this was used in Takeoff.

Instead this was done by changing target accel/velocity in the
jerk-optimal velocity planner for Z.
2020-02-18 13:59:58 +01:00
Morten Fyhn Amundsen
86bf4b2289 FlightTaskManualAltitude: Fix sign error in terrain hold setpoint reset
The modified statements are intended to

1. Set a new Z position setpoint that is equivalent to the current distance
to ground setpoint,

and

2. Set a new distance to ground setpoint that is equivalent to the current Z
position setpoint.

They are only called in terrain hold mode, when activating/deactivating the
holding (typically when coming to a stop and when starting to move again).

The setpoints take the current control error into account, but because the
control error is added, not subtracted, the result is that the new setpoint
is 2 times the control error off from the old setpoint, instead of being
at the same spot as the old setpoint.
2020-02-17 15:18:04 +01:00
Daniel Agar
d7c3e1066a
uavcannode updates and px4_fmu-v4_cannode example
- drivers/uavcannode add baro, mag, gps publications
 - delete old px4_cannode-v1 board
 - add stripped down simple rcS for CAN nodes
2020-02-16 12:11:54 -05:00
Silvan Fuhrer
342e0da796 VTOL land detector: extend fall_detection from multicopter land detector and disable in fixed-wing mode
Extend the get_freefall_state() from MC land detector to have a VTOL-specific
one that just enables free fall detection if in rotary wing or transition mode.
This is done to prevent wrong free-fall detected warnings while doing low-G maneuvers
(parabolic flights). Land detection is anyway disabled in FW flight for VTOL so
no logic change.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-14 17:46:30 +03:00
Silvan Fuhrer
dad9c154a3 VTOL Land Detector: move to airspeed_validated
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-14 17:46:30 +03:00
Julian Oes
9a96ca14be Tools: make Python import error more readable
The problem with printing the exception was that starting with
Python 3.6 the ImportError is yet another (sub) exception called
ModuleNotFoundError which can't be printed as a string and then triggers
another exception:

```
Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 11, in <module>
    import jinja2
ModuleNotFoundError: No module named 'jinja2'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/julianoes/src/Firmware/Tools/serial/generate_config.py", line 13, in <module>
    print("Failed to import jinja2: " + e)
TypeError: must be str, not ModuleNotFoundError
```

As per @bkueng's suggestion the easiest is to cast the exception to str
and that way prevent the second exception.
2020-02-14 11:40:05 +01:00
Nuno Marques
7cafbc824e
simulator: add support for multi-distance_sensor instances (#14143)
* simulator: add support for multi-distance_sensor instances

* update submodule Tools/sitl_gazebo

* sitl_gazebo: add updated iris_obs_avoid; simulator: cleanup distance_sensor topic init

* update submodule Tools/sitl_gazebo

* simulator: delete _dist_pubs uORB::PublicationMulti<distance_sensor_s> in simulator destructor
2020-02-14 11:32:28 +01:00
Nico van Duijn
55372d7cbe Parameterize timeout for radio status 2020-02-13 08:52:27 -05:00
BazookaJoe1900
c78572b471
px4io: fix array regs[] size (#14135)
may cause memory override if _max_controls larger then _max_actuators
2020-02-13 13:01:12 +01:00
Beat Küng
5e3796324c px4io: fix argv index & avoid empty 'unknown argument: ' warning 2020-02-13 03:49:16 -08:00
Beat Küng
685be9b3d1 io pins: avoid using GPIO_GPIOx_OUTPUT, use timer_io_channels instead
The whole system now uses timer_io_channels, which will allow the redundant
GPIO_GPIOx_OUTPUT definitions to be removed.
2020-02-13 03:49:16 -08:00
Beat Küng
8020e82c1c MultirotorMixer: allow for longer mixer geometry names (16 instead of 8) 2020-02-13 03:49:16 -08:00