21 int main(
int argc,
char *argv[])
23 const char* port_name =
"/dev/ttyUSB0";
25 int baud_rate = 57600;
26 int new_baud_rate = 1000000;
30 printf(
"Please set '-port_name', '-baud_rate', '-dynamixel_id', '-new_baud_rate' arguments for connected Dynamixels\n");
36 baud_rate = atoi(argv[2]);
37 dxl_id = atoi(argv[3]);
38 new_baud_rate = atoi(argv[4]);
46 result = dxl_wb.
init(port_name, baud_rate, &log);
50 printf(
"Failed to init\n");
55 printf(
"Succeeded to init(%d)\n", baud_rate);
57 uint16_t model_number = 0;
58 result = dxl_wb.
ping(dxl_id, &model_number, &log);
62 printf(
"Failed to ping\n");
68 printf(
"Succeeded to ping\n");
69 printf(
"id : %d, model_number : %d\n", dxl_id, model_number);
bool init(const char *device_name="/dev/ttyUSB0", uint32_t baud_rate=57600, const char **log=NULL)
DynamixelWorkbench dxl_wb
bool ping(uint8_t id, uint16_t *get_model_number, const char **log=NULL)
int main(int argc, char *argv[])
bool changeBaudrate(uint8_t id, uint32_t new_baudrate, const char **log=NULL)