...
POST No. 2407872
How do I get rpm from Dynamixel using DynamixelWorkbench?
2020-05-18 23:26:33 calgalli

How do I get rpm from Dynamixel using DynamixelWorkbench? I used dxl_wb_left.syncRead("Present_Velocity"); bu this give compile error in latest version of DynamixelWorkbench in Arduino. Any new API?? I am using openCR and Turtlebot 3 Burger.


2020-05-18 23:26:33
calgalli
2020-05-19 09:28:20 Will Son

Hi,


Sorry, but I have too little information to answer your question. 

1. Please share us your compile error message for more accurate trouble shooting.

2. TurtleBot3 burger Arduino sketch does not use DYNAMIXEL workbench, but uses DYNAMIXEL SDK instead. In order to use DYNAMIXEL Workbench, please refer to DYNAMIXEL Workbench examples.

3. To calculate the RPM, you should read 4 byte Present Velocity(128) data and multiply 0.229 to the value to get the RPM.

Thank you.

2020-05-19 09:28:20
willson
2020-05-19 14:40:12 cake

Sorry for lacking of detail error. This is the compile error when I am using openCR 1.4.15


movebaseOprnCR:189: error: cannot convert 'bool' to 'int32_t* {aka long int*}' in assignment

     get_data = dxl_wb_right.syncRead("Present_Velocity");

              ^

/Users/cake/Desktop/Projects/AGV/linoTurtlebot/movebaseOprnCR/movebaseOprnCR.ino: In function 'void setup()':

movebaseOprnCR:245: error: 'class DynamixelWorkbench' has no member named 'addSyncRead'

   dxl_wb_left.addSyncRead("Present_Velocity");

               ^

movebaseOprnCR:246: error: 'class DynamixelWorkbench' has no member named 'addSyncRead'

   dxl_wb_right.addSyncRead("Present_Velocity");



there is no compile error in OpenCR 1.3.2

2020-05-19 14:40:12
calgalli
2020-05-20 11:23:26 Will Son

Hi,


Thank you for sharing the error messages.

The OpenCR 1.3.2 is quite old version that was released in September 2018 and there were many changes in both OpenCR and and DYNAMIXEL Workbench.


The syncRead function returns boolean result of whether the instruction is successful or not, therefore, your int32_t get_data does not match for the returned data type.

There's no such function named addSyncRead(), but there are addSyncReadHandler() funtions.

I'd strongly suggest to review the Arduino example first.

https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/OpenCR/examples/08.%20DynamixelWorkbench/m_Sync_Read_Write/m_Sync_Read_Write.ino 

Thank you.

2020-05-20 11:23:26
willson
2020-05-20 16:10:44 cake

No luck, It can compile and load but it stucks at 


dxl_wb_left.syncRead(handler_index, &log);


Do I need to update motor firmware? 

2020-05-20 16:10:44
calgalli
2020-05-21 13:09:16 Will Son

Does the m_sync_read_write demo example work for you?

If you are using XL-430 that is configured for TurtleBot3, you should use BAUDRATE 1000000 instead of 57600 default baudrate.

2020-05-21 13:09:16
willson
Reply
웹에디터 시작 웹 에디터 끝