12413 Commits

Author SHA1 Message Date
Mohammed Kabir
00d00fdca9 drivers: heater: fix module build and startup
- Startup was broken due to unnecessary cyclic check probably introduced during transition to work_queues
- Module never used other than on Teal One which had a hacky heater input GPIO, this enables usage on general boards

drivers: heater: reduce verbosity and simplify commandline options

- We prefer the linux way of only reporting errors and staying quiet when everything is functioning as designed
- Most of the commandline options just read out the values of the system parameters, and one can just check the parameter values directly.

sensor_params: make thermal control parameters system parameters

heater_params: make thermal control parameters system parameters

drivers: heater: remove pin control hacks

- px4_arch_configgpio(GPIO_HEATER_OUTPUT) directly inits the heater pin to OFF, and as a PUSHPULL (TTL totem pole) OUTPUT

drivers: heater: set default device ID to 0
2019-11-16 11:43:42 +01:00
Beat Küng
d965b928f8 px4iofirmware: convert atomic macro into methods
Reduces flash size by 744 bytes.
CPU (loop time) is not affected.
2019-11-16 11:43:42 +01:00
David Sidrane
e847698c9f PX4 System changes Supporting STM32H7
stm32:ToneAlarmInterfacePWM TIM15-TIM17 have a BDTR Register

common:board_crashdump Add H7 support

stm32/board_mcu_version:Support H7

PX4 ADC:Use 32 interface and resoution abstraction

Added PX4 stm32h7 ADC driver

stm32h7:adc fix ADC ready check

fmu: handle BOARD_HAS_PWM==5

cmake: improve error handling for NuttX olddefconfig failures

WorkQueueManager:Quiet loadmon stack warning

camera_trigger:GPIO support < 6 GPIO

Adjust stack sizes (under hw stack check)

PX4 System changes Supporting STM32H7 PX4IO Driver

aerotenna_ocpoc:ADC add px4_arch_adc_dn_fullcount

init.cmake:Track Upstream change needing Make.def at config time

PX4 System changes Supporting STM32H7

NuttX CMakeLists.txt Track upstream changes

Common board_crashdump add header and px4 config

NuttX simplify callinb make libapps

Use UINT32_MAX for error return

drivers:uavcannode NuttX chip is now hardware

drivers:uavcanesc NuttX chip is now hardware

px4io:Avoid Race on AP to PX4 IO upgrade
2019-11-16 11:43:42 +01:00
BazookaJoe1900
cc41e5be20 mavlink: stream battery status fields (#13420)
* Implement battery status "charge state" on mavlink battery status message
2019-11-15 09:25:30 -05:00
Claudio Micheli
9364393e9d mavlink_receiver: Reject own autopilot messages for battery status.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2019-11-14 22:20:22 +01:00
Daniel Agar
7996ee496c lib: name folders consistently 2019-11-13 09:29:21 -05:00
JaeyoungLim
6bd4273b9c mavlink: handle cellular_status messages for logging 2019-11-13 09:19:02 -05:00
Oleg Kalachev
17a84a691f mavlink_receiver: simplify and fix statustext.severity handling 2019-11-11 17:12:37 -05:00
bazooka joe
f06a6ba898 set TC_ as 'system' parameters 2019-11-11 15:13:01 -05:00
Daniel Agar
1c4e854f93 cmake don't build param "c" files and remove param defines
- these aren't actual source code
2019-11-11 10:25:42 -05:00
Jacob Dahl
b943bd72ab commander: Added a parameter to control the timeout period for disarming after the kill switch is engaged. (#13325) 2019-11-07 10:03:59 -05:00
Daniel Agar
06f20ad892 sensors: ensure angular velocity publication on selected sensor update 2019-11-07 09:53:44 +01:00
Julian Oes
60343cc168 mavlink: warning for actuator offboard & lockstep
Currently actuator offboard control interferes with SITL lockstep.
Therefore, the least we can do is to warn a user and inform them how to
workaround the issue.
2019-11-06 12:30:30 -05:00
JaeyoungLim
b999581d2f Rover: Handle velocity frames correctly for offboard velocity control 2019-11-05 16:29:04 -05:00
Matthias Grob
1a79f75f94 Commander: start pulling arming related parts into separate folder
* PreFlightCheck: remove unused reportFailures flag
* Commander: pull all pre flight checks together on the PreFlightCheck class
* PreFlightCheck: separate checks into their own files
2019-11-05 11:25:59 -05:00
Matthias Grob
b6de83117e PositionControl: fix attitude setpoint timestamp
The plot of the attitude setpoint in the log did not show any values
because the message timestamp that the position control module sets
was overwritten by the PositionControl attitude generation.
2019-11-05 13:05:16 +01:00
Matthias Grob
c6cc9f0902 mc_pos_control: fix cutting thrust when landed
by applying it directly to the attitude setpoint which is the output of
the position controller.

The problem was that before the input to the attitude setpoint generation
was adjusted to generate a level attitude with zero thrust keeping the
heading. I refactored the PositionControl class in #13262 to directly
generate the attitude setpoint output. So here I'm adjusting the attitude
setpoint to do the exact same thing as before but without interleaving
with the PositionControl logic.
2019-11-05 13:05:16 +01:00
Julian Oes
4ff4f5c77f commander: fix capitalization of mavlink messages 2019-11-05 10:40:30 +01:00
Julian Oes
24c58db9e6 commander: fix battery failsafe without GPS
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.
2019-11-05 10:40:30 +01:00
Oleg Kalachev
7b83da708a mavlink_receiver: write STATUSTEXT messages from the same system to log 2019-11-04 15:33:22 -05:00
Matthias Grob
2416d0fc63 mc_pos_control: remove unused function declarations 2019-11-04 15:07:06 -05:00
Jaeyoung-Lim
1951e416b1 Enable rover attitude setpoint 2019-11-03 09:54:22 -05:00
Daniel Agar
a475d71ca9
astyle shift module documentation to bottom of files
- Astyle chokes on the module description strings, so for now we can keep them near the bottom of each file.
2019-11-02 10:58:47 -04:00
Julian Oes
87415d36a2 commander: check center throttle for POSCTL/ALTCTL
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.
2019-11-01 10:36:30 +01:00
Julian Oes
283a57054a commander: add missing manual modes
We prevent arming when in a "manual" mode with throttle high. However,
POSCTL and ALTCTL were missing.
2019-11-01 10:36:30 +01:00
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
xdwgood
854220dccd mc_pos_control.cpp:Fix forced update parameters 2019-10-31 10:15:25 -04:00
Julian Oes
a6a8877463 simulator: don't reset battery when disarmed
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.
2019-10-30 15:45:44 -04: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
Julian Oes
fad0c31872 commander: battery failsafe action back to warning
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).
2019-10-29 15:42:43 +01:00
Hamish Willee
24e3dc6a76 RTL Params - relative to destination not home 2019-10-29 15:00:49 +01:00
Peter van der Perk
07eb3d301b Enabled UDP in NuttX microRTPS build
Added commandline argument to change microRTPS ip address
2019-10-29 09:08:21 +00:00
Daniel Agar
47dd312b57
fw_att_control: move to px4::params 2019-10-28 18:08:47 -04:00
JaeyoungLim
71fbe58e20 fw_pos_ctrl_l1: enable loiter type offboard position setpoint for Fixedwing vehicles
* Use NAV_LOITER_RAD when provided offboard position setpoints
2019-10-28 17:42:27 -04:00
RomanBapst
216556e7f6 commander_params: mention definition of battery states in the description
of the battery failsafe mode parameter

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-10-28 16:18:42 -04:00
Daniel Agar
94de12ef19
sensors: own BAT_V_DIV and BAT_A_PER_V params (#13299)
- this is currently necessary for the QGC power setup gui, but should be reverted in the future
 - fixes #13292
2019-10-28 16:03:05 -04:00
Julian Oes
cb03612d99 mavlink: only ignore messages on UDP before init
We should still accept messages arriving over serial.
2019-10-28 11:13:16 -04:00
Julian Oes
08cce4f7f3 mavlink: accept msgs without source initialized
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.
2019-10-28 11:13:16 -04:00
Daniel Agar
c284198bec clang-tidy: partially fix hicpp-use-override 2019-10-28 10:50:31 -04:00
Daniel Agar
6f1e132286 clang-tidy: enable readability-redundant-control-flow and fix 2019-10-28 10:50:31 -04:00
Daniel Agar
6f1f5e0325 clang-tidy: partially fix readability-redundant-declaration 2019-10-28 10:50:31 -04:00
Daniel Agar
9f4258f6ff clang-tidy: partially fix hicpp-explicit-conversions 2019-10-28 10:50:31 -04:00
Daniel Agar
a7f330075a clang-tidy: enable hicpp-braces-around-statements and fix 2019-10-28 10:50:31 -04:00
Daniel Agar
744f06cc8f clang-tidy: enable readability-delete-null-pointer and fix 2019-10-28 10:50:31 -04:00
Daniel Agar
4192414576 clang-tidy: partially fix cppcoreguidelines-pro-type-reinterpret-cast 2019-10-28 10:50:31 -04:00
Julian Oes
f5945d1185 commander: make battery failsafes sane by default
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.
2019-10-28 05:51:12 -07:00
Silvan Fuhrer
0ce9329803 Safe Landing Points: Added new RTL_TYPE: closest between home, mission landing and safe points
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

Co-authored by Martina Rivizzigno <martina@rivizzigno.it>
2019-10-28 09:54:59 +01:00
Silvan Fuhrer
efafd91095 Rally Points in RTL: fly to closest Rally Point (safe point), or to home if that's closer
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-10-28 09:54:59 +01:00
Silvan Fuhrer
99dd229d71 Rally Point: fix typo of save to safe in mission_safe_point_s
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2019-10-28 09:54:59 +01:00