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

px4io: servorail_status -> px4io_status and log all flags #15356

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

dagar
Copy link
Member

@dagar dagar commented Jul 16, 2020

This expands the px4io published servorail_status message into a more general px4io_status and adds most of the useful status, alarm, input, output fields as self descriptive fields (ie booleans for bits).

Storing just the flags would obviously be more efficient, but we were already paying for the flash to decode and print them in px4io status and there's no real mechanism to properly define bits in uORB messages, so they end up poorly defined or ignored in tools or review. This makes it accessible, self describing, and as useful as px4io status, but in all regular logs.

The message is published at 1 Hz or immediately on any status or alarm change.

Screenshot from 2020-07-16 14-56-57

@dagar
Copy link
Member Author

dagar commented Jul 16, 2020

Possibly related #15347.

@dagar dagar requested a review from julianoes July 16, 2020 19:21
status.status_safety_off = STATUS_FLAGS & PX4IO_P_STATUS_FLAGS_SAFETY_OFF;
status.status_fmu_initialized = STATUS_FLAGS & PX4IO_P_STATUS_FLAGS_FMU_INITIALIZED;
status.status_rc_st24 = STATUS_FLAGS & PX4IO_P_STATUS_FLAGS_RC_ST24;
status.status_rc_sumd = STATUS_FLAGS & PX4IO_P_STATUS_FLAGS_RC_SUMD;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative you could just log the status int as such. What do you think?

I'm just thinking that we might want to change that interface soon as we remove all the mixer stuff on the IO side.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it will get in the way as it's only for monitoring/logging and I don't have any plans to tie this message into the core state machine. At the more general mixer module level I'd like to centralize the status/health reporting so that we can lock it into the state machine.

@dagar dagar force-pushed the pr-px4io_status_logging branch from 8643e4c to 3bf8a5f Compare July 19, 2020 19:13
@dagar dagar merged commit 81f57bc into master Jul 21, 2020
@dagar dagar deleted the pr-px4io_status_logging branch July 21, 2020 13:56
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