Commit Graph

7903 Commits

Author SHA1 Message Date
Lorenz Meier c0a406b81f LPE: Clean up vision timestamps 2016-07-10 12:43:34 +02:00
Lorenz Meier 826eaed2ee EKF2: Clean up vision timestamps 2016-07-10 12:43:21 +02:00
Lorenz Meier 4f875560b7 Att Q Estimator: New vision timestamp 2016-07-10 12:43:10 +02:00
tommises 19b56c1574 Use timestamp received from companion computer as timestamp_boot 2016-07-10 12:29:19 +02:00
tommises 5bd574dd05 Fixed timestamp synchronization 2016-07-10 12:29:19 +02:00
tommises f69e9a3d37 Fixed VISION_POSITION_ESTIMATE.usec
Fixed units to be microseconds and not milliseconds.
2016-07-10 12:29:19 +02:00
Miguel Arroyo 3c11c0d8d8 Adds Calibration Support for RPi2 and Navio2 (#4999) 2016-07-07 22:38:17 +02:00
Julian Oes ddba274496 sdlog2: fix poll_counter that I broke earlier 2016-07-07 16:48:27 +02:00
Julian Oes 03dbcf5464 sdlog2: don't forget to copy after poll
The previous changes broke sdlog2 on NuttX because no orb_copy was
called after polling in the case when sdlog2 was not actually logging.
2016-07-07 16:48:27 +02:00
Julian Oes 772dc302b6 sdlog2: raise min write size back
Turns out in practice there was not really a difference, so there was
no reason to change it.
2016-07-07 16:48:27 +02:00
Julian Oes fe91527604 sdlog2: poll for sensor and replay on Snappy
This brings better performance, so less missed updates on Snappy, as
well as a bit of a cleanup of the poll and orb_copy logic.
2016-07-07 16:48:27 +02:00
Julian Oes 5f18f9bbba sdlog2: select MIN < MAX bytes to write
Previously, the MAX and MIN were both 512 meaning that usually it would
start writing at > 512 bytes but only write 512 bytes which results in
a 512 bytes write shortly followed by a e.g. 30 bytes write.

Also, performance (measured in missed poll updates) seems slightly
better on Snapdragon with bigger chunks.
2016-07-07 16:48:27 +02:00
Beat Küng 168c744232 replay: fix string printf output: add .c_str() 2016-07-07 12:51:42 +02:00
Beat Küng 6e44760819 replay: add 'tryapplyparams' command
This only applies parameters from the log file and user-supplied overrides.
It is intended to be called as one of the first startup commands (after
param load), so that during startup, all applications find the parameters
from the replayed system.

Note that this is an optional command and 'replay start' will again load
and apply the parameters in any case.
2016-07-07 12:51:42 +02:00
Beat Küng 84a1a10006 logger: check if we are in replay mode via ENV variable 'replay' 2016-07-07 12:51:42 +02:00
Beat Küng 28ad6066aa replay: add replay module, build for sitl_default, but do not load on startup
This adds a new module that does:
- read an parse an ULog file, given via ENV variable 'replay'
- apply all parameters from the log file
- read and apply user-defined override parameters from a file
- publish all messages in 'real-time' from the log file and add a constant
  offset to the timestamp to match the system time.
- apply changed parameters in the log (which are not overridden)
2016-07-07 12:51:42 +02:00
Beat Küng ffcefd9047 orb: read & apply publisher rules from file (currently disabled via #ifdef)
If enabled, orb reads a rules file (./rootfs/orb_publisher.rules) on
startup. This can contain rules about which module is allowed to publish
which topic. It is completely transparent, so a publisher does not know
if he's not allowed to publish, and publications will look as if they
succeeded.

To test, add
#define ORB_USE_PUBLISHER_RULES
to uORBManager.hpp
2016-07-07 12:51:42 +02:00
Daniel Agar 4252511b8e add bitmask param metadata 2016-07-07 12:42:59 +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 8e136779ec stack sizes: reduce stack sizes for modules that use sensor_combined
The sensor_combined topic got reduced from ~780 bytes to 72 bytes.
2016-07-07 11:35:50 +02:00
Beat Küng c5ea4b43be sensor_combined.msg: make timestamps relative
This is needed for the new logger & saves some space as well.
2016-07-07 11:35:50 +02:00
Beat Küng c66f26245c sensor_combined.msg: use uint32 for integral_dt
There is no reason to make this 64 bit. The same should be done in
the sensor raw messages, together with further cleanup.
2016-07-07 11:35:50 +02:00
Beat Küng 30301187f0 cleanup sensors_init: remove the static const int ERROR and use PX4_ERROR 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 c50d267bfb sensors: cleanup includes and logging (warnx -> PX4_WARN/ERR/INFO) 2016-07-07 11:35:50 +02:00
Beat Küng 0c30ee8d37 fix resource leak in attitude_estimator_q_main: unsubscribe topics 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 c407123a72 cleanup sensor_combined: remove adc & differential_pressure fields
These are not really used. differential_pressure is just copied from the
topic with the same name.

for sdlog2 we assume no one needs the diff pressure fields and set it to 0.
We plan to switch to the new logger soon anyway.
2016-07-07 11:35:50 +02:00
Beat Küng 2c2477a07d fix sensors leaks: unsubscribe topics when exiting 2016-07-07 11:35:50 +02:00
Beat Küng ac45c9001b sensors: cleanup syntax: replace &x[0] with x 2016-07-07 11:35:50 +02:00
Beat Küng 78b45c4778 sensors: remove duplicated initialization 2016-07-07 11:35:50 +02:00
Beat Küng ddc4d70d51 airspeed_calibration: remove unused include 2016-07-07 11:35:50 +02:00
James Goppert 056f73f5d2 Changed LPE distance sensor timeout logic. (#4996) 2016-07-06 10:31:55 -04:00
Beat Küng 09ecc84cc7 gps file dump: re-implement with an uORB topic & write to the log file (#4987)
Drawbacks of the previous method: when writing to the SD card, there are
high delays in the write() call of several 100ms, every now and then. The
frequency and length of these events depend on:
- SD card
- used logger bandwidth
- bandwidth of gps data (RTCM)
Since the whole gps thread was blocked during this period, it lead to
gps timeouts and lost module.

What we do now is: publish an orb topic with queuing. This makes it async
and the logger takes care of buffering. This means it's best to:
- use high logger rate
- use large logger buffer
- reduce logger bandwith by disabling unused topics
2016-07-06 09:32:37 +02:00
James Goppert 09ddc24801 Added agl smoothing to LPE. (#4976) 2016-07-05 16:54:08 -04:00
Julian Oes 3524fd7d24 ekf2: don't ignore function argument (#4990) 2016-07-05 17:40:37 +02:00
Ivan Dimitrov e342299204 Fixed filename in the Doxygen field. See issue "wrong doxygen descriptor (file name) #4979" 2016-07-05 15:17:05 +02:00
Beat Küng c4e77cf411 logger: fix '-r 0' parameter: should be unlimited rate instead of 1Hz 2016-07-05 14:08:25 +02:00
Beat Küng c94fe845ec fix logger: remove space in format for changed parameters 2016-07-05 14:08:25 +02:00
Beat Küng a455962e17 logger: only call write_add_logged_msg when sucessfully subscribed 2016-07-05 14:08:25 +02:00
Daniel Agar 7f89994785 use NAV_ACC_RAD for vertical waypoint acceptance (#4978) 2016-07-04 21:41:16 +02:00
Daniel Agar a9a3050682 EKF2 HIL gps decrease s_variance_m_s 5.0 -> 1.0 (#4973) 2016-07-04 08:18:15 +02:00
Lorenz Meier d85e416680 Fix default handling for battery params 2016-07-02 12:59:49 +02:00
Lorenz Meier 972a6f7be8 Fix MAVLink reporting of Firmware version, implement dev / release version reporting 2016-07-02 11:43:24 +02:00
tumbili 7e282f579b sensors app: logic fixed and cleanup
- do not exit sensors app if sensor init failed
- do not spam console if we fail over first/second gyro

Signed-off-by: tumbili <roman@px4.io>
2016-07-01 23:11:38 +02:00
Hidenori 506d1855ff rename files and add navio target 2016-07-01 23:08:17 +02:00
Hidenori 76ee17e532 RC input and PWM output for Navio2 2016-07-01 23:08:17 +02:00
James Goppert cb3120764a Made LPE var pub threshold a parameter. (#4959) 2016-07-01 13:27:29 -04:00
Lorenz Meier ed19d1ff6b EKF2 wrapper: Optimize for size 2016-07-01 18:22:56 +02:00
Lorenz Meier 82b2fa5ecb Commander should not depend on MAVLink 2016-07-01 18:04:09 +02:00