ROBOTIS-GIT / DynamixelSDK

ROBOTIS Dynamixel SDK (Protocol1.0/2.0)
http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/
Apache License 2.0
456 stars 405 forks source link

Failed to enable torque for Dynamixel ID 1 #558

Open tengyuewang7 opened 2 years ago

tengyuewang7 commented 2 years ago

ISSUE TEMPLATE ver. 1.2.0

Please fill this template for more accurate and prompt support.

  1. Which DYNAMIXEL SDK version do you use?

    • just clone from github
  2. Which programming language/tool do you use?

    • C++, Python, ROS
  3. Which operating system do you use?

    • ex) VMware Ubuntu 18.04
  4. Which USB serial converter do you use?

    • ex) U2D2
  5. Which DYNAMIXEL do you use?

    • XM430-W250,
  6. Have you searched the issue from the closed issue threads?

    • I have searched this issue but found no solution.
  7. Please describe the issue in detail

    • I am trying to run a single XM430-W250. In fact, I am following the instruction on Youtube (link: https://www.youtube.com/watch?v=SpdxjsCO9sE). But when I run the command "rosrun dynamixel_sdk_examples read_write_node", it comes an error saying "Failed to enable torque for Dynamixel ID 1". I have tried this on different motors and the result is the same. Is there any setup or modification I need to do on the motor?
  8. How can we reproduce the issue?

Huitongtong commented 2 years ago

I have the same issue using AX-12A,

ROBOTIS-Will commented 2 years ago

@TW050203 @Huitongtong The read_write_node.cpp example in the DYNAMIXEL SDK requires 2 DYNAMIXEL with ID 1 and 2. If you are running with only one DYNAMIXEL (with ID = 1), please modify the source code to run with a single DYNAMIXEL. For example, comment out the ID 2 torque enable code in line 131 as below

  dxl_comm_result = packetHandler->write1ByteTxRx(
    portHandler, DXL1_ID, ADDR_TORQUE_ENABLE, 1, &dxl_error);
  if (dxl_comm_result != COMM_SUCCESS) {
    ROS_ERROR("Failed to enable torque for Dynamixel ID %d", DXL1_ID);
    return -1;
  }

  // dxl_comm_result = packetHandler->write1ByteTxRx(
  //   portHandler, DXL2_ID, ADDR_TORQUE_ENABLE, 1, &dxl_error);
  // if (dxl_comm_result != COMM_SUCCESS) {
  //   ROS_ERROR("Failed to enable torque for Dynamixel ID %d", DXL2_ID);
  //   return -1;
  // }

If you are running with AX series, you should modify the source code as the example is written for X series that have a different control table, data structure, and Protocol version from AX series.

Thanks.

Huitongtong commented 2 years ago

@ROBOTIS-Will Thanks for replying, the problem is solved.

EvgenRyabch123 commented 1 year ago

@TW050203 @Huitongtong The read_write_node.cpp для примера в DYNAMIXEL SDK требуется 2 DYNAMIXEL с идентификаторами 1 и 2.Если вы работаете только с одним DYNAMIXEL (с ID = 1), пожалуйста, измените исходный код для запуска с одним DYNAMIXEL.Например, закомментируйте код включения крутящего момента ID 2 в строке 131, как показано ниже

 dxl_comm_result = packetHandler->write1ByteTxRx( 
 portHandler, DXL1_ID, ADDR_TORQUE_ENABLE, 1 и dxl_error);
 если (dxl_comm_result != COMM_SUCCESS) {
 ROS_ERROR("Не удалось включить крутящий момент для идентификатора Dynamixel %d", DXL1_ID);
 возврат -1;
 }

 // dxl_comm_result = packetHandler->write1ByteTxRx(
  // portHandler, DXL2_ID, ADDR_TORQUE_ENABLE, 1, &dxl_error);
  // if (dxl_comm_result != COMM_SUCCESS) {
  // ROS_ERROR("Не удалось включить крутящий момент для идентификатора Dynamixel % d", DXL2_ID);
  // возвращает -1;
  // }

Если вы работаете с серией AX, вам следует изменить исходный код, поскольку приведенный пример написан для серий X, которые имеют таблицу управления, структуру данных и версию протокола, отличную от серии AX.

Спасибо.

Hello! I have the same problem, I use Dynamixel for work : AH-12A. Tell me what exactly needs to be changed. I don't understand. and where to find this information