OpenCR icon indicating copy to clipboard operation
OpenCR copied to clipboard

Modify turtlebot_motor_driver

Open Valeria258 opened this issue 4 years ago • 4 comments

I'm triying to modify this file https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/turtlebot3/src/turtlebot3/turtlebot3_motor_driver.cpp in order to add a new function to read current on the dynamixel servomotors but when I compile it i got an error saying that my function doesn't exist. It seems that is not using my modified files. Which files should I modify to solve this problem?

Valeria258 avatar Feb 13 '21 01:02 Valeria258

Hi @Valeria258, Did you append your custom function to the header file where defines the Turtlebot3MotorDriver class?

ROBOTIS-Will avatar Feb 15 '21 01:02 ROBOTIS-Will

Can any one know that what is "VELOCITY_CONSTANT_VALUE" in turtlebot3_motor_driver.h come from? I really confuse about the value 0.229 and 0.10472 come from. Because I change the motor to MX-64, do I need to change it?

TimothyHo584 avatar Mar 11 '21 08:03 TimothyHo584

The constant 0.229 came from the Velocity unit of DYNAMIXEL 0.10472 came from the calculation of angular velocity = 2 * pi / 60 = 0.10472 If you are going to use MX-64(2.0), the firmware that supports DYNAMIXEL Protocol 2.0, you don't need to modify these constants.

ROBOTIS-Will avatar Mar 11 '21 09:03 ROBOTIS-Will

The constant 0.229 came from the Velocity unit of DYNAMIXEL 0.10472 came from the calculation of angular velocity = 2 * pi / 60 = 0.10472 If you are going to use MX-64(2.0), the firmware that supports DYNAMIXEL Protocol 2.0, you don't need to modify these constants.

Thanks a lot!!I finally know these two constant means.

TimothyHo584 avatar Mar 11 '21 12:03 TimothyHo584