Pull request #361
closedAdd logging capabilities and fix missing 2*PI of vel. and acc. resolutions
Description
Hello @Anthony Mallet,
as the subject states, I added the possibility to log into this module and fixed the velocity and acceleration resolutions for all the motors.
As we expected, the factor 2*PI
is missing, as demonstrated by the following tests.
Below are the figures of the results, where I plot the velocities read from the Gazebo simulator.
On the top, it is the test without the fix, while on the bottom with the fix of the resolutions applied.
In both tests, I am sending to the motor the following sequence of target velocities: 1
, 0.5
, and lastly 0 rad/s
.
As you can see, without the fix, all the velocities I read from Gazebo are multiples of 2*PI
.
Files
Updated by Anthony Mallet over 2 years ago
On Tuesday 6 Sep 2022, at 19:27, Gianluca Corsini wrote:
as the subject states, I added the possibility to log into this
module
Why is it important to log both the 'decoded' data (as a double) and
the 'raw' data (integer subject to scaling)?
I would just log the decoded values, no?
Updated by Gianluca Corsini over 2 years ago
Oh yes, my bad!
I needed the decoded value to test my library for the gazebo plugin, since I had to make sure to reconstruct correctly the decoded values.
In general, the double values are more user-friendly and the module should log them. I will change the code tomorrow and update this issue.
Updated by Gianluca Corsini over 2 years ago
Do you think it may be helpful to have the possibility to log both, maybe according to a given boolean flag?
Updated by Anthony Mallet over 2 years ago
On Tuesday 6 Sep 2022, at 19:41, Gianluca Corsini wrote:
In general, the double values are more user-friendly and the module
should log them. I will change the code tomorrow and update this
issue.
OK, good. Also, remember that identifiers starting with _ (underscore)
are reserved by the C standard. (e.g you use _double struct member)
While here, I noticed that you have a lot of 'sprintf' and 'strcat',
this is really not efficient. You could either use something along
"pos += snprintf(pos, end-pos, ...)" or a simple standard format like
"%g%g%g...", array0, array1, array2 ...
Updated by Gianluca Corsini over 2 years ago
Ok, thanks a lot for all the tips. I will take them into consideration.
Updated by Gianluca Corsini over 2 years ago
- Repository URL changed from https://redmine.laas.fr/projects/libdynamixel/repository/dynamixel-genom3 to ssh://git@redmine.laas.fr/laas/users/afranchi/art/art-documentation/dom-software/dynamixel-genom3.git
- Repository branch changed from logging to log
Updated by Gianluca Corsini over 2 years ago
- Repository URL changed from ssh://git@redmine.laas.fr/laas/users/afranchi/art/art-documentation/dom-software/dynamixel-genom3.git to https://redmine.laas.fr/projects/libdynamixel/repository/dynamixel-genom3
Hi @Anthony Mallet,
I have pushed the new changes. You can find it in the new branch log
in the same repository pointed by the URL of the issue.
Updated by Gianluca Corsini over 2 years ago
- Status changed from New to Closed
Applied in changeset dynamixel-genom3|4156c1450483e461d9ba96f17948f69504eda641.