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
461 stars 410 forks source link

@TW050203 @Huitongtong #597

Open EvgenRyabch123 opened 1 year ago

EvgenRyabch123 commented 1 year 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.

Originally posted by @ROBOTIS-Will in https://github.com/ROBOTIS-GIT/DynamixelSDK/issues/558#issuecomment-1121768610

EvgenRyabch123 commented 1 year ago

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