Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved sensor failsafe reporting #3183

Merged
merged 4 commits into from
Nov 14, 2015
Merged

Conversation

mhkabir
Copy link
Member

@mhkabir mhkabir commented Nov 14, 2015

This adds verbose and complete failure reporting to the data validation class, so you know what exactly went wrong.
Sensor fail-safes, when triggered will now give the user a full story of what went wrong, in the GCS. Command-line validator output also includes error states for each sensor.

This is a result of debugging for #3122. The fix for that issue was to increase the mag data-rate, something we would have figured out long earlier if this framework had been in place. Hope this helps everyone in the future!!
This also fixes #2934

@LorenzMeier
Copy link
Member

Very good job! Now we just need to fix the Travis error state.

@LorenzMeier
Copy link
Member

src/lib/ecl/CMakeFiles/lib__ecl.dir/validation/data_validator_group.cpp.o -c ../src/lib/ecl/validation/data_validator_group.cpp

../src/lib/ecl/validation/data_validator_group.cpp:241:83: fatal error: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]

                if (next->used() && (next->state() != DataValidator::ERROR_FLAG_NO_ERROR) && (i == _prev_best)) {

                                                                                              ~ ^  ~~~~~~~~~~

1 error generated.

@mhkabir
Copy link
Member Author

mhkabir commented Nov 14, 2015

I have tested this now, works great! Travis fixed :)

Slick output now (manually triggered failsafe) :

nsh> attitude_estimator_q status
attitude_estimator_q: gyro status:
INFO  validator: best: 1, prev best: 0, failsafe: YES (1 events)
INFO  sensor #0, prio: 100, state: STALE_DATA DATA_TIMEOUT
INFO    val:  -0.0029, lp:  -0.0029 mean dev:   0.0000 RMS:   0.0011 conf:   0.0000
INFO    val:   0.0008, lp:   0.0008 mean dev:  -0.0000 RMS:   0.0010 conf:   0.0000
INFO    val:  -0.0015, lp:  -0.0015 mean dev:  -0.0000 RMS:   0.0009 conf:   0.0000
INFO  sensor #1, prio: 75, state: OK
INFO    val:   0.0001, lp:  -0.0002 mean dev:   0.0000 RMS:   0.0054 conf:   1.0000
INFO    val:   0.0035, lp:   0.0028 mean dev:  -0.0000 RMS:   0.0060 conf:   1.0000
INFO    val:   0.0090, lp:   0.0048 mean dev:  -0.0000 RMS:   0.0056 conf:   1.0000
attitude_estimator_q: accel status:
INFO  validator: best: 1, prev best: 0, failsafe: YES (1 events)
INFO  sensor #0, prio: 100, state: STALE_DATA DATA_TIMEOUT
INFO    val:   0.3937, lp:   0.3937 mean dev:  -0.0000 RMS:   0.0129 conf:   0.0000
INFO    val:   0.0898, lp:   0.0898 mean dev:   0.0000 RMS:   0.0137 conf:   0.0000
INFO    val:  -9.7812, lp:  -9.7812 mean dev:  -0.0000 RMS:   0.0095 conf:   0.0000
INFO  sensor #1, prio: 75, state: OK
INFO    val:   0.5700, lp:   0.5673 mean dev:  -0.0000 RMS:   0.0232 conf:   1.0000
INFO    val:  -0.1625, lp:  -0.1730 mean dev:   0.0000 RMS:   0.0277 conf:   1.0000
INFO    val:  -9.7327, lp:  -9.7191 mean dev:   0.0000 RMS:   0.0351 conf:   1.0000
attitude_estimator_q: mag status:
INFO  validator: best: 1, prev best: 0, failsafe: NO (0 events)
INFO  sensor #0, prio: 50, state: OK
INFO    val:   0.3326, lp:   0.3324 mean dev:   0.0000 RMS:   0.0011 conf:   1.0000
INFO    val:  -0.1449, lp:  -0.1441 mean dev:   0.0000 RMS:   0.0010 conf:   1.0000
INFO    val:   0.3387, lp:   0.3388 mean dev:   0.0000 RMS:   0.0017 conf:   1.0000
INFO  sensor #1, prio: 75, state: OK
INFO    val:  -0.0301, lp:  -0.0301 mean dev:   0.0000 RMS:   0.0003 conf:   1.0000
INFO    val:  -0.3625, lp:  -0.3625 mean dev:   0.0000 RMS:   0.0003 conf:   1.0000
INFO    val:   0.2528, lp:   0.2532 mean dev:  -0.0000 RMS:   0.0009 conf:   1.0000
INFO  sensor #2, prio: 75, state: NO_DATA DATA_TIMEOUT
INFO    val:  -0.0301, lp:  -0.0301 mean dev:   0.0000 RMS:   0.0003 conf:   1.0000
INFO    val:  -0.3625, lp:  -0.3625 mean dev:   0.0000 RMS:   0.0003 conf:   1.0000
INFO    val:   0.2528, lp:   0.2529 mean dev:  -0.0000 RMS:   0.0009 conf:   1.0000

@LorenzMeier
Copy link
Member

Nice!

LorenzMeier added a commit that referenced this pull request Nov 14, 2015
Improved sensor failsafe reporting
@LorenzMeier LorenzMeier merged commit ee2ce77 into PX4:master Nov 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve feedback on sensor "failure"
2 participants