Commit Graph

772 Commits

Author SHA1 Message Date
Mark Charlebois 0cea93a55c POSIX and QuRT: fixed calls needing px4_ prefix
There were some missed calls to open and ioctl that need to be
px4_open and px4_ioctl.

QuRT also does not provide usleep() so px4_time.h has to be included
in files calling usleep.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-05 12:13:39 -07:00
Mark Charlebois 12a25e4b63 Merge remote-tracking branch 'upstream/master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	makefiles/firmware.mk
	src/modules/commander/module.mk
	src/modules/mavlink/mavlink_ftp.h
	src/modules/mavlink/mavlink_tests/module.mk
2015-05-04 16:36:59 -07:00
Lorenz Meier 0e78e38cda commander: Use pre-rotated topic in board frame 2015-05-04 14:06:19 +02:00
Mark Charlebois 523a4aa785 Clang warning fix
Clang build fails due to -Werr and warning on use of
if (!condition != other_condition && some_condition)

Clang wants to be clear that the initial '!' wasn't
intended for the whole expression.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-28 12:29:50 -07:00
Mark Charlebois 2446dfec16 Fixups after merge from master
MuORB was missing the orb_exists() function added to uORB.cpp

gyro_calibration.cpp still had some merge conflicts that had not been resolved.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-28 12:28:10 -07:00
Mark Charlebois 190814bc97 Merge remote-tracking branch 'upstream/master' into linux
Signed-off-by: Mark Charlebois <charlebm@gmail.com>

Conflicts:
	src/drivers/rgbled/rgbled.cpp
	src/modules/commander/PreflightCheck.cpp
	src/modules/commander/airspeed_calibration.cpp
	src/modules/commander/calibration_routines.cpp
	src/modules/commander/gyro_calibration.cpp
	src/modules/commander/mag_calibration.cpp
	src/modules/mc_att_control/mc_att_control_main.cpp
2015-04-28 11:48:26 -07:00
Roman Bapst be03f98d64 added esc calibration routines 2015-04-28 15:15:46 +02:00
Roman Bapst bd1c3363df added new vtol mav types 2015-04-27 22:22:52 +02:00
Simon Wilks ef63babb71 Make sure circuit breakers are ready before the first preflight check call. 2015-04-27 13:30:37 +02:00
Simon Wilks 868b9b33ed Make sure we log the airspeed check to the console as well. 2015-04-27 13:30:37 +02:00
Lorenz Meier 3f8c81433e commander: Provide more useful mission feedback 2015-04-27 09:07:53 +02:00
Lorenz Meier a57030c836 commander: Do not lock down the system once HIL has kickeed in 2015-04-26 18:27:48 +02:00
Lorenz Meier b07964660e commander: prune old code, do not run preflight checks when nothing relevant in the system is changing. 2015-04-26 17:39:00 +02:00
Lorenz Meier 362672ece8 commander: Fix calibration feedback so that QGC picks up all error conditions 2015-04-26 17:33:45 +02:00
Don Gagne a7f88d97b8 Sensor cal rework
- cancel support
- versioned cal messages
- better still detection
- better messaging
2015-04-26 14:34:19 +02:00
Lorenz Meier 6c9e5d1ecf commander: Only subscribe to existing telemetry status publications 2015-04-26 14:33:56 +02:00
Lorenz Meier bbb27b8635 commander: Reduce excessive stack size 2015-04-26 14:33:56 +02:00
Lorenz Meier 1b6742cebe commander: Better user feedback after resolving preflight check warnings 2015-04-26 12:04:16 +02:00
Lorenz Meier c7ecafe99b commander: Critical fix for arm state machine. Only auto-save if not stored already 2015-04-25 12:53:58 +02:00
Lorenz Meier 7e81778908 commander: Fix data link lost / regained logic 2015-04-25 10:15:15 +02:00
Lorenz Meier 75df06bc76 commander: Better text feedback in preflight-check 2015-04-25 09:43:54 +02: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
Lorenz Meier 5c4494b1c9 commander: Fixing HIL operation with failing preflight checks 2015-04-24 21:06:45 +02: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 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 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
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 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
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 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 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 9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Mark Charlebois bf429188b4 Reverted: Use OS independent API for task creation/deletion
Keep existing API use in code. Bind the use of the OS independent
implementation in the systemlib layer.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:49:44 -07:00
Mark Charlebois ddb32742eb Use OS independent API for task creation/deletion
Calls to task_delete and task_spawn_cmd are now
px4_task_delete and px4_task_spawn_cmd respectively.

The px4_tasks.h header was added to the affected files
and incusions of nuttx/config.h were removed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:49:44 -07:00
Lorenz Meier 0a526e2a5f commander: Provide feedback that preflight check failed. 2015-04-20 09:14:14 +02:00
Lorenz Meier 17e487cad4 Update commander test suite 2015-04-20 09:14:14 +02:00
Lorenz Meier c92afb99b6 Prearm check: provide user instruction to power cycle if things look good 2015-04-20 09:14:14 +02:00
Lorenz Meier 554719c78f Harmonize preflight and prearm checks, run same code except for dynamic range check only on arming 2015-04-20 09:14:13 +02:00
Lorenz Meier 4f0896b105 commander tests: Update test routine to match expected / designed error handling behaviour 2015-04-20 09:14:13 +02:00