-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add message downsampler to avoid logger flooding when changing control mode #770
Conversation
cc @S-Dafarra |
src/libraries/icubmod/embObjMotionControl/embObjMotionControl.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Just as a curiosity, I have seen in the video above, you only change the control mode of a single joint. What happens if you do the same with multiple joints? |
Good question! In that file, there are only 3 "skipping"-like error messages and we address all of them, which are joint dependent. @marcoaccame, how does it work with multi-joint commands? Are they unpacked and dealt with at the single joint level? If so we're ok, otherwise we're required to catch where else the error messages are yielded and manage them accordingly. Perhaps, @mfussi66, you could quickly test the multi-joint approach as well (most likely straight on the robot). |
Yep, I'll check the availability of the robot and book it asap. I assume the code could be tested also on iCub2? In case iCub3 is not available. |
Yes, but wait for @marcoaccame's input first. |
By experience, I think this is the case |
So far, every call to So, if the threshold of events is 5 and the device is for instance If desired, it is possible (and easy) to modify the implementation so that there is one counter per each joint. |
Thanks @marcoaccame 👍🏻
That's how it is supposed to work, so far so good 👍🏻
We can certainly make things more general and configurable but I would like to go on with this current state to reach a first MVP. Therefore, I'm waiting for the CI to complete and then merge the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor refactoring.
I would just suggest a more descriptive message. I am afraid that |
We have just added the new logging component and we may rely on that. Perhaps, @mfussi66, you may call the component something like |
This PR aims to fix the issue: #768
To downsample the error messages rate, the logic of a simple Finite State Machine is implemented inside a
yarp::os::Timer
. The timer runs at 100Hz. If they exceed a threshold of 5 events, the FSM prints the number of error events occurred each second.The proposed solution was tested on a desk setup with one joint, addressing the three types of error events mentioned in the issue.
The videos below show the results on the setup.
On the top left there's the
Yarpmotorgui
, where I change the control mode. On the top right there's the programtutorial_arm
that sends the requests, and triggers the errors in theyarprobotinterface
if the control mode is not the expected one. On the bottom there is theyarprobotinterface
.downsampler_position_to_vel-2021-11-16_09.41.15.mp4
downsampler_vel_to_pos-2021-11-16_09.58.11.mp4
downsampler_direct_to_vel-2021-11-16_10.07.27.mp4