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

Too many debug messages on iCubGenova11 #497

Closed
marcoaccame opened this issue May 29, 2024 · 8 comments · Fixed by robotology/icub-main#964
Closed

Too many debug messages on iCubGenova11 #497

marcoaccame opened this issue May 29, 2024 · 8 comments · Fixed by robotology/icub-main#964
Assignees

Comments

@marcoaccame
Copy link
Contributor

In doing the tests for this PR:

I noticed that on iCubGenova11 there are too many diagnostics debug messages. See picture.

thumbnail_IMG_9197-mod

I analyzed the log a bit and I found out that each 2foc board emit one periodic debug message of type PER_MC_MSG__DEBUG every 500ms + something. See in here the code that receives from the 2foc and sends the diagnostics message to YRI.

Talking to @MSECode, it may be that the 2foc emits because of some xml setting in here, maybe the verbose setting that does not appears and is 1 by default. See here.

cc @valegagge @ale-git @martinaxgloria @Nicogene

@marcoaccame
Copy link
Contributor Author

marcoaccame commented May 29, 2024

In analyzing the code of the 2foc w/ @MSECode we spotted a possible bug in here.

The transmitted ICUBCANPROTO_PER_MC_MSG__DEBUG message contains a dirty content in the two least significant bytes. In particular these two bytes contain the current emitted by the latest ICUBCANPROTO_PER_MC_MSG__2FOC. See here.

The above is coherent with the diagnostics messages that shows all zero apart the values of the two LSB:

image

@valegagge
Copy link
Member

Hi @marcoaccame and @MSECode ,
good catch!
yes, the 2foc fw sends a packet with length =8, but it fills 6 bytes only.

Of course, we can fix it, but, in any case, the information put in the DEBUG message is no longer useful.

Doing another work related to the study of quadrature encoder, I'm evaluating to use that message for sending encoder raw values.

So, in the end, I suggest fixing it by setting the default value of the verbose parameter equal to 0. It should be set to 1 only when the autocalibration is performed or in debug session by technical people.

What do you think?

@marcoaccame
Copy link
Contributor Author

So, in the end, I suggest fixing it by setting the default value of the verbose parameter equal to 0. It should be set to 1 only when the autocalibration is performed or in debug session by technical people.

I tested again on the robot and the messages go away if I explicitly set verbose = 0. So: yes we should change the default value of Verbose to 0 so we don't have to modify the xml files of all robots.

Doing another work related to the study of quadrature encoder, I'm evaluating to use that message for sending encoder raw values.

You mean that the 2foc transmits the qenc value with the ICUBCANPROTO_PER_MC_MSG__DEBUG? It is fine by me. Or maybe you can use a new dedicated message able to transport qenc values but also other values depending on a param for instance in byte[0]. As you like.

@MSECode
Copy link
Contributor

MSECode commented May 29, 2024

I tested again on the robot and the messages go away if I explicitly set verbose = 0. So: yes we should change the default value of Verbose to 0 so we don't have to modify the xml files of all robots.

That's good. So it was actually due to that as thought earlier.
It make sense to modify icub-main and set the verbose default value to zero.

@valegagge
Copy link
Member

You mean that the 2foc transmits the qenc value with the ICUBCANPROTO_PER_MC_MSG__DEBUG?

Yes!

It is fine by me. Or maybe you can use a new dedicated message able to transport qenc values but also other values depending on a param for instance in byte[0]. As you like.

Exactly... I'm evaluating this alternative option also!

@MSECode
Copy link
Contributor

MSECode commented May 30, 2024

I've done a first change setting the default value for verbose to 0 in here.
I suppose that for solving this bug, changing icub-main should be fine as pointed out in here:

I tested again on the robot and the messages go away if I explicitly set verbose = 0. So: yes we should change the default value of Verbose to 0 so we don't have to modify the xml files of all robots.

Let's see uf there is something else to modify on other related repos, such as the proposal in here:

You mean that the 2foc transmits the qenc value with the ICUBCANPROTO_PER_MC_MSG__DEBUG? It is fine by me. Or maybe you can use a new dedicated message able to transport qenc values but also other values depending on a param for instance in byte[0]. As you like.

If it's ok to modify only the icub-main part relatively to this bug I'll proceed with testing phase.

@valegagge
Copy link
Member

If it's ok to modify only the icub-main part relatively to this bug I'll proceed with testing phase.

Yes, please proceed with the testing phase.

@MSECode
Copy link
Contributor

MSECode commented May 30, 2024

Today w/ @valegagge, we tested the fix available in the branch mentioned above.
As expected, by setting the default value for the verbose option in the 2FOC group of the robot configuration files to zero, the log of the YRI and the CAN bus are not flooded anymore with debug messages.

The log file here and the screen below show that the output is as desired:

log-YRI.txt

Screenshot from 2024-05-30 14-32-44

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 a pull request may close this issue.

3 participants