315 Commits

Author SHA1 Message Date
Lorenz Meier
cba4bcd2fb Multiplatform controllers: Move to examples and fix code style 2016-08-07 10:40:17 +02:00
Lorenz Meier
ee5cdab963 Move old estimators to examples 2016-08-07 10:40:17 +02:00
Beat Küng
9c73eae941 sensor_combined: replace accel & gyro integral with value, use float for dt
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.

Note that this breaks the replay format for sdlog2 replay
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
Beat Küng
b4ecc5a8d9 sensor_combined cleanup: remove many unneeded fields
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.

Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.

Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.

At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
2016-07-07 11:35:50 +02:00
Beat Küng
8a12dee125 cmake: remove all module.mk files & cmake conversion script (#4918)
It seems these files are leftovers.
2016-06-28 09:26:36 +02:00
Daniel Agar
76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
James Goppert
967e4dd127 Modified cmake to use STACK_MAX and STACK_MAIN 2016-04-14 13:36:36 -04:00
Daniel Agar
51cd8ce1ff subscriber example param @unit 2016-03-14 09:10:29 +01:00
Lorenz Meier
2e9cec5b06 Simple app: Use enough stack 2016-01-05 19:01:16 +01:00
Lorenz Meier
669f8bf098 Matlab example: Use enough stack 2016-01-05 19:01:16 +01:00
Lorenz Meier
7c8a2a1e18 HW test example: Use enough stack 2016-01-05 19:01:16 +01:00
Lorenz Meier
977aee9f62 Simple app: fix code style 2015-12-23 09:38:21 +01:00
Lorenz Meier
8b76d5e941 Update simple app example to use multiplatform API 2015-12-23 09:12:29 +01:00
Lorenz Meier
7ce0cbd8cb Complete HW test instructions 2015-10-16 09:51:31 +02:00
Lorenz Meier
a1d6cfcfb7 Remove old module.mk files to not confuse new users 2015-10-08 10:58:34 +02:00
Lorenz Meier
75dfa5a420 Remove outdated flow position estimator 2015-09-12 09:53:36 +02:00
James Goppert
bf18c84652 Cleanup of module building. 2015-09-09 23:00:58 -04:00
James Goppert
1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Daniel Agar
0a4a1fc991 format src/examples/subscriber 2015-09-05 12:21:10 -04:00
Daniel Agar
9dd8864a1b format src/examples/rover_steering_control 2015-09-05 12:21:10 -04:00
Daniel Agar
293739ce20 format src/examples/px4_daemon_app 2015-09-05 12:21:10 -04:00
Daniel Agar
ad456bb7f2 format src/examples/publisher 2015-09-05 12:21:10 -04:00
Daniel Agar
a7056892f3 format src/examples/matlab_csv_serial 2015-09-05 12:21:09 -04:00
Daniel Agar
d2db6855ad format src/examples/flow_position_estimator 2015-09-05 12:21:09 -04:00
Daniel Agar
50d74e00ec format src/examples/fixedwing_control 2015-09-05 12:21:09 -04:00
Lorenz Meier
53d4c5473f Merge beta in master 2015-08-23 11:21:38 +02:00
Lorenz Meier
0d44510f67 Examples: Fix copyright 2015-08-23 10:12:40 +02:00
Mark Charlebois
a734fc96d1 extensive orb_advert_t fixes
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.

The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.

Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:41:33 -07:00
Mark Charlebois
95de7c2e94 ROS: Fixes for print of uint64_t type
Changed printf to use PRIu64

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 11:14:40 -07:00
Mark Charlebois
ce96329f95 Resolve printing uint64 types
Using %llu or %lu will break one of the build targets. The "right way"
to print a uint64_t is via the PRIU64 macro defined in C99.

This wasn't defined for the NuttX compiler so it was added to px4_defines.h
for NuttX.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 11:04:39 -07:00
Mark Charlebois
0f5cb75692 ROS: Fixes for ROS build
The ROS build included some files that used isfinite vs PX4_ISFINITE.

The AppState class also needed to be supported for ROS.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 10:41:15 -07:00
Mark Charlebois
9f391b1867 NuttX: fixes for NuttX build
In the upstream tree ringbuffer.h includes the method implementations
in the header file which causes multiple definitions in the link for
other targets. Changed so ringbuffer.cpp is build separately for other
platforms and is included by ringbuffer.h on NuttX.

uORB changes do not link without uORBTest_UnitTest.cpp enabled for
the NuttX build.

px4_getopt was not exported and wasn't visible in NuttX build.

The makefiles were restored to be as close as possible to upstream
so the NuttX build builtin's work again. The code will have to be
refactored after the merge.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-15 12:56:18 -07:00
Mark Charlebois
0c1c58c418 Fixed overzealous px4_ prefixing
Some files had px4_px4_ prefixed functions.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 15:32:04 -07:00
Mark Charlebois
c5237f7f6f Removed extra abstracton layer in systemlib
The calls to task_spawn_cmd, kill_all, and systemreset  were wrappers
around the px4_{task_spawn_cmd|kill_all|systemreset} implementations.

Removed the wrappers and changed all calls to the px4_ equivalents.

NuttX specific code was moved into px4_tasks.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 14:43:11 -07:00
Mark Charlebois
3654aec3a5 POSIX: ported px4_daemon_app
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 14:34:23 -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
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
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
Daniel Agar
2e824bbeea fix incorrect argc < 1 check for no arguments
-requiring arguments should be argc < 2
2015-04-18 12:02:58 +02:00
Lorenz Meier
4f0f2b0329 Merge pull request #1875 from mstuettgen/master
Latest rover changes
2015-03-20 17:17:13 +01:00
Marcel Stüttgen
9130976d9e Update main.cpp
removed debug output code
2015-03-20 17:01:52 +01:00
Daniel Agar
662ec3f62f examples fix code style 2015-03-19 23:49:36 +01:00
Daniel Agar
c2abb0f82a fix code style if trivial one line difference 2015-03-19 23:49:36 +01:00
Marcel Stuettgen
d0c6636b7f added debug code to check if the values are really changing 2015-02-28 17:25:51 +01:00
Lorenz Meier
15f729ddd5 Rover: C++ify, minor cleanups 2015-02-19 22:14:50 +01:00
Lorenz Meier
e59aaa771c Rover: Add simple steering controller. 2015-02-19 21:51:53 +01:00
James Goppert
017f3ead47 Flow example fix for divide by zero.
This prevented publishing and made the module unusable.
2015-02-11 21:05:40 -05:00