133 Commits

Author SHA1 Message Date
Julian Oes
300bc0a332 commander: fully support MAVLink force arming
When a magic number is added as param2 for the MAVLink ARM_DISARM
command not just disarming but also arming should be enforced.
2019-11-01 10:36:30 +01:00
Julian Oes
51ba80f33b commander: improve msg when trying to arm in air 2019-11-01 10:36:30 +01:00
Beat Küng
3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
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)
2019-10-30 11:48:47 +01:00
Julien Lecoeur
8f910f8435 ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters (#13249)
* Conversions lib: add quaternion getter

* vehicle_status: add flag is_vtol_tailsitter

* ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters
2019-10-28 09:27:53 +01:00
Daniel Agar
967446af4c clang-tidy: enable readability-simplify-boolean-expr and fix 2019-10-27 19:19:07 -04:00
Beat Küng
b5ba1665f6 commander: add COM_MOT_TEST_EN parameter to enable/disable motor testing 2019-10-24 09:27:29 +02:00
Beat Küng
0d91d4e702 commander: do not beep on successful commands
DO_MOTOR_TEST is sent continuously, which led to constant beeping
2019-10-24 09:27:29 +02:00
Beat Küng
f7b04d5cbc commander: answer to VEHICLE_CMD_DO_ORBIT 2019-10-24 09:27:29 +02:00
Beat Küng
285ae608a5 commander: add support for DO_MOTOR_TEST
- add an optional timeout to test_motor
- enforce a timeout when receiving DO_MOTOR_TEST
- limitation: DO_MOTOR_TEST can only control the MAIN outputs
2019-10-24 09:27:29 +02:00
Nick Steele
070d75496d Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' 2019-10-18 15:57:50 -04:00
Julian Oes
de90543d6f FlightTasks: add Descend task to land without GPS
This adds a flight task to catch the case where we want to do an
emergency descent without GPS but only a baro.

Previously, this would lead to the navigator land class being called
without position estimates which then made the flight tasks fail and
react with a flight task failsafe. This however meant that landed was
never detected and a couple of confusing error messages.

This applies if NAV_RCL_ACT is set to 3 "land".
2019-10-18 16:18:19 +02:00
Daniel Agar
97efbde6f4 WIP: commander re-evaluate RC mode switch when local position becomes valid 2019-10-14 14:16:24 +02:00
Dusan Zivkovic
ab2e235333 Commander: bugfix: get all available messages on the subsystem_info topic 2019-10-10 13:12:31 +02:00
Matthias Grob
ca711fecc7 Commander: improve message for RC override event 2019-10-09 15:34:46 +02:00
Matthias Grob
c1faea8d32 Commander: add const qualifiers for clarity 2019-10-09 08:03:07 +02:00
Daniel Agar
a5895e5a99
Revert "commander: update parameter strings to class enum"
This reverts commit c322f1d1568b73327916ce2363c80375e3b5485b.
2019-10-03 11:28:44 -04:00
Daniel Agar
c322f1d156 commander: update parameter strings to class enum 2019-10-02 19:43:32 -04:00
Daniel Agar
c8e59c4e39 parameter_update use uORB::Subscription consistently 2019-09-29 10:49:03 -04:00
bresch
6139812293 FailureDetector - use standard topic subscription for attitude topic and
pass vehicle_status from commander instead of subscribing to it.
2019-09-24 14:17:58 +02:00
Matthias Grob
412b44ff6e Commander: allow RC to override during RTL 2019-09-23 12:42:33 +02:00
Matthias Grob
4f44fde080 Commander: remove not disarming by RC message
Refactoring the condition to be more clear.
2019-09-23 12:42:33 +02:00
bazooka joe
fb3a91cc4f added circuit_breaker_enabled_by_val()
added and using circuit_breaker_enabled_by_val() where possible instead of circuit_breaker_enabled() which search for cbrk parameters by name, which is extensive process.
2019-09-22 13:55:40 -04:00
Julien Lecoeur
47355333ad Clarify comment 2019-09-02 10:47:40 -04:00
Julien Lecoeur
9c50f5ea08 Add parameter COM_PREARM_MODE
Condition to enter the prearmed state, an intermediate state between disarmed and armed
 * in which non-throttling actuators are active.
 *
 * @value 0 Disabled
 * @value 1 Safety button
 * @value 2 Always
2019-09-02 10:47:40 -04:00
Daniel Agar
891aae0377
commander increase cpu overload threshold
* the large 20% margin is no longer appropriate now that nearly all work in the system is
scheduled (moved out of ISRs) and represented in the load percentage
 * closes https://github.com/PX4/Firmware/issues/12753
2019-09-01 14:55:05 -04:00
Julien Lecoeur
84eeacfb38 Offboard failsafe actions: add DISABLED, LOCKDOWN and TERMINATE options 2019-08-21 07:56:20 -07:00
Julien Lecoeur
4c9288d993 Commander: cleanup COM_POSCTL_NAVL parameter
- move to px4::params
- use enum
2019-08-21 07:56:20 -07:00
Beat Küng
a7eed520b4 commander: refactor module usage output 2019-08-19 10:54:56 +02:00
Beat Küng
878ed8136c commander: add 'commander arm -f' command to force arming
This allows to bypass preflight and prearm checks.
During development there are regular cases where I just want to arm the
board/vehicle no matter what, and the preflight checks are guaranteed to
fail (e.g. sensors uncalibrated, inconsistent, powered via USB, etc.).
Allowing an easy and quick way to arm (assuming you know what you are
doing) helps to speed up development considerably and is less frustrating.
2019-08-19 10:54:56 +02:00
Jimmy Johnson
963467b4df splitting preflight and land disarm times into 2 parameters 2019-08-14 14:17:33 +02:00
Claudio Micheli
2eb9fb9ed6 Commander: move esc_status as local variable.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
09d79b221f Simplified esc_status healthiness logic.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
75c336c00c uavcan_main: replaced printf messages with PX4_INFO
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Claudio Micheli
187a025dfe Commander: added esc_status prearm checks
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-08-09 09:41:17 +02:00
Daniel Agar
a917f22b65
sensors: create vehicle_acceleration module (#12597) 2019-08-07 05:05:48 -04:00
Daniel Agar
8f5b7de498
uORB::Subscription minor API cleanup
* the forceInit() method was combined with the existing subscribe()
 * delete unused last_update()
2019-08-06 10:28:49 -04:00
Andrei Korigodski
4d5f922e7a commander: use shutdown_if_allowed() to check for shutdown safety
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski
5133453822 vehicle_status: replace ARMING_STATE_REBOOT with ARMING_STATE_SHUTDOWN
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Andrei Korigodski
4a330c6e0a commander: do not reboot on USB disconnect when armed
Signed-off-by: Andrei Korigodski <akorigod@gmail.com>
2019-08-05 05:55:33 -07:00
Daniel Agar
e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
Matthias Grob
d0f1a551e9 manual_contol_setpoint: fix mode slot numbering (#12578)
* This fix is necessary because usually uORB structs get initialized with
all zeros and then get filled with the fields that are actually in use.
 * The number 0 for the mode slot was already commanding to switch to the
mode in slot one even though for example the joystick input via mavlink
does not use this mechanism at all.
2019-08-01 12:27:58 -04:00
Julian Oes
98dfa30838 commander: fix disarming for rovers
We have to ignore the landed flag for rovers, it doesn't really apply
for them.
2019-07-26 02:52:38 -07:00
Julian Oes
308d91e5ff commander: prevent potential disarms in-air
This fixes the terrifying case where the drone disarms in-air just
because it receives a MAVLink disarm command. We now check param2 for a
magic number which enforces arming/disarming.

This is added to the mavlink protocol in:
https://github.com/mavlink/mavlink/pull/1162
2019-07-26 02:52:38 -07:00
Matthias Grob
706500f19c Commander: make RC override multicopter only
AAs discussed in the devcall this functionality is only useful for
rotary-wing (multicopter) flying since it's a big safety hazard to
accidentally bring a fixed wing out of an auto mode e.g. a mission
and fly away in a straight line or into an obstacle.
2019-07-22 09:57:37 +02:00
Matthias Grob
5c1ab06343 Commander: pure refactor of RC override conditions 2019-07-22 09:57:37 +02:00
Daniel Agar
4e360064d9
commander refactor and cleanup offboard control mode 2019-06-15 20:45:26 -04:00
Timothy Scott
c4bb6b53e8 Changed soft stop check 2019-06-13 10:04:26 +02:00
Timothy Scott
21760a5856 Changed constant name to UNMANNED_GROUND_VEHICLE 2019-06-13 10:04:26 +02:00
Timothy Scott
714c90b9db Updated code style to fix confusing if conditions 2019-06-13 10:04:26 +02:00
Timothy Scott
a134da6e12 Removed is_rotor_wing, replaced with vehicle_type 2019-06-13 10:04:26 +02:00