Commit Graph

6569 Commits

Author SHA1 Message Date
Mark Charlebois 2feeecdab1 Linux: Added config and stubs to compile I2C device for Linux
Not yet functional. Full implementation will provide an IOCTL interface to
do bi-directional transfer. will model the interface after Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois 598b05fcba Linux: run threads without SCHED_FIFO if not privileged
When running the process without sufficient privilege to use
real time scheduling, warn the user and run with SCHED_OTHER.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 4a6bd4ddc0 Linux: replaced getopt in ms5611_linux.cpp
ms5611 uses getopt to parse args but the static variable
optind was not being properly updated.

Replaced use of external getopt call with simple parser;

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois ac0df5c61d Linux: added HRT test, moved tests to linux/tests
Also fixed naming of mavlink files for NuttX build.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 99399115f2 Linux: Minor fixes of error caught by gcc-4.9.1
- Missing static declarations for functions not used outside a file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 88a0081112 Linux: Added support for gcc-4.9.1
Fixed bug with missing quote in #error found by gcc 4.9.1

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois d013ac0927 Support for building more modules with Linux
Added more queue support to linux/px4_layer.

Use virt char devices for ms5611, and mavlink.

Added more HRT functionality. uORB latency test
now fails. Likely due to bad HRT impl for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 2abfb7a5be Linux: added queue files for dataman support
The dataman module now works under linux using /tmp/dataman as the
file path. Two files from NuttX were added to the Linux impl for
single linked queue handling.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois fd7863270e Nuttx: fixed missing changes from AppMgr to AppState
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois 7b0783a070 Added MuORB based on virtual CDev implementation
uORB module now compiles and runs for Linux using the
virtual CDev implementation.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois 938751993d Changed AppMgr to AppState
The previous name implied some kind of daemon. AppState is
aggregated state of an application's running state and interfaces
to request app termination, and check app state.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois 5259f1c861 Linux: add queue functions from NuttX and HRT stubs
The High Resilution Timer functions are stubbed out for now.

Certain queue functions are required to compile uORB so adding
the queue.c from NuttX.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:18 -07:00
Mark Charlebois 9718404d7f Added new file for virt dev posix-like functions and test case
Moved posix-like functions to vcdev_posix.cpp and updated the
copyright notice.

Added test case to make sure poll unblocks when a write occurs.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:17 -07:00
Mark Charlebois 97a72563b8 Fixes to compile again for NuttX
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:17 -07:00
Mark Charlebois 4016ad2ff5 Revert uORB to previous version
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:17 -07:00
Mark Charlebois f3596e555b Added
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois 0553a68a1a Fixed usage string for hello app
hello should have been hello_main

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois aeb65702a2 Fixed support for clang 3.5
"clang-3.5 -dumpversion" returns 4.2.1 as the GCC version.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois 35e00f0ba1 Added missing _PX4_IOC substitutions
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois 5084a61f0e Abstractions to compile systemlib for Linux and Nuttx
Modified uint32_t casts of pointers to unsigned long for portability.
It otherwise breaks on x86_64.

Added _PX4_IOC to handle the conflice between _IOC on Linux and NuttX.

Removed use of px4::ok() because it cannot be used in a thread based
implementation. Changed to use px4::AppMgr which uses ok() on ROS.

Removed up_cxxinitialize.c from Linux build.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:00:16 -07:00
Mark Charlebois 4a4fcb5d75 Linux: fixes for gcc
Fixes to compile with gcc

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:57:01 -07:00
Mark Charlebois 62f8bd6679 Linux build support for some libs
The following libs can now be built under Linux:

   lib/mathlib
   lib/geo
   lib/geo_lookup

The constants used for ROS are now shared with Linux in
px4_defines.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:57:01 -07:00
Mark Charlebois e3f152b5c1 Changed main_t to px4_main_t in systemlib.h
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -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 82a7fd5115 Code uses px4_config.h instead of nuttx/config.h
Use OS independent header file for config info.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:49:44 -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
Mark Charlebois 520459062d Initial Linux support including execution shell
Uncomment the following line in setup.mk and comment out the line above
to enable the Linux build.

   export PX4_TARGET_OS	 = linux

The build uses the clang compiler by default. The final bundled executable
is mainapp located in:

   Build/linux_default.build/mainapp

When you run mainapp it will provide a list of the built-in apps. You can
type in the commands to run such as:

   hello_main start

Because the Linux build is threaded and does not support tasks or processes,
it cannot call errx, exit() _exit(), etc. It also requires unique scoped
variables to test if a thread is running or if an application should exit.
The px4::AppMgr class was added in px4_app.h for this purpose. The
hello sample app demonstrates how this is used.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:46:43 -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
Lorenz Meier 7dbb6c4fa8 Commander: Improved preflight check routines. Running checks on all connected sensors. Re-run checks once GCS is connected. 2015-04-20 09:14:13 +02:00
Lorenz Meier 5c44146c1b sensors app: Be less verbose 2015-04-20 09:14:13 +02:00
Lorenz Meier d8c91b9fbd MAVLink app: Be less verbose 2015-04-20 09:14:13 +02:00
Johan Jansen 7a4ac0ad7f Commander: Ignore sensor status on in-air restore 2015-04-20 09:14:13 +02:00
Johan Jansen a6c57afabd Make: Remove deprecated preflight check 2015-04-20 09:14:13 +02:00
Johan Jansen 4654d0f4fc Commander: Enter ARMING_STATE_STANDBY_ERROR by default if preflight has failed 2015-04-20 09:14:12 +02:00
Johan Jansen b70138c631 Commander: Re-run preflight check after calibration 2015-04-20 09:14:12 +02:00
Johan Jansen c5a178a777 Commander: Play startup tune if preflight checks are good, play alarm otherwise 2015-04-20 09:14:12 +02:00
Johan Jansen 6f338eb1b2 Commander: Run preflight check on boot 2015-04-20 09:14:12 +02:00
Johan Jansen fde244f903 Commander: Add PreflightCheck to the commander 2015-04-20 09:14:12 +02:00
Lorenz Meier 1da048549a commander gyro cal: Optimize parameter set calls and allow up to 0.0055 rad/s deviation - tuned to allow in-field calibration, but fail anyone really rotating during the step 2015-04-19 16:06:52 +02:00
Lorenz Meier 1685f77031 Loosen the thresholds on gyro calibration based on in-field calibration feedback 2015-04-19 15:36:02 +02:00
Lorenz Meier ea2c6549e4 Attitude only EKF: Minor style cleanup, remove unused code 2015-04-19 11:59:31 +02:00
Lorenz Meier 8978278320 EKF combined att + pos estimator: Robustify against mag 0 vectors and timeouts 2015-04-18 20:49:18 +02:00
Lorenz Meier 3658bf83ed EKF att-only estimator: Do not fuse zero-length mag vector. 2015-04-18 20:34:44 +02:00
Lorenz Meier 1c8e79cbf1 sensors app: Always set a valid rotation, even if sensor is unconfigured 2015-04-18 20:34:18 +02:00
Johan Jansen b7a6f18ca6 AttPosEKF: Only fuse GPS velocity if they are valid 2015-04-18 17:23:19 +02:00