Commit Graph

684 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 23aa9ac70f cmake nuttx add STM32H7 debug helpers 2020-10-02 11:31:18 -04:00
David Sidrane 529d816a39 px4_fmu-v6x:Support ETM Hardware Trace 2020-09-28 10:59:39 -04:00
PX4 BuildBot b5df4f76cc Update submodule nuttx to latest Sat Sep 26 15:30:26 UTC 2020
- nuttx in PX4/Firmware (59f5b841a6646a7ae514ae1139ba18c3f787ceb3): a8b7ca869e
    - nuttx current upstream: 0fe69f6cc0
    - Changes: a8b7ca869e...0fe69f6cc0

    0fe69f6cc0 2020-09-25 David Sidrane - [BACKPORT] stm32f7:serial Bug Fix: Ensure next buffer is processed
2020-09-26 09:47:03 -07:00
Daniel Agar bbdc57a662 cmake: remove sitl_gazebo build -j2
- allow ninja build to automatically determine parallelism
2020-09-24 15:56:57 -04: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 e4a408bc55
cmake nuttx build modify copied nuttx repo .git to point to actual git dir
- this fixes builds that contain a px4io and use the Makefile generator rather than Ninja
2020-09-21 12:39:29 -04:00
Daniel Agar 940dc9cca0
cmake NuttX build fix path to git dir
- this relative path was incorrect for the px4io when using the Makefile generator and built for inclusion within another build (eg px4_fmu-v5_default)
2020-09-18 21:18:36 -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
JaeyoungLim 458420f9cb
Add jsbsim bridge to enable jsbsim for px4 SITL on jsbsim (#15748)
* Add jsbsim bridge to enable jsbsim for px4 SITL/HIL on jsbsim

This is a PX4 HIL/SITL integration into JSBSim. JSBSim is an open source flight dynamics model (http://jsbsim.sourceforge.net/)

Currently there are three models available which is the rascal, quadrotor_x, hexarotor_x integrated into the bridge.

The simulation can be run with the firmware with the following command for example
```
make px4_sitl jsbsim_rascal
```

The visualization is done flightgear and is done by the bridge sending UDP packets to flightgear. To disable the visualization `HEADLESS=1` when running the make command.

The simulation can be configured through the configuration files under the `config` directory through a xml file. Senor configurations,  The xml file name should match the name of the model.

* Update Tools/sitl_run.sh

Co-authored-by: Beat Küng <beat-kueng@gmx.net>

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2020-09-17 20:32:42 +02:00
David Sidrane 6e1078c96e NuttX-Posix least bad LGD
Nuttx now supports sh and source (.)
   sh will open a new process for each invocation.
   This means the child can not modify the parent
   env. So we must use . to matain how nuttx worked.

   Since rc.vehicle_setup is used in both we use
   source and alis as we did with sh.
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 df30f29a55 NuttX/Make.defs.in Support PROBEs 2020-09-16 21:32:04 -04:00
David Sidrane fbf110f6be Use EXTRAFLAGS instead of EXTRADEFINES 2020-09-16 21:32:04 -04:00
David Sidrane b2a31e15da common:board_crashdump.c track upstream API change 2020-09-16 21:32:04 -04:00
David Sidrane c49c767d78 NuttX add compiler dependent: disable no-stringop-truncation 2020-09-16 21:32:04 -04:00
David Sidrane 4d64065422 NuttX:Make.defs.in fix macro to not kill flock 2020-09-16 21:32:04 -04:00
David Sidrane 852d5ceb22 NuttX CMakeLists build .version file in build 2020-09-16 21:32:04 -04:00
David Sidrane 68e3fd9f37 cpuload 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
David Sidrane c57024e6bb NuttX 9.1.0- 2020-09-16 21:32:04 -04:00
Daniel Agar 2b18b05a8a
vscode updates and improvements
- fix gazebo SITL debug
     - now prompts you to select vehicle
 - devcontainer.json container support https://code.visualstudio.com/docs/remote/containers
     - this allows you to jump straight into working within a container (px4-dev-nuttx) on a fresh machine
     - also helps with Codespaces https://github.com/features/codespaces
 - plugin updates
    - cpp extension pack, spell checking, CTest support
 - cleanup intellisense
     - the backup tag parser was a resource hog and didn't work very well
 - fix problemMatcher support so that you can click on a build failure
2020-09-16 09:07:54 -04:00
Daniel Agar 0e9a4cc65f boards: px4/sitl sync all build variants and fix none default package 2020-09-15 21:13:04 -04:00
Beat Küng 809d05053b posix: add support for ROMFSROOT
- add missing ROMFS files to CMakeLists.txt
- rename genromfs to etc, so that it's clearer for SITL use
2020-09-15 09:30:16 +02:00
Beat Küng 2956aa340e module: increase max timeout for stopping modules from 2s to 5s
The gps module might take up to 4s to stop (if stopped during module
configuration).
2020-09-13 18:31:37 -04:00
David Sidrane 6c4a1d01c1
NuttX Critical STM32H7 Interrupt Storm on I2C 2020-09-07 15:15:52 -04:00
Daniel Agar cea1a19fe6 NuttX sched notes add C linkage 2020-09-06 19:18:42 +02:00
Daniel Agar 023f6d3983
NuttX cpuload monitoring optimization
- Nuttx only process all suspend & resume scheduling notes when top is running, otherwise only track IDLE
 - convert cpuload and print load to c++
 - delete unused fields from print_load struct
 - update hrt_store_absolute_time (previous unused)
2020-09-05 14:35:50 -04:00
Beat Küng 787f9c1213 i2c: use board-specific bus numbering for '-X -b <bus>' CLI
As boards don't have their external buses labeled consistently, it was not
useful to use an abstraction.
2020-09-03 15:32:35 -04:00
David Sidrane 7f91e41f67 hardfault_log:Add Fault Status registers 2020-09-03 14:55:09 +02:00
oneWayOut 71f381ada9 add gazebo VTOL tiltrotor debug target for VSCode SITL 2020-09-02 11:41:01 -04:00
Daniel Agar 668c16da83 px4_work_queue: reset statistics after each status print 2020-09-02 10:09:13 -04:00
CUAVcaijie 536877cf0a
boards: add UAVCAN timer override mechanism and CUAV X7 add CAN (#15348)
* X7Pro adds CAN driver
* UAVCAN timer selection moved to default.cmake
* Modify some details about @CUAVcaijie UAVCAN timer selection moved to default.cmake
* Put some timer parameters to micro_hal.h from board_config.h. Fix all h7 boards

Co-authored-by: honglang <honglang@cuav.net>
2020-08-28 12:16:48 -04:00
PX4 BuildBot 67c134303c Update submodule nuttx to latest Fri Aug 28 00:39:53 UTC 2020
- nuttx in PX4/Firmware (f0555571047b18fa503eeac18da586f2dd360c12): 925b7b513b
    - nuttx current upstream: 863ed53e3f
    - Changes: 925b7b513b...863ed53e3f

    863ed53e3f 2020-06-15 David Sidrane - [BACKPORT] kinetis:Ethernet fixed & better interrupt management
2020-08-27 21:41:09 -04:00
David Sidrane 8d2ce355f2 Nuttx Backport add RTR 2020-08-26 13:05:23 +02:00
David Sidrane 622903f7de Nuttx Backport add extern C under cpp 2020-08-26 13:05:23 +02:00
Beat Küng 4088c2581f
i2c_spi_buses: add '-q' for quiet startup flag (#14969)
* [WIP] i2c_spi_buses: add '-q' for quiet startup flag

And enable for optional board sensors.

* ROMFS: rc.sensors try starting all optional I2C sensors quietly

Co-authored-by: Daniel Agar <daniel@agar.ca>
2020-08-26 08:46:35 +02:00
Daniel Agar ad3e6ee5dd
wq:attitude_ctrl increase stack by 16 bytes (again) 2020-08-16 18:16:16 -04:00
David Sidrane 157aa36c1e NuttX based bootloader:Track QGC change in sequnsing
It appear that QGC is now resyncing between operation.
   This was causing the bl_state to be reset to STATE_PROTO_GET_SYNC
   and loosing the state of (STATE_PROTO_GET_SYNC|STATE_PROTO_GET_DEVICE)
2020-08-14 10:58:23 -04:00
David Sidrane 13246bdb2c common/shutdown:All FMU's not stying in bootloader
Fixes bug, wehre reboot -b would not stay in bootloader.
   Call was passing bit mask (=4) not integer value of 1.
2020-08-14 14:11:45 +02:00
Daniel Agar 0c91a29c3f wq:attitude_ctrl increase stack 2020-08-13 13:32:07 -04:00
David Sidrane c46d5e8535 Nuttx with TX DMA fix 2020-08-11 12:27:28 -04:00
Daniel Leonard Robinson fa4818e467
vehicles: add new vehicle type: Airship (#14862)
Co-authored-by: Anton Erasmus <anton@flycloudline.com>
Co-authored-by: Beat Küng <beat-kueng@gmx.net>
2020-08-10 08:52:51 +02:00
Beat Küng b6052fbb11 nuttx: update submodule 2020-08-06 00:08:23 -04:00
Daniel Agar b6a17a6538
new IntrusiveSortedList container used for uORB, WorkQueues, and WorkItems
- new intrusive linked list container (c++ template) that sorts on insertion
 - primarily for convenience inspecting things in the system like uORB or WorkQueues
 - uorb status or top sorted alphabetically 
 - work_queue status threads sorted by priority, then items sorted alphabetically within each
2020-08-04 11:09:41 -04:00
David Sidrane e2a9b68fc7 kinetis:Add kinetis_gpiosetevent in PX4 layer
Adds a compatible gpiosetevent interface. The helper call the
   low level functions while providing a consistent API with
   xxxx_ gpiosetevent(uint32_t pinset, bool risingedge,
                      bool fallingedge, bool event, xcpt_t func,
                      void *arg);

   This wrapper was rjected upstream.
2020-07-31 09:46:27 -04:00
David Sidrane e67486d603 nxp:Add support for rev E HW nxp_fmuk66-e 2020-07-31 09:46:27 -04:00
Daniel Agar 9426c68a13 cmake: only allow gold linker for posix builds
- the gold linker doesn't currently work for NuttX builds
 - NuttX skip --print-memory-usage if using the GOLD linker
 - fixes #15400
2020-07-23 09:41:35 -04:00
PX4 BuildBot fb2ebc9379 Update submodule nuttx to latest Sun Jul 19 12:39:45 UTC 2020
- nuttx in PX4/Firmware (2624730b02ea71fa2bbd28cc424d9bade5766356): 61742342ec
    - nuttx current upstream: dc10293feb
    - Changes: 61742342ec...dc10293feb

    dc10293feb 2020-05-25 Claudio Micheli - [BACKPORT] stm32l4: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
5735f765e2 2020-05-25 Claudio Micheli - [BACKPORT] stm32: extend CAN ioctrl with NART/ABOM. Add RTR to CAN header
4dc9ae05f5 2020-05-25 Claudio Micheli - [BACKPORT] stm32f7: Add the option to include RTR in CAN header
bdd9e786e1 2020-04-21 Beat Küng - [BACKPORT] stm32f7: add CANIOC_SET_NART and CANIOC_SET_ABOM ioctl's to can driver
2020-07-19 06:47:11 -07:00
Daniel Agar b54dea0ccd wq:attitude_ctrl: small stack increase to silence warning 2020-07-17 19:51:48 -04:00