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

Report rcl/rclc errors #306

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Report rcl/rclc errors #306

wants to merge 5 commits into from

Conversation

jimmy-mcelwain
Copy link
Collaborator

@jimmy-mcelwain jimmy-mcelwain commented Sep 10, 2024

Fix for #128. RCL(C) API errors get reported to the user now. It just notifies the user that an RCL(C) API error occurred and gives the integer value of the rcl_ret_t value associated with that error that the user has to look up themselves.

motoRos_RCLAssertOK_withMsg() checks that the rcl_ret_t value that is passed in is OK, and if it is not, it not only sets an alarm indicating that, but it also sets an alarm indicating where it went wrong, like motoRos_Assert_withMsg() does. It's a bit ugly, something like what I described in the last paragraph of this comment may be prettier/do a better job of separating functionality/not duplicating code, but that would increase complexity a bit. It would require either a global "problems" struct, or several local "problems" structs in different files that get passed around that the hypothetical RaiseAlarms() function could reference.

This is a draft for now because I would like advice on what to do with motoRos_RCLAssertOK_withMsg(). I can squash the commits afterwards and rebase on main.

@jimmy-mcelwain jimmy-mcelwain marked this pull request as draft September 10, 2024 19:27
@gavanderhoorn
Copy link
Collaborator

It just notifies the user that an RCL(C) API error occurred and gives the integer value of the rcl_ret_t value associated with that error that the user has to look up themselves.

I would phrase it slightly more positive: users would lookup alarms raised by MotoROS2 in the troubleshooting documentation already, so this is just one more to look up.

It's just that in this case, it's as-if there's an additional sub code (a sub-sub code?), which happens to correspond to the rcl_ret_t value.

@jimmy-mcelwain
Copy link
Collaborator Author

Yeah that's a good point

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.

2 participants