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

uORB: print individual bits of fields #15357

Merged
merged 1 commit into from
Jul 19, 2020
Merged

uORB: print individual bits of fields #15357

merged 1 commit into from
Jul 19, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Jul 16, 2020

  • applies to messages with names containing "flags" or "bits" and unsigned fixed width integer type (uint8, uint16, uint32)

Examples

nsh> listener estimator_status

TOPIC: estimator_status
 estimator_status_s
        timestamp: 63865011  (0.004478 seconds ago)
        states: [0.0499, 0.0007, -0.0241, 0.9984, -0.2369, 0.2916, 0.0396, -0.1543, 0.2069, 0.1159, 0.0000, 0.0000, -0.0001, 0.0000, 0.0000, -0.0001, 0.4105, -0.1005, 0.8565, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000]
        vibe: [0.0000, 0.0000, 0.0003]
        covariances: [0.0002, 0.0000, 0.0000, 0.0000, 0.0483, 0.0482, 0.0427, 0.0809, 0.0808, 0.2147, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000]
        output_tracking_error: [0.0076, 0.0209, 0.0196]
        control_mode_flags: 67109395 (0b0000'0100'0000'0000'0000'0010'0001'0011)
        pos_horiz_accuracy: 0.4022
        pos_vert_accuracy: 0.4634
        mag_test_ratio: 0.0600
        vel_test_ratio: 0.0000
        pos_test_ratio: 0.0038
        hgt_test_ratio: 0.0038
        tas_test_ratio: 0.0000
        hagl_test_ratio: 0.0000
        beta_test_ratio: 0.0000
        time_slip: -0.0105
        gps_check_fail_flags: 0 (0b0000'0000'0000'0000)
        filter_fault_flags: 0 (0b0000'0000'0000'0000)
        innovation_check_flags: 0 (0b0000'0000'0000'0000)
        solution_status_flags: 229 (0b0000'0000'1110'0101)
        n_states: 24
        pre_flt_fail_innov_heading: False
        pre_flt_fail_innov_vel_horiz: False
        pre_flt_fail_innov_vel_vert: False
        pre_flt_fail_innov_height: False
        pre_flt_fail_mag_field_disturbed: False
        health_flags: 0 (0b0000'0000)
        timeout_flags: 0 (0b0000'0000)

nsh> listener multirotor_motor_limits

TOPIC: multirotor_motor_limits
 multirotor_motor_limits_s
        timestamp: 130735043  (0.011383 seconds ago)
        saturation_status_flags: 1533 (0b0000'0101'1111'1101)

@bresch
Copy link
Member

bresch commented Jul 17, 2020

I like it, but it will break all the log post-processing tools...

@dagar
Copy link
Member Author

dagar commented Jul 17, 2020

I like it, but it will break all the log post-processing tools...

I'm not so sure actually. Most of the important ones like in estimator_status haven't changed at all. Renaming the other fields like failure_detector_status -> failure_detector_status_flags is optional.

@dagar
Copy link
Member Author

dagar commented Jul 17, 2020

I'll split out the message changes to discuss later.

@dagar dagar force-pushed the pr-listener_bits branch from 0d2564c to 10a0bdc Compare July 17, 2020 21:46
@dagar
Copy link
Member Author

dagar commented Jul 17, 2020

I've stripped this down to only the print helper changes without changing any existing fields. It's still useful for things like estimator_status. We can discuss changing other messages later if there's interest.

 - applies to messages with names containing "flags" or "bits" and unsigned fixed width integer type (uint8, uint16, uint32)
@dagar dagar force-pushed the pr-listener_bits branch from 10a0bdc to 1b33e26 Compare July 18, 2020 17:10
@dagar dagar merged commit 459abcd into master Jul 19, 2020
@dagar dagar deleted the pr-listener_bits branch July 19, 2020 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants