834 Commits

Author SHA1 Message Date
Matthias Grob
94c8371ffe Arm button fix: toggle arming state only once per arm button press 2016-12-20 09:46:36 +01:00
Matthias Grob
8a75827d6a fixed all comments of arm button review 2016-12-20 09:46:36 +01:00
Matthias Grob
aa984edd90 added an rc switch for arming and disarming with the option to use it as a button 2016-12-20 09:46:36 +01:00
Lorenz Meier
4b0647d9c0 Condition the GPS check always on the commander GPS prearm check param (#6055) 2016-12-14 15:30:24 +01:00
Julian Oes
adc9ed61b8 commander: ignore arm/disarm in DO_SET_MODE cmd
According to https://github.com/mavlink/mavlink/pull/629 the mavlink
command DO_SET_MODE should only determine the mode but not the
armed/disarmed state, so the MAV_MODE_FLAG_SAFETY_ARMED bit should be
ignored.
Instead the mavlink command COMPONENT_ARM_DISARM should be used instead.

Therefore, the commander now ignores the arm/disarm bit.
2016-12-11 17:00:09 +01:00
Andreas Antener
e9737d6f7a Preflight checks: made sure pre-flight check results are always reported first thing on the console and always on new or re-established telemetry links AFTER waiting for the hotplug timeout
(leads to double publishing on the console when a new link is established, but this is the best compromise between fixing and completely restructuring)
2016-12-02 22:56:48 +01:00
Andreas Antener
c069264752 Preflight check: initialize VTOL flag before it is used 2016-12-02 22:56:48 +01:00
Andreas Antener
f772fc2d02 Airspeed: preflight check for bad offset, fixed calls to preflight checks (vtol & airspeed) 2016-12-02 22:56:48 +01:00
Daniel Agar
c17c8884d1 implement MAV_CMD_DO_LAND_START 2016-11-19 15:48:10 +01:00
Paul Riseborough
983cfb8fdd commander: Add preflight checking for EKF health and IMU sensor consistency 2016-11-19 15:12:08 +01:00
Daniel Agar
8ac4dd04ae implement MAV_CMD_MISSION_START 2016-11-06 15:24:34 +01:00
Daniel Agar
cdd317ba38 commander arm check throttle include rattitude 2016-11-01 22:51:51 +01:00
Daniel Agar
2908f1c16d commander allow disarm command with throttle 2016-10-31 09:15:06 +01:00
Daniel Agar
27a50275b6 commander NAV_RETURN_TO_LAUNCH change mode to RTL 2016-10-30 21:41:43 +01:00
Carlo Wood
baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Beat Küng
f29a50df31 logger: add support for mavlink backend in Logger class, handle start/stop 2016-10-19 13:13:47 +02:00
Roman
3faaeb06d1 attitude setpoint topic: cleanup of matrix class usage
Signed-off-by: Roman <bapstroman@gmail.com>
2016-10-18 20:46:08 +02:00
tumbili
5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
James Goppert
43b665ae01 Fix gps circuit breaker logic in state machine. 2016-10-12 23:07:26 -05:00
Lorenz Meier
710a8e8f56 Commander: ensure hysteresis init 2016-10-10 22:47:07 +02:00
Julian Oes
0f763768b1 commander: don't auto-disarm as fast if not flown
It was found inconvenient that auto-disarm triggers too quickly right
after arming when the vehicle has not actually taken off yet.

Therefore, the auto-disarm takes now by a factor of 5 longer if the
vehicle has not taken off yet.
2016-10-10 22:47:07 +02:00
Beat Küng
50b8ed0a89 commander: initialize gps & baro as failure state
This avoids error messages on startup.
2016-09-30 13:50:51 +02:00
Beat Küng
ce0d31b7d9 mavlink log: ensure all critical & emergency msgs are also logged to console & ulog
Critical messages that the user sees should also go to the log file, so
that the exact error (with time) can later be analyzed from the log file.
2016-09-30 13:50:51 +02:00
Beat Küng
241fd629ce ERROR macro: get rid of the many 'oddly, ERROR is not defined for c++', use PX4_ERROR 2016-09-30 13:50:51 +02:00
Julian Oes
158a0be6c4 commander: whitespace fix 2016-09-30 08:02:55 +02:00
Sander Smeets
c4eabbd083 VTOL transition switch parameter checking (#5545)
* VTOL transition switch parameter checking

* Code style
2016-09-26 10:18:23 +02:00
Andreas Antener
5825b8c3e7 Geofence: renamed action on flag, reset only if none of the possible warning actions is set 2016-09-18 21:14:18 +02:00
Andreas Antener
6c7e5651ce Geofence: moved rtl_on reset up so it always happens when falling out of RTL 2016-09-13 14:32:01 +02:00
Andreas Antener
5a7046027c added rattitude to geofence exit condition 2016-09-13 14:32:00 +02:00
Andreas Antener
a59038e3cb Geofence: fix reset after violation and also if RTL/Loiter switches are not assigned 2016-09-13 14:32:00 +02:00
Andreas Antener
8c9f4e8ab8 added which transition the vtol is in to vehicle status 2016-09-13 14:32:00 +02:00
Lorenz Meier
c52c692c4f Commander: Adjust pthread stack size for platform 2016-09-11 20:07:30 +02:00
Beat Küng
be4db3c5df vehicle_command topic: use uorb queuing with length 3
Just to make sure we don't lose any messages.
2016-09-07 18:47:12 +02:00
Andreas Daniel Antener
9ea4c33ede Battery: directly evaluate critical battery state if set, wait longer for USB detection to happen (#5460) 2016-09-07 07:26:06 +02:00
Leon
faebdeedcf vmount: add mount and ROI implementation
MavLink spec implementation

implemented vehicle_roi topic

rename old gimbal to rc_gimbal

little changes

corrected RC Gimbal group

Starting ROI implementation in commander

implementation done, needs to be tested

uhm..

add todo

Change to float32 for x,y and z

remove mission topic again, not needed

change roi coordinates to lat, lon and alt

adjust to float64

starting mount implementation

correcting small mistakes, compiles now

add todos

further progress

implementing parameters

adjust default parameters

started implementation of mavlink

fix typo

change to lat, lon and alt

fix typo :D

change to double (to represent float64)

add global_position_

add mount topic

commander mount implementation done

cleanup

almost finished

little fix

codestyle fixes

leave pitch at 0 degrees

added pitch calculation

codestyle changes

Undo vehicle_mount, react to updated parameters, parsing of CMD_DO_MOUNT_* in mount.cpp

start implementing mode override

forgot a semikolon.

add debug

Finish implementation of mount override and manual control.

fix codestyle

correct cleanup

rename to vmount

works now

fix rebase error

fix polling

refactoring and custom airframe for gimbal

couple changes

remove warnx

almost done

finally

What is going on?

change back to actuator_controls_2

working

bump parameter version number and some clarification

fix submodules
2016-09-06 11:33:18 +02:00
Dennis Shtatnov
b99b886576 CF2 correct motor map and LEDs 2016-09-04 19:12:08 +02:00
Lorenz Meier
5a734de319 Commander: Increase stack space 2016-08-29 23:36:34 +02:00
Lorenz Meier
ece70dc18d Revert "commander: Running a bit low on space"
This reverts commit 2a90f7e9c002ee80177b436f2fd0e5d196f3ea95.
2016-08-29 23:35:56 +02:00
Lorenz Meier
2a90f7e9c0 commander: Running a bit low on space 2016-08-29 22:47:07 +02:00
Lorenz Meier
1a9688c42f Commander: signal high memory usage 2016-08-15 14:58:33 +02:00
Daniel Agar
2a15578f8d FW implement MAV_CMD_DO_GO_AROUND 2016-08-06 20:56:53 +02:00
Julian Oes
fd6ad6565c commander: use hysteresis lib for auto_disarm
Since the auto disarm hysteresis was implemented wrongly, it's now
replaced with the hysteresis library call.
2016-07-30 12:26:56 +02:00
Beat Küng
7b52eced66 commander: write timestamp of commander_state topic on init and state change 2016-07-19 09:21:35 +02:00
Julian Oes
631ce1fc55 commander: proper arguments for preflight check 2016-07-13 10:10:45 +02:00
Daniel Agar
59b4350aa0 implement MAV_CMD_NAV_LOITER_TO_ALT and general mission cleanup 2016-07-12 23:36:05 +02:00
Beat Küng
8e136779ec stack sizes: reduce stack sizes for modules that use sensor_combined
The sensor_combined topic got reduced from ~780 bytes to 72 bytes.
2016-07-07 11:35:50 +02:00
Beat Küng
c5ea4b43be sensor_combined.msg: make timestamps relative
This is needed for the new logger & saves some space as well.
2016-07-07 11:35:50 +02:00
Beat Küng
d846ad5dac sensors: move voting into sensors module
- voting is now at a central place instead of duplicated within the
  estimators
  -> this also means that estimators that did not do voting so far,
     now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
  sensors
- allows sensors_combined to be 3 times smaller
  - reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
  the voted result
- this also adds voting to baro
2016-07-07 11:35:50 +02:00
Lorenz Meier
82b2fa5ecb Commander should not depend on MAVLink 2016-07-01 18:04:09 +02:00
Lorenz Meier
2214e7c202 Commander: Remove annoying GPS fix regained warning 2016-06-30 16:59:17 +02:00