Commit Graph

481 Commits

Author SHA1 Message Date
Julian Oes
4ee8c43ea2 mavlink: send attitude quaternion in onboard mode 2017-02-13 21:38:10 +01:00
Julian Oes
aaa24b0cc8 Reduce attitude rate but add Quaternion 2017-02-08 12:47:34 +01:00
David Sidrane
8ba1ffafec mavlink uses simpler common bord indentity api 2017-02-04 22:27:04 +01:00
Daniel Agar
6631e72d6f clang-tidy modernize-redundant-void-arg 2017-02-01 22:15:50 -05:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
David Sidrane
e6ba897b9a mavlink is using board_get_uuid_raw32 instead of mcu_unique_id 2017-01-25 07:43:11 +01:00
Lorenz Meier
d1fcd8dd8e Fix code style for mavlink main 2017-01-14 07:47:03 -08:00
Lorenz Meier
4939e42c0f MAVLink main: Fix resource leak for non-NuttX cases 2017-01-14 07:47:03 -08:00
Lorenz Meier
4dc96e3ea1 MAVLink app: Remove flow control warning to clean up the boot log 2016-12-26 13:55:04 +01:00
Lorenz Meier
8a58cf0daa Fix usage of CRTSCTS define from termios.h
NuttX had the CRTSCTS define incorrectly set for only output flow control, which broke our flow control logic. This commit patches NuttX and puts in addition a guard in place to prevent any future issue with the non-POSIX define being incorrect.

This has been debugged and identified by @ecmnet, which was the main contribution for this patch.
2016-12-26 12:08:05 +01:00
Lorenz Meier
737e18dccb MAVLink app: Fix VTOL reporting and prevent mission reached spam
The VTOL status reporting and the mission status reporting were both suboptimal. VTOL was too slow, mission reporting too fast
2016-12-25 18:15:51 +01:00
Julian Oes
8aede5d32b mavlink: add 500000 baudrate 2016-12-21 11:44:47 +01:00
Lorenz Meier
6b9d95648f MAVLink app: Fix flow control handling flags 2016-12-21 11:44:47 +01:00
Beat Küng
41dc34204c version cleanup: move all version information into version.c and use a common API
The provided versioning information is the same, except for some additions,
like OS version (which still need to be implemented on NuttX).
2016-12-21 11:35:10 +01:00
David Sidrane
3ed0bfe0d8 Nuttx added FIONSPACE and fixed FIONWRITE: had retuned the space and should have returned enqueued count 2016-12-21 08:34:21 +01:00
Daniel Agar
bce7ecb0f6 Iridium driver and support
Mavlink module implement HIGH_LATENCY (Iridium)
2016-12-14 08:20:01 +01:00
José Roberto de Souza
508c782bab mavlink: Add support for high speed baudrates 2016-11-28 09:21:12 +01:00
Julian Oes
43caf2b683 Revert "mavlink: copy chars of git hash instead of binary"
Pushed by accident.
This reverts commit 87f0ec19e4.
2016-11-23 10:57:05 +01:00
Julian Oes
87f0ec19e4 mavlink: copy chars of git hash instead of binary
I could not figure out how to make sense out of the binary git data.
Therefore, I replaced the px4_git_version_binary with the first 8 bytes
of px4_git_version (char[]) and this is easily readable when it arrives
on the other side.
2016-11-23 10:48:17 +01:00
Andreas Antener
dd8d178168 MAVLink Streams: added collision stream 2016-11-19 14:46:20 +01:00
lovettchris
8a2399eee1 Fix multithreading bug in mavlink over serial port. 2016-11-19 00:24:15 +01:00
Beat Küng
ab4d7dfc59 mavlink: stop ulog streaming when mavlink thread exits
'mavlink stop-all' during a log streaming session previously led to a
resource leak, and log streaming could only be re-started by rebooting the
system.
2016-11-04 11:08:06 +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
7415d94e12 mavlink: don't publish HIL_CONTROLS in HIL mode
it generates unnecessary load. If really needed, it can still be enabled
manually.
2016-10-20 18:54:47 +02:00
Beat Küng
318c970477 mavlink ulog streaming: add rate limiting
This limits the maximum bandwidth of ulog streaming to 70% of the specified
mavlink datarate. If less is used, the leftover is assigned to the mavlink
streams, if more is used, it starts to drop.

mavlink status outputs the currently used rate, to check if a link is
saturated.
2016-10-19 13:13:47 +02:00
Beat Küng
7d72f31a29 mavlink: integrate MavlinkULog into the main Mavlink task & receiver 2016-10-19 13:13:47 +02:00
Beat Küng
9ceb5a7e2e mavlink: extend status output 2016-10-06 09:01:57 +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
1b69f9cb23 mavlink: don't miss first vehicle_command_ack
This fixes a corner case where the first advertise/publish of a
vehicle_command_ack was missed. What happened was that the
orb_subscribe_multi was not called until the topic had been published
and therefore orb_exists was happy. This means that by the time
orb_subscribe_multi was finally called, the first vehicle_command_ack
was already history and not detected by orb_check.

This changed adds a flag to the MavlinkOrbSubscription which tells it to
subscribe to a topic from the beginning.
2016-09-30 08:02:55 +02:00
Julian Oes
047c0e44bd mavlink_mission: support missions with int params
This brings support for the messages MISSION_REQUEST_INT and
MISSION_ITEM_INT which raises the lat/lon accuracy for waypoints.
2016-09-26 22:55:21 +02:00
Dennis Shtatnov
52fdbf4acc Syslink Bridge to Mavlink (#5479) 2016-09-11 11:23:15 +02:00
Beat Küng
90c7b06152 mavlink hil: add HIL_CONTROLS publication for compatibility (eg. with mavros) 2016-09-06 11:33:18 +02:00
Beat Küng
010c9e937b SITL: switch to HIL_ACTUATOR_CONTROLS mavlink message & add pwm_out_sim support for 16 outputs 2016-09-06 11:33:18 +02:00
Dennis Shtatnov
e91821d2a2 Merge Crazyflie motor driver with FMU
Comment corrections
2016-09-04 19:12:08 +02:00
Dennis Shtatnov
e6b98b2ab8 Tweak configs for CF2
Fix build error

Capitalization mistake for headers

Non-Mac compiler issue

Baudrate for crazyflie nrf and fix code style

Save space

Cleanup mpu9250 driver
2016-09-04 19:12:08 +02:00
Tim Dyer
b65ff53b00 Initial build for Crazyflie 2.0
Working crazyflie firmware build

* Console on USART3
* Could not disable building PX4IO firmware, currently commented out

Don't build PX4IO firmware if the board doesn't ask for it

Added crazyflie motor driver

Fixed wrong register

CLK_SEL is in PWR_MGMT_1

Initial I2C/SPI MPU9250 device

* Tested with I2C
* Need to add error checking
* Intermittent crash on stop call

Working ak8963 mag driver

Functional lps25h driver. Work in progress.

Works well enough to probe and allow sensors task to start.

Added serial port test module

HACK! Get sensors module working

Set crazyflie PWM range

Extend baudrate for Crazyflie's NRF radio

Added dummy tone alarm to allow for init

Added autostart script for Crazyflie
2016-09-04 19:12:08 +02:00
Lorenz Meier
8dc8ae7de8 MAVLink app: Only hold buffers for published topics 2016-08-28 10:49:41 +02:00
Lorenz Meier
d4b588f84a Fix proto version selection 2016-08-28 10:40:00 +02:00
Lorenz Meier
6f19531ce4 MAVLink: Cleanup of port handling, switch to MAVLink 2 if receiving MAVLink 2. Announce MAVLink 2 capability in autopilot_version message
commit
2016-08-28 10:08:15 +02:00
Lorenz Meier
720c445f21 MAVLink: Code style 2016-08-26 23:43:33 +02:00
Lorenz Meier
e67a6bdfc2 MAVLink: No need to restore previous port config on exit 2016-08-26 23:38:46 +02:00
Lorenz Meier
39ce001c41 MAVLink: use only the memory it needs 2016-08-15 19:53:21 +02:00
David Sidrane
deeefe5dd1 Describe the issues that requires the +=2 on arg[c|v] for NuttX (#5293)
This may be moot and should be revisited if only px4_getops is used, but this pr politely documents the reson for the logic.
2016-08-10 06:19:59 -10:00
Beat Küng
2241ab9cac mavlink: add a shell using SERIAL_CONTROL MAVLink message 2016-07-29 13:07:17 +02:00
Julian Oes
3ed8b735c2 mavlink: only warn once if broadcast fails
This fixes the issue where the console was spammed if a broadcast failed
after a connection had previously been established.
2016-07-13 19:40:59 +02:00
Julian Oes
d9343fa925 mavlink: use new copy_if_updated interface 2016-07-13 10:10:45 +02:00
Lorenz Meier
71d150f6ec MAVLink app: Fix rate handling 2016-07-10 17:05:33 +02:00
tommises
d2194d787f Refactored Mavlink stream configuration (#5015)
Streams ordered same way in all modes.
2016-07-10 16:22:22 +02:00
Lorenz Meier
972a6f7be8 Fix MAVLink reporting of Firmware version, implement dev / release version reporting 2016-07-02 11:43:24 +02:00
Hidenori
76ee17e532 RC input and PWM output for Navio2 2016-07-01 23:08:17 +02:00