add torque cmd on monitor example
@@ -43,6 +43,7 @@ void setup()
Serial.println("ping (ID)");
Serial.println("id (ID) (NEW_ID)");
Serial.println("baud (ID) (NEW_BAUD)");
+ Serial.println("torque (ID) (VALUE)");
Serial.println("joint (ID) (GOAL_POSITION)");
Serial.println("wheel (ID) (GOAL_VELOCITY)");
Serial.println("write (ID) (ADDRESS_NAME) (VALUE)");
@@ -116,6 +117,16 @@ void loop()
else
Serial.println("Failed");
}
+ else if (cmd[0] == "torque")
+ {
+ uint8_t id = cmd[1].toInt();
+ uint8_t onoff = cmd[2].toInt();
+
+ if (dxl_wb.itemWrite(id, "Torque_Enable", onoff))
+ Serial.println("Succeed to torque command!!");
+ else
+ Serial.println("Failed");
+ }
else if (cmd[0] == "joint")
{
uint8_t id = cmd[1].toInt();
