4666 Commits

Author SHA1 Message Date
Mark Charlebois
09718fa324 Revamped debug macros
Created px4_debug,h to define:

PX4_DBG
PX4_INFO
PX4_WARN
PX4_ERR

These enable OS specific mappings to be made, filtering, etc.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-27 21:58:54 -07:00
Mark Charlebois
58a33dd26a Added simulated tone_alarm and enabled led for POSIX
Added simulated tone_alarm class and enabled led class for posix build.

The simulator implements the led_init, led_on, led_off, led_toggle calls.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-27 14:00:06 -07:00
Mark Charlebois
d913ec8dc9 Changed device::px4_device_handle_t to device::file_t
This change allowed the _posix.cpp file changes to be merged
back into the original files.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 17:49:35 -07:00
Mark Charlebois
20d35e33da Platform header file cleanup and consolidation
Removed obsolete porting cruft from px4_XXX.h files and merged the
POSIX changes in PreflightCheck_posix.cpp back to PreflightCheck.cpp

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 11:45:14 -07:00
Mark Charlebois
58a73a5392 Fixed list of SRCS in mavlink_tests/module.mk
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 01:56:09 -07:00
Mark Charlebois
a1332e699c QuRT and POSIX changes - part 5
Last part of the main QuRT related changes

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 01:39:25 -07:00
Mark Charlebois
187f13cd70 QuRT and POSIX changes - part 4
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 01:24:31 -07:00
Mark Charlebois
c802beb3d7 QuRT and POSIX changes - part 3
More staged changes to support QuRT and related POSIX changes

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 01:13:08 -07:00
Mark Charlebois
071c4c1a9e Updated module.mk for changed file names
sensors_x.c were consolidated to sensors.c

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 01:05:49 -07:00
Mark Charlebois
3336fce1f4 QuRT and POSIX changes
Partial commit of the changes for QuRT and related changes for POSIX

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 00:52:44 -07:00
Mark Charlebois
e764c68d0a mavlink: consolidated nuttx and posix changes
Removed nuttx and posix specific files for mavlink_ftp and mavlink_receiver.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 11:08:19 -07:00
Mark Charlebois
d63d2f7a61 Posix: removed obsolete file mavlink_main_posix.h
The changes for __PX4_POSIX are in mavlink_main.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 10:41:32 -07:00
Mark Charlebois
f63ab3d5e3 Merge branch 'master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	makefiles/firmware.mk
2015-04-22 10:38:46 -07:00
Mark Charlebois
8e500f543e Combined nuttx and posix mavlink_main headers
Removed the separate implementations of mavlink_main_X.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 09:39:02 -07:00
Mark Charlebois
7aac0e94db Posix: disable stack size check
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 07:50:45 -07:00
Roman Bapst
67956341e6 FireFly6: make landing gear manual pass-through 2015-04-22 13:40:49 +02:00
Roman Bapst
5b772e5720 update vehicle status before doing preflight checks 2015-04-22 13:32:09 +02:00
Lorenz Meier
5e584c2942 commander: Better low battery failure feedback 2015-04-22 09:27:03 +02:00
Mark Charlebois
36a9f7a818 Posix: fixed calls to open that should be px4_open
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 23:26:14 -07:00
Mark Charlebois
da29004a26 Sync state_machine_helper_posix to state_machine_helper
state_machine_helper_posix.cpp was out of sync with
state_machine_helper_posix.cpp.

Added debug to detect when sensors is started before uorb.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 22:04:01 -07:00
Mark Charlebois
3f7d4de74a Posix: fixed ioctl calls to be px4_ioctl
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 17:26:07 -07:00
Mark Charlebois
19162ba5be Posix: Changed PreflightCheck to read Vdev
PreflightCheck was failing because it was trying to read actual
devices instad of virtual devices.

ADCSIM had a LINUXTEST ifdef that was removed.

posix_run.sh was using the wrong path

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 17:14:52 -07:00
Don Gagne
08123df83a Remove PX4_PARAM_DEFINE_* usage to get better meta data 2015-04-21 12:32:01 -07:00
Don Gagne
638be07c2c Use new @board attribute for ifdef's 2015-04-21 12:31:30 -07:00
Lorenz Meier
39f6e13c18 Merge pull request #2061 from PX4/rssi_cleanup
IO RSSI handling: Fix RSSI for all protocols.
2015-04-21 19:39:08 +02:00
Mark Charlebois
f3b5076d70 Linux to posix conversion
Changed "linux" target to "posix". Most of the changes are shared with
QuRT and with OSX. The Linux specific parts are in for i2c which uses
<linux/i2c.h> and <linux/i2c-dev.h>.

There is also a check for __PX4_LINUX in mavlink for a tty ioctl that is
not supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 09:53:09 -07:00
Lorenz Meier
09ae879b82 RC input: Replace magic numbers with better numbers, cap output to 0-100 2015-04-21 17:46:21 +02:00
Roman Bapst
15f11ae1e2 add control output for tilting rotors 2015-04-21 13:22:57 +02:00
Lorenz Meier
4440c6383c IO RSSI handling: Make 0-RSSI value consistent for all input sources 2015-04-21 10:48:40 +02:00
Lorenz Meier
027919302d IO RSSI handling: Fix RSSI for all protocols. 2015-04-21 10:40:42 +02:00
Andreas Antener
9c282cf6d6 added parameters to specify range and channel, caping result 2015-04-21 07:01:58 +02:00
Lorenz Meier
8279de5a0b MAVLink app: Cleanup RC channel messages / handling 2015-04-21 06:58:03 +02:00
Lorenz Meier
5a8eca75bf Commander: Fix RTL mode switch logic 2015-04-21 06:54:16 +02:00
Lorenz Meier
b9d17241a3 RTL mode switching: Allow to flick to RTL in any mode. 2015-04-21 06:54:15 +02:00
Mark Charlebois
260bbcb64a Nuttx: fixups after rebase on Linux
Seems that mavlink_receiver_linux.cpp inherited the history
from mavlink_receiver.cpp so updates went to it vs mavlink_receiver_nuttx.cpp

Two module.mk files used ifdef instead of ifeq.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:57:02 -07:00
Mark Charlebois
36d17a061e Linux: Update mavlink files to track nuttx upstream
Modified LInux impl to track changes to nuttx impl.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:09:54 -07:00
Mark Charlebois
612579c809 Removed check for isfinite as no longer needed
PX4_ISFINITE resolves the definition of isfinite.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:08:06 -07:00
Mark Charlebois
455b0dcaff Fixed parenthesis bug
Clang found the following:
       if (fabsf(airspeed.indicated_airspeed_m_s > 6.0f))

which is doing fsbsf( bool )

Fixed to be:
       if (fabsf(airspeed.indicated_airspeed_m_s) > 6.0f)

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:04:46 -07:00
Mark Charlebois
f44a23bc26 Check stack for commander only for NuttX
Turn off check of stack if not a NuttX build

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois
d2f0572ce6 Linux: added builtins to show devices and topics
list_devices will list virtual devices starting with "/dev/".
list_topics will list topics ("/obj/")

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
694427e4ba Converted commander to use px4_posix calls
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
bba26c3430 Linux: enabled commander module
The commander module now compiles for Linux.

state_machine_helper_linux.cpp iterates over the virtual devices vs
all devices under /dev as per NuttX when disabling publishing.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
88dc6ec1e5 Simulator: use template for Reports
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
93c39e6d1d Linux: Added barosim support to simulator
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
89bc1b86b2 Linux: connected gyrosim to Simulator
Simulator gets incoming MPU data and gives raw MPU data to the
gyrosim sensor when read.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
ac1679dbc3 Added simulator
Simulator listens for UDP input data at port 9876.

Data is for now comma separated. Not yet connected to the various sim
classes: accelsim, gyrosim, magsim.

Barometer measurements not yet supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:49 -07:00
Mark Charlebois
639afeb28f Fixed issue with argc check
Was checking if argc < 1 and then accessing argv[1]. Fixed by
checking if argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois
ec1b77c9e1 Linux: GCC static data is 16byte aligned, messes up param
GCC 4.8 and higher implement 16 byte static data alignment on 64-bit.
This means that the 24-byte param_info_s variables are 16 byte aligned
by GCC and that messes up the assumption that the address of the second
parameter is at &param[0]+sizeof(param[0]).
When compiled with clang it is true, with gcc is is not true.

See https://llvm.org/bugs/show_bug.cgi?format=multiple&id=18006

The fix is needed for GCC >=4.8 only. Clang works fine without this.

Added __attribute__((aligned(16))) to first member of param_info_s.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois
eab32572f4 Linux: Added thread safe getopt
The getopt command uses global variables and is not thread safe.

Created a minimal px4_getopt version that supports options with
or without an arg, and random placement of options on the command line.

This version modifies the order of the args in argv as does the
POSIX version of getopt.

This assumes that argv[0] is the program name. Nuttx may not support
that properly in task_spawn.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois
894611df04 Linux: Fixed argc check in sensors_main
Was checking for argc < 1, and should be argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00