512 Commits

Author SHA1 Message Date
Daniel Agar
46a697787f log all raw diff pres and airspeed 2016-11-19 15:15:36 +01:00
Dennis Shtatnov
a634c14582 Scale throttle outputs by battery level. Fixes #4751 2016-11-19 14:55:52 +01:00
CarlOlsson
106c882cea modified logging 2016-11-15 23:58:05 +01:00
Lorenz Meier
ee314d2f50 Remove unused gx, gy, gz fields from attitude 2016-10-18 20:46:08 +02:00
tumbili
38b949a5aa calculate euler angles for logging 2016-10-18 20:46:08 +02:00
tumbili
5e0e522903 adapted to new vehicle attitude message 2016-10-18 20:46:08 +02:00
Paul Riseborough
ed0cc2af43 sdlog2: log ekf output predictor tracking errors 2016-10-13 09:06:41 +02:00
Paul Riseborough
66e887e581 sdlog2: log estimator innovation test pass/fail data 2016-10-11 08:52:35 +02:00
Beat Küng
ce0d31b7d9 mavlink log: ensure all critical & emergency msgs are also logged to console & ulog
Critical messages that the user sees should also go to the log file, so
that the exact error (with time) can later be analyzed from the log file.
2016-09-30 13:50:51 +02:00
Julian Oes
8ff237c69f Remove size optimization for individual modules
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
2016-09-30 08:11:51 +02:00
Lorenz Meier
f815d9fa74 sdlog2: Adjust writer stack size 2016-09-11 20:07:30 +02:00
Lorenz Meier
8c49372e7a Better error reporting for sdlog2 2016-09-04 18:47:41 +02:00
David Sidrane
deeefe5dd1 Describe the issues that requires the +=2 on arg[c|v] for NuttX (#5293)
This may be moot and should be revisited if only px4_getops is used, but this pr politely documents the reson for the logic.
2016-08-10 06:19:59 -10:00
Beat Küng
8aa3b245a5 fix sdlog2: use LOG_DGPS_MSG for second gps (#5235) 2016-08-04 17:18:02 +02:00
Julian Oes
c4cb916afa Fix sdlog2/logger path/file name overflows. (#5138)
* logger: prevent logpath buffer overflows

The handling of the log path had the potential to cause buffer
overflows, especially on POSIX platforms where the paths are often much
longer than just 64 chars.

* sdlog2: prevent logpath buffer overflows

When the log folder path was created, this was done with the unsafe
sprintf function instead of snprintf. This caused buffer overflows in
SITL but the overflow was usually not detected until recent testing of
some work in progress.
2016-07-27 00:55:29 -07:00
Beat Küng
5b85fdb636 fix sdlog2 replay: changed format string from 9c73eae941c (#5090) 2016-07-18 15:25:49 +02:00
Beat Küng
ee58f0d11d encoders.msg: remove this topic, it's never published (#5074) 2016-07-15 14:59:52 -07: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
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
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
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
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
James Goppert
00dfc99e08 LPE Variance Dependent Publication (#4914)
* Use variance to control publishing for LPE.

* Don't stop publishing if we have gps/ baro.

* LPE tuning and cleanup.

* Added bias saturation to LPE.

* Added vector enabled low pass filter block.

* Added rk4 integration and pub lowpass to LPE.

* Fix std::abs issue on mac/ reset lowpass on state reset.

* Don't estimate gyro bias when rotating at high speed  att_est_q.

* Lowered low pass on position to 5 Hz for LPE.

* Streamline state space update for LPE.

* Added health flags to est2 log.

* Revert to old tuning, more conservative, less faults.

* Formatting.

* Fix for fault message on LPE.

* Added subscription throttling to LPE.

* Formatting.
2016-07-01 11:43:09 -04:00
Julian Oes
f4f0892b25 sdlog2: no new sessXXX folder on every arm (#4775)
Previously, if no time was set, sdlog2 created a folder like sess001,
sess002 for every logfile. The logfiles would then always be named
log001.px4log and their numbering would not actually increase.

This is now fixed and a new folder is only created per boot.
2016-06-10 08:48:37 +02:00
CarlOlsson
9c170f7fae added parameter which defines threshold for airspeed given to the filter
remove unnecessary replay fields
2016-06-08 17:11:10 +02:00
Julian Oes
4827f0d931 sdlog2: removed a printf 2016-06-07 22:10:56 +02:00
Paul Riseborough
2e127a4737 sdlog2: Add external vision data to ekf2 replay
Put struct definitions in enum order
Fix duplicate enum value
Add ekf2 replay message for external vision data
2016-05-28 14:54:14 +02:00
Julian Oes
af06737e7e sdlog2: fix Segfault on Eagle (#4638)
Since orb_exist doesn't work on the Snapdragon Linux side, we need to do
an additional orb_check after the orb_subscribe_multi, otherwise we copy
garbage.

The segfault was triggered by a count/length information about ESC
packets which lead to access outside the struct in the garbage case.
2016-05-25 21:50:23 +02:00
Beat Küng
7f3a95508e logger: move SDLOG_UTC_OFFSET param definition into logger module
It's still used in sdlog2, but once we'll depricate/remove sdlog2, we will
not remove this parameter as well.
2016-05-22 13:31:35 +02:00
Sebastian Verling
c1cdef7e63 fixed multi subscribing and publishing
removed debugging message

changed to orb_publish_auto
2016-05-22 12:19:47 +02:00
Andreas Bircher
556851a511 applying dual gps patch
resolve transfer errors

reformatting

implementing multi-topics
2016-05-22 12:19:47 +02:00
CarlOlsson
ee33f21303 added airspeed to ekf2 replay 2016-05-14 11:32:11 +02:00
Daniel Agar
76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar
0042c8ed12 sdlog2.c param metadata 2016-05-13 21:03:40 -04:00
Daniel Agar
e43751c219 params.c param metadata 2016-05-13 21:03:40 -04:00
Lorenz Meier
a40e1ea269 sdlog2: Properly handle pragma 2016-05-13 10:35:07 +02:00
Julian Oes
30b6f9ff6c sdlog2: more merge conflict resolving 2016-05-12 08:16:36 +02:00
Julian Oes
b965554bdd sdlog2: move main state, fix formatting, fix bug
Since the vehicle_status topic has been split up, we can't publish it
together with the the split cpuload and commander_state topics.

Therefore, the log field STAT.MainState will change to COMM.MainState
because it is only the internal commander state. Important to the
outside is STAT.NavState.

Likewise, the log field STAT.Load becomes LOAD.CPU.
2016-05-12 08:16:36 +02:00
Jonathan Challinger
01305da7e7 sdlog2: subscribe to and use cpuload message instead of vehicle_status 2016-05-12 08:16:36 +02:00
Julian Oes
f6845df21f sdlog2: don't log an empty sensor_combined topic 2016-05-11 21:30:03 +02:00
Julian Oes
c8d888cdc1 sdlog2: fix wrong if (facepalm!) 2016-05-11 21:30:03 +02:00
Julian Oes
e00101e5ab sdlog2: remove duplicate orb_copy 2016-05-11 21:30:03 +02:00
Julian Oes
871c112699 sdlog2: log normal data and replay on Snapdragon
In SITL and on Snapdragon, the logging performance is high enough, so we
can log both: the usual topics, as well as the ekf2 replay fields.

Note that the ekf2 replay still needs to be enabled via param.
2016-05-11 21:30:03 +02:00
Paul Riseborough
4b8c7201b7 sdlog2: add logging of ekf2 internal fault message 2016-05-11 14:53:55 +02:00
Lorenz Meier
d017514d59 sdlog2: Start / stop logging on arming even if enabled already during boot 2016-05-11 14:46:23 +02:00