Project

General

Profile

Actions

Pull request #361

closed

Add logging capabilities and fix missing 2*PI of vel. and acc. resolutions

Added by Gianluca Corsini over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Repository URL:
https://redmine.laas.fr/projects/libdynamixel/repository/dynamixel-genom3
Repository branch:
log

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.

Test without the fix of the resolutions applied


Test with the fix of the resolutions applied


Files

dx1_velocity_w_fix.png (175 KB) dx1_velocity_w_fix.png Test with the fix of the resolutions applied Gianluca Corsini, 2022-09-06 19:17
dx1_velocity_wo_fix.png (186 KB) dx1_velocity_wo_fix.png Test without the fix of the resolutions applied Gianluca Corsini, 2022-09-06 19:17
Actions #1

Updated by Anthony Mallet over 1 year 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?

Actions #2

Updated by Gianluca Corsini over 1 year 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.

Actions #3

Updated by Gianluca Corsini over 1 year ago

Do you think it may be helpful to have the possibility to log both, maybe according to a given boolean flag?

Actions #4

Updated by Anthony Mallet over 1 year 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 ...

Actions #5

Updated by Gianluca Corsini over 1 year ago

Ok, thanks a lot for all the tips. I will take them into consideration.

Actions #6

Updated by Gianluca Corsini over 1 year 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
Actions #7

Updated by Gianluca Corsini over 1 year 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.

Actions #8

Updated by Anthony Mallet over 1 year ago

Thanks, I'll look into merging it!

Actions #9

Updated by Gianluca Corsini over 1 year ago

ok great, thanks a lot!!

Actions #10

Updated by Gianluca Corsini over 1 year ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF