21 int main(
int argc,
char *argv[])
23 const char* port_name =
"/dev/ttyUSB0";
24 int baud_rate = 57600;
29 printf(
"Please set '-port_name', '-baud_rate', '-dynamixel id' arguments for connected Dynamixels\n");
35 baud_rate = atoi(argv[2]);
36 dxl_id = atoi(argv[3]);
44 uint16_t model_number = 0;
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 result = dxl_wb.
ping(dxl_id, &model_number, &log);
61 printf(
"Failed to ping\n");
65 printf(
"Succeeded to ping\n");
66 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[])