20635 Commits

Author SHA1 Message Date
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
Beat Küng
73bd90ddd5 crazyflie: fix PWM channel ordering
Channels belonging to a certain timer were not all grouped together.
This is required by the .first_channel_index and .last_channel_index data
members.

We introduce a new mixer geometry to solve the problem.
2020-02-13 03:49:16 -08:00
bresch
17ab617877 ecl update: contains important fixes for accel bias instabilities 2020-02-12 22:34:17 +01:00
Daniel Agar
8cdbc4c593 px4iofirmware: add PX4IO_PERF define to completely disable perf counters 2020-02-10 09:40:39 +01:00
Daniel Agar
2015cc2b39 logger: restore buffer statistics update
- this was accidentally dropped during a rebase of #14050
2020-02-10 00:17:28 -05:00
Daniel Agar
8df22541ef
sensors: filter sample rate calculate with simple interval average instead of perf count
- the perf counter intervals aren't numerically stable over extended periods (https://github.com/PX4/Firmware/pull/14046)
2020-02-07 13:04:02 -05:00
Silvan Fuhrer
a3710fcdef VTOL: flight task auto: disable weather vane when not stationary
Use yawrate setpoint from weather vane only if velocity setpoint is small
(smaller than half the cruise velocity)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:46:29 +01:00
Silvan Fuhrer
98aee29ddc VTOL: Manual Pos Flight Task: do not use yawrate sp from weather vane if position isn't locked
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:46:29 +01:00
Silvan Fuhrer
9ba0d5b706 tiltrotor tilt support: fix thrust compensation constraining
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:43:44 +01:00
Silvan Fuhrer
4c9dba8692 VTOL type and tiltrotor: use math::constrain() for constraining
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:43:44 +01:00
Silvan Fuhrer
e3310796ce tiltrotor: limmit the adapted thrust for tilt to [0,1]
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:43:44 +01:00
Silvan Fuhrer
a26e914ef4 VTOL pusher/tilt support: addressed review comments:
- remove gloabl variable and instead give back forward_thrust from function
 - give back increased vertical thrust from fct thrust_compensation_for_tilt()

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:43:44 +01:00
Silvan Fuhrer
5ae4ca8ff1 VTOL: Make pusher assist generic to enable also for tiltrotor
-move pusher assist functionality into vtol_type class and adapt it to also
work for tiltrotor VTOLs (pitch rotors down to accelerate forward)
-for tiltrotor: compensate for lost lift due to tilt by increasing the throttle
-enable pusher / tiltassist also in altitude mode

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2020-02-07 16:43:44 +01:00
bresch
7ca13a67b3 ZeroOrderHoverThrustEstimatorTest: add hover thrust jump test case
This is done to test the recovery function of the estimator in case
of divergence or sudden extreme hover thrust change.

Also specify seed of random generator
2020-02-07 11:52:52 +01:00