Commit Graph

21613 Commits

Author SHA1 Message Date
Samuel Sadok ee75ebac8c Adds Smart Return To Home capability by recording the flight path in a memory optimimized format. This means the UAV can return to home by using only known-good flight paths.
The flight graph is stored as a series of delta elements at 1m resolution and a list of nodes. Both lists share the same buffer. Each delta element takes up 2 bytes or sometimes 6 bytes if the delta is large. The path can consist of multiple disconnected segments, in which case the gaps are stored as delta elements with a jump-bit set.

Once in a while or when required the graph is consolidated, which means:
 - Points that lie roughly in a line are replaced by a single line
 - Points that lie close to previously recorded lines are pruned
 - For lines that pass close to each other a node element is created

Furthermore:
 - The graph is recorded at a higher precision closer to home
 - If the graph becomes full, the overall precision is reduced and the whole graph is re-consolidated
 - If the graph becomes full once more, all data is removed except for the shortest path home at that moment. One of these actions is repeated at each subsequent fill-up.

Path finding information is generated/refreshed on demand and stored in the nodes. During return-to-home, the best direction to home is continuously evaluated by using the information stored in the nodes.

The graph recording and path finding is implemented in navigator/tracker.cpp.
The graph based return-to-home is implemented in navigator/smart_rtl.cpp.
2020-10-04 12:16:45 -04:00
Daniel Agar eabbd19c1c commander: PreFlightCheck param_find all parameters immediately
- this ensures the relevant parameters are marked active immediately
before parameter sync
 - fixes https://github.com/PX4/Firmware/issues/15872
2020-10-03 14:43:21 -04:00
Daniel Agar 8ee0c62e57 examples: add Gyro FFT using CMSIS 5 on Cortex-m (#15104)
- this is a work in progress experiment to compute real time FFTs from raw gyro FIFO data on Cortex-m hardware (stm32f4/f7/h7, etc)
2020-10-02 11:47:27 -04:00
Alex Mikhalev c648d52909 uavcan: Increase uavcan main stack size
I observed stack overflows when executing `uavcan params list`, so the
stack size probably needs to be increased.

Signed-off-by: Alex Mikhalev <alexmikhalevalex@gmail.com>
2020-10-02 01:31:27 -04:00
SalimTerryLi 25eca31e3a New board Scumaker AirPi HAT for Raspberry Pi B series 2020-10-01 11:22:47 -04:00
Nicolas MARTIN 967f741a0e commander: add parameter COM_REARM_GRACE to optionally disable re-arming grace period 2020-10-01 11:20:08 -04:00
Daniel Agar c1936dab1f commander: accel & gyro subsystem health set within IMU check 2020-09-30 12:17:48 -04:00
Daniel Agar 25c537bae9 commander: don't impose additional timeouts in sensor checks
- the sensors hub is responsible for sensor timeouts
2020-09-30 12:17:48 -04:00
CarlOlsson 98c8cbb27f ekf2: fix odom body rate sign bug 2020-09-30 11:34:37 -04:00
Julian Oes b454095776 commander: fix switch to loiter
Sometimes, the mission_result timestamp is the same as the
internal_state timestamp which would meant that we would not switch to
LOITER even though the takeoff is clearly done at that point.
2020-09-30 08:23:16 -04:00
David Sidrane 68703135c3 bl_update:Respect page size if it matters
Track Changes in NuttX stm32h7 flash driver:
   The STM32H7 flash driver uses up_progmem_pagesize to
   describe minimum write size to satify the block size
   requierment for ECC.

   Therefore, the image size needs to be padded to a multiple
   of up_progmem_pagesize()
2020-09-29 23:44:24 -04:00
Daniel Agar c9c20666a2 sensors: sanity check differential pressure temperature (#15845)
- if valid temperature unavailable then use ICAO Standard Atmosphere 15 degrees celcius
2020-09-29 09:35:34 -04:00
Nicolas Martin da4d0e650a mc_pos_control: fix acc Z sign 2020-09-29 13:09:51 +02:00
David Sidrane 59f20a26eb motor_params:Move to mixer_module
sensors having mixer_module creates a dependency on sensors for
   the param MOT_SLEW_MAX. Things that do not uses sensors.
   IE. PWM only device should not have to include them.
2020-09-28 20:47:40 -04:00
Daniel Agar f1feaf45d3 EKF2: move vehicle_odometry publish to method 2020-09-28 18:34:49 -04:00
Daniel Agar fe6a1ce882 simulator: fix airspeed temperature
- HIL_SENSOR temperature is only being sent with barometer data
2020-09-28 12:56:56 -04:00
Daniel Agar 828134c56f sensor_calibration: add link dependencies 2020-09-28 12:26:38 -04:00
PX4 BuildBot 1822a678f6 Update submodule ecl to latest Mon Sep 28 12:39:19 UTC 2020
- ecl in PX4/Firmware (2b34fec0844646d13a57f78dbbed44b53813919e): https://github.com/PX4/ecl/commit/6b99ea2a6038c536f92aaa2b7d24ce7962e55df6
    - ecl current upstream: https://github.com/PX4/ecl/commit/4c2355a63821836bf8801e996d4651dcabe0287f
    - Changes: https://github.com/PX4/ecl/compare/6b99ea2a6038c536f92aaa2b7d24ce7962e55df6...4c2355a63821836bf8801e996d4651dcabe0287f

    4c2355a 2020-09-25 Daniel Agar - EKF: use GPS to lookup declination from WMM before full GPS checks pass
2020-09-28 10:58:33 -04:00
justas- bb77f55f7b motor_test: Use 1-based motor indexing.
Motors in Px4 ecosystem are indexed using 1-based indexing (Airframe reference, dshot command, etc.) motor_test command is 0-based. This PR changes motor_test to use 1-based indexing.

This PR refers to Github issue #15721.
2020-09-28 10:59:41 +02:00
flochir ec7108892b batt_smbus: fix potential hardfault by checking buffer sizes (#15789)
* Added buffer length check to SMBus::block_read (triggered hardfault in batt_smbus module by writing beyond buffer end due to device returning longer byte_count than requested/expected)

Co-authored-by: Florian Olbrich <florian.olbrich@scarabot.de>
Co-authored-by: Daniel Agar <daniel@agar.ca>
Co-authored-by: BazookaJoe1900 <BazookaJoe1900@gmail.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2020-09-28 09:41:40 +02:00
PX4 BuildBot 6df50cb74f Update submodule ecl to latest Sat Sep 26 15:30:31 UTC 2020
- ecl in PX4/Firmware (5784cb6e5e): https://github.com/PX4/ecl/commit/fab242a81f3836de716b0ed96fcc841360c3a867
    - ecl current upstream: https://github.com/PX4/ecl/commit/6b99ea2a6038c536f92aaa2b7d24ce7962e55df6
    - Changes: https://github.com/PX4/ecl/compare/fab242a81f3836de716b0ed96fcc841360c3a867...6b99ea2a6038c536f92aaa2b7d24ce7962e55df6

    6b99ea2 2020-09-24 Daniel Agar - ECL standalone build improve ECL_INFO/WARN/DEBUG
5879eaa 2020-09-25 bresch - ekf: fix variable length array error
99aafba 2020-09-14 Daniel Agar - README: remove obsolete build status
2020-09-26 13:13:51 -04:00
Tanja Baumann b5ebdb8e41 add system command to get and set system time
* add system_time command for all boards
2020-09-26 13:09:01 -04:00
Jacob Dahl a24488328f Move GPS blending from ekf2 to sensors module
- new sensors work item that subscribes to N x sensor_gps and publishes vehicle_gps_position
 - blending is now configurable with SENS_GPS_MASK and SENS_GPS_TAU

Co-authored-by: Jacob Crabill <jacob@volans-i.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2020-09-25 23:28:31 -04:00
Daniel Agar e792c46f20 mavlink: increase stack 2650 -> 2848 bytes (#15821) 2020-09-25 21:42:02 -04:00
Daniel Agar 861e06dfd7 mavlink: handle receiving GENERATOR_STATUS
- only published (ORB_ID(generator_status)) and logged for now
2020-09-25 11:36:58 -04:00
Daniel Agar 2ccf664e95 commander: disarm from safety relax land detector timeout
- ensure land detector is updated before safety is checked
2020-09-25 09:41:53 -04:00
Matthias Grob bcbc761bf6 Revert "Change defaults for MPC_LAND_ALT"
This reverts commit 59bd3e9f6e.
2020-09-24 19:18:58 +02:00
Daniel Agar 0dc8bb9c86 uORB: increase ORB_MULTI_MAX_INSTANCES 4 -> 10
- put more realistic bounds on maximum number of battery instances, gps, etc
2020-09-24 11:01:28 -04:00
Matthias Grob 5d47a4c9e0 Commander: fix rc override threshold scaling (#15807)
Improve parameter description for threshold
and lower the threshold a bit.
2020-09-24 14:52:19 +02:00
Daniel Agar 0a607bdc67 boards: CUAV CAN_GPS v1.2 cannode (stm32f412) with UAVCAN bootloader 2020-09-23 14:30:54 -04:00
Daniel Agar 8579b5dd26 uORB: Subscription add copy/move constructor and assignment 2020-09-23 10:04:54 -04:00
Matthias Grob bf248746ce mavlink_messages: cast rotation types for assert 2020-09-23 09:08:23 -04:00
Daniel Agar d5295ef4e1 mavlink: add static asserts to keep MAV_SENSOR_ROTATION in sync with PX4 ROTATION 2020-09-22 11:10:31 -04:00
Daniel Agar 00e955cc3e rotations: sync rotation enum, SENS_BOARD_ROT, CAL_MAGx_ROT with MAV_SENSOR_ORIENTATION 2020-09-22 11:10:31 -04:00
Daniel Agar d676e65294 logger: log_writer_file increase stack 1170 -> 1472 bytes (#15765) 2020-09-21 22:17:31 -04:00
Yashom Dighe 5daca6c2c4 IntrusiveSortedList.hpp: let operator* return a reference
So that clang 12 does not complain:
loop variable 'child' is always a copy because the range of type 'List<ModuleParams *>' does not return a reference

Co-authored-by: Yashom Dighe <yashom7@gmail.com>
2020-09-21 16:55:04 -04:00
bresch 1141cfa7c6 ekf2_main: reduce update mag bias minimum learning time to 30s
120 seconds of learning time in 3D fusion mode was too long for most normal flights. The learned bias is usually really good after a shorter period and was not used to update the parameters. 30s seems to be a good compromise.
2020-09-21 15:54:24 +02:00
Beat Küng 5ac0c7c799 List.hpp: let operator* return a reference
So that clang 12 does not complain:
loop variable 'child' is always a copy because the range of type 'List<ModuleParams *>' does not return a reference
2020-09-21 09:23:21 -04:00
Daniel Agar 09af5e0637 commander: mag calibration use expected WMM sphere radius to reject samples if GPS is available 2020-09-20 12:22:56 -04:00
Daniel Agar abbd335e4e uavcannode: use correct PYTHON_EXECUTABLE and support stm32h7
- sync CMakeLists.txt with drivers/uavcan
2020-09-18 13:03:07 -04:00
Beat Küng 5fdff6a0e4 i2c drivers: add '-k' flag for keep_running directly to BusCLIArguments 2020-09-18 09:45:06 -04:00
Beat Küng 1bf030e8ba lps33hw: refactor and add -k flag to keep running even if no sensor found 2020-09-18 09:45:06 -04:00
Beat Küng f106e6b266 param: add 'param show-for-airframe' command
- simplifies creation of an airframe config
- could be done from QGC, but it only knows if a param is non-default from
  metadata, which can be incorrect/missing information
- for the list of exceptions we could look at '@category', but we don't have
  that info in the build
- there might be some more exceptions to be added
2020-09-18 09:03:29 +02:00
David Sidrane 768ed297f2 uavcan_stm32h7:Support is by Family Not Chip/pacakge 2020-09-16 21:32:04 -04:00
David Sidrane 323dd389fe vehicle_imu:VehicleIMU Fix style issues 2020-09-16 21:32:04 -04:00
David Sidrane 760f2ecb22 LoadMon:track upstream malloc changes 2020-09-16 21:32:04 -04:00
David Sidrane c948d41284 up_cxxinitialize:is now automatic in task start 2020-09-16 21:32:04 -04:00
David Sidrane f77fc690c7 hott:Fix compiler error array bound is unknown
This fixes error: variable-length array bound is unknown [-Werror=vla-larger-than=]
   with gcc 9.1
2020-09-16 21:32:04 -04:00
David Sidrane 06d030b6d9 px4iofirmware Updates for NuttX 9.1.0- 2020-09-16 21:32:04 -04:00
David Sidrane b32aab2d0f platform Updates for NuttX 9.1.0- 2020-09-16 21:32:04 -04:00