This fixes the battery failsafe for the following corner cases:
- Battery failsafe set to Return but we can't do RTL because we don't
have a global position or home position. In this case we now switch to
Land. Land might end up in Descend in the failsafe state machine
later.
- Battery failsafe set to Land but we can't land because we don't have a
local position. In this case we switch to land anyway and then fall
back to descend in the failsafe state machine later.
The "fix" involves ignoring using the main_state_transition and
implementing the guards in place. This is a hack for now but should
cover the corner case until a more thorough refactor.
The different failsafe state machines have involved over time from
requirements and learnings based on developed solutions and products.
The implementations in various places will need to get consolidated in
the future.
Tested in SITL for Return and Land with and without GPS.
* Use position instead of last setpoint
This calculates the target velocities better taking into account disturbances along
the flight route. Previously entry angles and more were calculated assuming the flight path
originates directly from the direction of the previous waypoint. This corrects this assumption
to instead make the direction come from the vehicle location.
* Allow to specify a final speed given a braking distance.
This is to allow planning to not stop at a waypoint, but instead
to reach the waypoint while maintaining a certain velocity
* Updated src/lib/matrix
* Account for speed at target when determining constraints
* Separate constraints into x/y components
* Use setpoint position, not vehicle position
* Fix whitespace, add documentation
This should fix spikes in the mag data on MPU9250 found inside Drotek
Pixhawk 3Pro.
The problem turned out to be that we are not checking the DRDY bit
before reading the data. We presumably threw away most of the stale data
by doing a duplicate check, however, sometimes we might have run into a
race where the mag data was already being updated in the chip while
still being read.
* Draco-R sensor orientation correction
* LL40LS sensor is not stable during I2C probing. More trials have been implemented.
* px4flow execution has been removed as rc script already running it
* GPS LED script repaired
* Off ICM20608 due to some bug?
* Removed i2c speed adjustment due to SMBUS.
* ms5611 test2 does not exist
* Baud rate has changed.
* Draco-R airframe parameters are updated.
* IFO and Draco parameters are updated
* Draco-R sensor orientation corrected
* Draco-R DSHOT supports
- ecl in PX4/Firmware (4658aaf8a0ff90662843558dbc8ea68adcc7284d): 9b4b24ee71
- ecl current upstream: d76b704225
- Changes: 9b4b24ee71...d76b704225
d76b704 2019-11-01 kamilritz - Only inlcude gtest if standalone build
7c1e38d 2019-10-18 kamilritz - Make it build with Firmware
d79199c 2019-10-17 kamilritz - Remove swig and python test related things
d88e242 2019-10-17 kamilritz - pytest are replaced in gtests
71be26e 2019-10-17 kamilritz - Port RingBuffer Test to GTests
cac5f3f 2019-10-17 kamilritz - GTest and Coverage cleanup and Basic EKF GTest
fcea13e 2019-10-14 Martina Rivizzigno - add gtest, temp disable swig
When flying POSCTL and ALTCTL the throttle stick is usually spring
loaded and therefore centered. Therefore, it makes more sense to check
for above center instead of above low.
Before this change, the battery percentage is reset to 100% as soon as
the drone is disarmed again. In my opinion it is more realistic if the
batteries don't magically fill up again but stay low.
and remove the px4_ prefix, except for px4_config.h.
command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done
Transitional headers for submodules are added (px4_{defines,log,time}.h)
This reverts a previous change because we're not entirely sure about all
implications on various airframes. It makes sense to change this default
after the failsafe state machines have been consolidated and the various
failsafe behaviours are more predictable for all airframes (not just
multicopter).
- move most orb to uORB::Publication and uORB::Subscription
- update legacy message handling (warn to PX4_INFO, PX4_WARN, PX4_ERR)
- add perf counters
- sensors/mag support newer `uavcan::equipment::ahrs::MagneticFieldStrength2` message
- sensors/gps support `uavcan::equipment::gnss::Auxiliary` for hdop and vdop
- sensors delete obsolete ioctl and read methods
- use PublicationMulti for actuator_outputs and esc_reports (to coexist with other output modules)
- add GNSS parameter metadata (parameters_injected.xml)
I don't understand why we should wait to parse incoming MAVLink traffic
just because we don't have the source address initialized. We still
check the source address before doing a sendto.
This should fix serial MAVLink communication on FMU5x where both serial
and UDP is available. There the serial connection previously did not
work because nothing was connected over UDP.
I propose two changes to the battery failsafes:
1. Remove the return only mode because it means the drone is likely
to crash during RTL. I think this is not expected by users chosing
the option and therefore better not exposed as an option.
2. Make Return/Land the default battery failsafe because it is expected
that a drone does the right thing when battery is low.
Also, this changes the description of the Return/Land behaviour to make
the drop down menu less long and awkward in QGC.