24 #include <interfaces/DynamixelServoInterface.h> 26 #include <core/exceptions/software.h> 46 DynamixelServoInterface::DynamixelServoInterface() : Interface()
48 data_size =
sizeof(DynamixelServoInterface_data_t);
49 data_ptr = malloc(data_size);
50 data = (DynamixelServoInterface_data_t *)data_ptr;
51 data_ts = (interface_data_ts_t *)data_ptr;
52 memset(data_ptr, 0, data_size);
53 enum_map_ErrorCode[(int)ERROR_NONE] =
"ERROR_NONE";
54 enum_map_ErrorCode[(int)ERROR_UNSPECIFIC] =
"ERROR_UNSPECIFIC";
55 enum_map_ErrorCode[(int)ERROR_COMMUNICATION] =
"ERROR_COMMUNICATION";
56 enum_map_ErrorCode[(int)ERROR_ANGLE_OUTOFRANGE] =
"ERROR_ANGLE_OUTOFRANGE";
57 enum_map_WorkingMode[(int)JOINT] =
"JOINT";
58 enum_map_WorkingMode[(int)WHEEL] =
"WHEEL";
59 add_fieldinfo(IFT_STRING,
"model", 8, data->model);
60 add_fieldinfo(IFT_UINT32,
"model_number", 1, &data->model_number);
61 add_fieldinfo(IFT_UINT32,
"cw_angle_limit", 1, &data->cw_angle_limit);
62 add_fieldinfo(IFT_UINT32,
"ccw_angle_limit", 1, &data->ccw_angle_limit);
63 add_fieldinfo(IFT_UINT8,
"temperature_limit", 1, &data->temperature_limit);
64 add_fieldinfo(IFT_UINT32,
"max_torque", 1, &data->max_torque);
65 add_fieldinfo(IFT_UINT8,
"cw_margin", 1, &data->cw_margin);
66 add_fieldinfo(IFT_UINT8,
"ccw_margin", 1, &data->ccw_margin);
67 add_fieldinfo(IFT_UINT8,
"cw_slope", 1, &data->cw_slope);
68 add_fieldinfo(IFT_UINT8,
"ccw_slope", 1, &data->ccw_slope);
69 add_fieldinfo(IFT_UINT32,
"goal_position", 1, &data->goal_position);
70 add_fieldinfo(IFT_UINT32,
"goal_speed", 1, &data->goal_speed);
71 add_fieldinfo(IFT_UINT32,
"torque_limit", 1, &data->torque_limit);
72 add_fieldinfo(IFT_UINT32,
"position", 1, &data->position);
73 add_fieldinfo(IFT_UINT32,
"speed", 1, &data->speed);
74 add_fieldinfo(IFT_UINT32,
"load", 1, &data->load);
75 add_fieldinfo(IFT_UINT8,
"voltage", 1, &data->voltage);
76 add_fieldinfo(IFT_UINT8,
"temperature", 1, &data->temperature);
77 add_fieldinfo(IFT_UINT32,
"punch", 1, &data->punch);
78 add_fieldinfo(IFT_UINT8,
"alarm_shutdown", 1, &data->alarm_shutdown);
79 add_fieldinfo(IFT_UINT8,
"error", 1, &data->error);
80 add_fieldinfo(IFT_BOOL,
"enable_prevent_alarm_shutdown", 1, &data->enable_prevent_alarm_shutdown);
81 add_fieldinfo(IFT_FLOAT,
"angle", 1, &data->angle);
82 add_fieldinfo(IFT_BOOL,
"enabled", 1, &data->enabled);
83 add_fieldinfo(IFT_FLOAT,
"min_angle", 1, &data->min_angle);
84 add_fieldinfo(IFT_FLOAT,
"max_angle", 1, &data->max_angle);
85 add_fieldinfo(IFT_FLOAT,
"max_velocity", 1, &data->max_velocity);
86 add_fieldinfo(IFT_FLOAT,
"velocity", 1, &data->velocity);
87 add_fieldinfo(IFT_STRING,
"mode", 5, data->mode);
88 add_fieldinfo(IFT_FLOAT,
"angle_margin", 1, &data->angle_margin);
89 add_fieldinfo(IFT_BOOL,
"autorecover_enabled", 1, &data->autorecover_enabled);
90 add_fieldinfo(IFT_UINT32,
"msgid", 1, &data->msgid);
91 add_fieldinfo(IFT_BOOL,
"final", 1, &data->final);
92 add_fieldinfo(IFT_ENUM,
"error_code", 1, &data->error_code,
"ErrorCode", &enum_map_ErrorCode);
93 add_messageinfo(
"StopMessage");
94 add_messageinfo(
"FlushMessage");
95 add_messageinfo(
"GotoMessage");
96 add_messageinfo(
"TimedGotoMessage");
97 add_messageinfo(
"SetModeMessage");
98 add_messageinfo(
"SetSpeedMessage");
99 add_messageinfo(
"SetEnabledMessage");
100 add_messageinfo(
"SetVelocityMessage");
101 add_messageinfo(
"SetMarginMessage");
102 add_messageinfo(
"SetComplianceValuesMessage");
103 add_messageinfo(
"SetGoalSpeedMessage");
104 add_messageinfo(
"SetTorqueLimitMessage");
105 add_messageinfo(
"SetPunchMessage");
106 add_messageinfo(
"GotoPositionMessage");
107 add_messageinfo(
"SetAngleLimitsMessage");
108 add_messageinfo(
"ResetRawErrorMessage");
109 add_messageinfo(
"SetPreventAlarmShutdownMessage");
110 add_messageinfo(
"SetAutorecoverEnabledMessage");
111 add_messageinfo(
"RecoverMessage");
112 unsigned char tmp_hash[] = {0x18, 0x72, 0x74, 0xa6, 0x80, 0xfa, 0x62, 0xa2, 0x56, 0x91, 0x21, 0xfc, 0x48, 0xd5, 0xe0, 0x5f};
117 DynamixelServoInterface::~DynamixelServoInterface()
126 DynamixelServoInterface::tostring_ErrorCode(
ErrorCode value)
const 129 case ERROR_NONE:
return "ERROR_NONE";
130 case ERROR_UNSPECIFIC:
return "ERROR_UNSPECIFIC";
131 case ERROR_COMMUNICATION:
return "ERROR_COMMUNICATION";
132 case ERROR_ANGLE_OUTOFRANGE:
return "ERROR_ANGLE_OUTOFRANGE";
133 default:
return "UNKNOWN";
141 DynamixelServoInterface::tostring_WorkingMode(
WorkingMode value)
const 144 case JOINT:
return "JOINT";
145 case WHEEL:
return "WHEEL";
146 default:
return "UNKNOWN";
155 DynamixelServoInterface::model()
const 165 DynamixelServoInterface::maxlenof_model()
const 175 DynamixelServoInterface::set_model(
const char * new_model)
177 strncpy(data->model, new_model,
sizeof(data->model));
186 DynamixelServoInterface::model_number()
const 188 return data->model_number;
196 DynamixelServoInterface::maxlenof_model_number()
const 206 DynamixelServoInterface::set_model_number(
const uint32_t new_model_number)
208 data->model_number = new_model_number;
217 DynamixelServoInterface::cw_angle_limit()
const 219 return data->cw_angle_limit;
227 DynamixelServoInterface::maxlenof_cw_angle_limit()
const 237 DynamixelServoInterface::set_cw_angle_limit(
const uint32_t new_cw_angle_limit)
239 data->cw_angle_limit = new_cw_angle_limit;
248 DynamixelServoInterface::ccw_angle_limit()
const 250 return data->ccw_angle_limit;
258 DynamixelServoInterface::maxlenof_ccw_angle_limit()
const 268 DynamixelServoInterface::set_ccw_angle_limit(
const uint32_t new_ccw_angle_limit)
270 data->ccw_angle_limit = new_ccw_angle_limit;
279 DynamixelServoInterface::temperature_limit()
const 281 return data->temperature_limit;
289 DynamixelServoInterface::maxlenof_temperature_limit()
const 299 DynamixelServoInterface::set_temperature_limit(
const uint8_t new_temperature_limit)
301 data->temperature_limit = new_temperature_limit;
310 DynamixelServoInterface::max_torque()
const 312 return data->max_torque;
320 DynamixelServoInterface::maxlenof_max_torque()
const 330 DynamixelServoInterface::set_max_torque(
const uint32_t new_max_torque)
332 data->max_torque = new_max_torque;
341 DynamixelServoInterface::cw_margin()
const 343 return data->cw_margin;
351 DynamixelServoInterface::maxlenof_cw_margin()
const 361 DynamixelServoInterface::set_cw_margin(
const uint8_t new_cw_margin)
363 data->cw_margin = new_cw_margin;
372 DynamixelServoInterface::ccw_margin()
const 374 return data->ccw_margin;
382 DynamixelServoInterface::maxlenof_ccw_margin()
const 392 DynamixelServoInterface::set_ccw_margin(
const uint8_t new_ccw_margin)
394 data->ccw_margin = new_ccw_margin;
403 DynamixelServoInterface::cw_slope()
const 405 return data->cw_slope;
413 DynamixelServoInterface::maxlenof_cw_slope()
const 423 DynamixelServoInterface::set_cw_slope(
const uint8_t new_cw_slope)
425 data->cw_slope = new_cw_slope;
434 DynamixelServoInterface::ccw_slope()
const 436 return data->ccw_slope;
444 DynamixelServoInterface::maxlenof_ccw_slope()
const 454 DynamixelServoInterface::set_ccw_slope(
const uint8_t new_ccw_slope)
456 data->ccw_slope = new_ccw_slope;
465 DynamixelServoInterface::goal_position()
const 467 return data->goal_position;
475 DynamixelServoInterface::maxlenof_goal_position()
const 485 DynamixelServoInterface::set_goal_position(
const uint32_t new_goal_position)
487 data->goal_position = new_goal_position;
496 DynamixelServoInterface::goal_speed()
const 498 return data->goal_speed;
506 DynamixelServoInterface::maxlenof_goal_speed()
const 516 DynamixelServoInterface::set_goal_speed(
const uint32_t new_goal_speed)
518 data->goal_speed = new_goal_speed;
527 DynamixelServoInterface::torque_limit()
const 529 return data->torque_limit;
537 DynamixelServoInterface::maxlenof_torque_limit()
const 547 DynamixelServoInterface::set_torque_limit(
const uint32_t new_torque_limit)
549 data->torque_limit = new_torque_limit;
558 DynamixelServoInterface::position()
const 560 return data->position;
568 DynamixelServoInterface::maxlenof_position()
const 578 DynamixelServoInterface::set_position(
const uint32_t new_position)
580 data->position = new_position;
589 DynamixelServoInterface::speed()
const 599 DynamixelServoInterface::maxlenof_speed()
const 609 DynamixelServoInterface::set_speed(
const uint32_t new_speed)
611 data->speed = new_speed;
620 DynamixelServoInterface::load()
const 630 DynamixelServoInterface::maxlenof_load()
const 640 DynamixelServoInterface::set_load(
const uint32_t new_load)
642 data->load = new_load;
651 DynamixelServoInterface::voltage()
const 653 return data->voltage;
661 DynamixelServoInterface::maxlenof_voltage()
const 671 DynamixelServoInterface::set_voltage(
const uint8_t new_voltage)
673 data->voltage = new_voltage;
682 DynamixelServoInterface::temperature()
const 684 return data->temperature;
692 DynamixelServoInterface::maxlenof_temperature()
const 702 DynamixelServoInterface::set_temperature(
const uint8_t new_temperature)
704 data->temperature = new_temperature;
713 DynamixelServoInterface::punch()
const 723 DynamixelServoInterface::maxlenof_punch()
const 733 DynamixelServoInterface::set_punch(
const uint32_t new_punch)
735 data->punch = new_punch;
754 DynamixelServoInterface::alarm_shutdown()
const 756 return data->alarm_shutdown;
764 DynamixelServoInterface::maxlenof_alarm_shutdown()
const 784 DynamixelServoInterface::set_alarm_shutdown(
const uint8_t new_alarm_shutdown)
786 data->alarm_shutdown = new_alarm_shutdown;
805 DynamixelServoInterface::error()
const 815 DynamixelServoInterface::maxlenof_error()
const 835 DynamixelServoInterface::set_error(
const uint8_t new_error)
837 data->error = new_error;
846 DynamixelServoInterface::is_enable_prevent_alarm_shutdown()
const 848 return data->enable_prevent_alarm_shutdown;
856 DynamixelServoInterface::maxlenof_enable_prevent_alarm_shutdown()
const 866 DynamixelServoInterface::set_enable_prevent_alarm_shutdown(
const bool new_enable_prevent_alarm_shutdown)
868 data->enable_prevent_alarm_shutdown = new_enable_prevent_alarm_shutdown;
877 DynamixelServoInterface::angle()
const 887 DynamixelServoInterface::maxlenof_angle()
const 897 DynamixelServoInterface::set_angle(
const float new_angle)
899 data->angle = new_angle;
908 DynamixelServoInterface::is_enabled()
const 910 return data->enabled;
918 DynamixelServoInterface::maxlenof_enabled()
const 928 DynamixelServoInterface::set_enabled(
const bool new_enabled)
930 data->enabled = new_enabled;
939 DynamixelServoInterface::min_angle()
const 941 return data->min_angle;
949 DynamixelServoInterface::maxlenof_min_angle()
const 959 DynamixelServoInterface::set_min_angle(
const float new_min_angle)
961 data->min_angle = new_min_angle;
970 DynamixelServoInterface::max_angle()
const 972 return data->max_angle;
980 DynamixelServoInterface::maxlenof_max_angle()
const 990 DynamixelServoInterface::set_max_angle(
const float new_max_angle)
992 data->max_angle = new_max_angle;
1001 DynamixelServoInterface::max_velocity()
const 1003 return data->max_velocity;
1011 DynamixelServoInterface::maxlenof_max_velocity()
const 1021 DynamixelServoInterface::set_max_velocity(
const float new_max_velocity)
1023 data->max_velocity = new_max_velocity;
1024 data_changed =
true;
1032 DynamixelServoInterface::velocity()
const 1034 return data->velocity;
1042 DynamixelServoInterface::maxlenof_velocity()
const 1052 DynamixelServoInterface::set_velocity(
const float new_velocity)
1054 data->velocity = new_velocity;
1055 data_changed =
true;
1063 DynamixelServoInterface::mode()
const 1073 DynamixelServoInterface::maxlenof_mode()
const 1083 DynamixelServoInterface::set_mode(
const char * new_mode)
1085 strncpy(data->mode, new_mode,
sizeof(data->mode));
1086 data_changed =
true;
1097 DynamixelServoInterface::angle_margin()
const 1099 return data->angle_margin;
1107 DynamixelServoInterface::maxlenof_angle_margin()
const 1120 DynamixelServoInterface::set_angle_margin(
const float new_angle_margin)
1122 data->angle_margin = new_angle_margin;
1123 data_changed =
true;
1131 DynamixelServoInterface::is_autorecover_enabled()
const 1133 return data->autorecover_enabled;
1141 DynamixelServoInterface::maxlenof_autorecover_enabled()
const 1151 DynamixelServoInterface::set_autorecover_enabled(
const bool new_autorecover_enabled)
1153 data->autorecover_enabled = new_autorecover_enabled;
1154 data_changed =
true;
1163 DynamixelServoInterface::msgid()
const 1173 DynamixelServoInterface::maxlenof_msgid()
const 1184 DynamixelServoInterface::set_msgid(
const uint32_t new_msgid)
1186 data->msgid = new_msgid;
1187 data_changed =
true;
1196 DynamixelServoInterface::is_final()
const 1206 DynamixelServoInterface::maxlenof_final()
const 1217 DynamixelServoInterface::set_final(
const bool new_final)
1219 data->final = new_final;
1220 data_changed =
true;
1229 DynamixelServoInterface::error_code()
const 1239 DynamixelServoInterface::maxlenof_error_code()
const 1250 DynamixelServoInterface::set_error_code(
const ErrorCode new_error_code)
1252 data->error_code = new_error_code;
1253 data_changed =
true;
1258 DynamixelServoInterface::create_message(
const char *type)
const 1260 if ( strncmp(
"StopMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1262 }
else if ( strncmp(
"FlushMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1264 }
else if ( strncmp(
"GotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1266 }
else if ( strncmp(
"TimedGotoMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1268 }
else if ( strncmp(
"SetModeMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1270 }
else if ( strncmp(
"SetSpeedMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1272 }
else if ( strncmp(
"SetEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1274 }
else if ( strncmp(
"SetVelocityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1276 }
else if ( strncmp(
"SetMarginMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1278 }
else if ( strncmp(
"SetComplianceValuesMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1280 }
else if ( strncmp(
"SetGoalSpeedMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1282 }
else if ( strncmp(
"SetTorqueLimitMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1284 }
else if ( strncmp(
"SetPunchMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1286 }
else if ( strncmp(
"GotoPositionMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1288 }
else if ( strncmp(
"SetAngleLimitsMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1290 }
else if ( strncmp(
"ResetRawErrorMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1292 }
else if ( strncmp(
"SetPreventAlarmShutdownMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1294 }
else if ( strncmp(
"SetAutorecoverEnabledMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1296 }
else if ( strncmp(
"RecoverMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
1300 "message type for this interface type.", type);
1309 DynamixelServoInterface::copy_values(
const Interface *other)
1314 type(), other->
type());
1316 memcpy(data, oi->data,
sizeof(DynamixelServoInterface_data_t));
1320 DynamixelServoInterface::enum_tostring(
const char *enumtype,
int val)
const 1322 if (strcmp(enumtype,
"ErrorCode") == 0) {
1323 return tostring_ErrorCode((
ErrorCode)val);
1325 if (strcmp(enumtype,
"WorkingMode") == 0) {
1340 DynamixelServoInterface::StopMessage::StopMessage() :
Message(
"StopMessage")
1345 data = (StopMessage_data_t *)
data_ptr;
1347 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1351 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1352 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1369 data = (StopMessage_data_t *)
data_ptr;
1394 data_size =
sizeof(FlushMessage_data_t);
1397 data = (FlushMessage_data_t *)
data_ptr;
1399 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1403 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1404 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1421 data = (FlushMessage_data_t *)
data_ptr;
1451 data = (GotoMessage_data_t *)
data_ptr;
1453 data->angle = ini_angle;
1454 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1458 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1459 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1468 data = (GotoMessage_data_t *)
data_ptr;
1470 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1474 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1475 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1493 data = (GotoMessage_data_t *)
data_ptr;
1525 data->angle = new_angle;
1551 data_size =
sizeof(TimedGotoMessage_data_t);
1554 data = (TimedGotoMessage_data_t *)
data_ptr;
1556 data->time_sec = ini_time_sec;
1557 data->angle = ini_angle;
1558 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1562 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1563 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1570 data_size =
sizeof(TimedGotoMessage_data_t);
1573 data = (TimedGotoMessage_data_t *)
data_ptr;
1575 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1579 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1580 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1599 data = (TimedGotoMessage_data_t *)
data_ptr;
1612 return data->time_sec;
1633 data->time_sec = new_time_sec;
1663 data->angle = new_angle;
1688 data_size =
sizeof(SetModeMessage_data_t);
1691 data = (SetModeMessage_data_t *)
data_ptr;
1693 data->mode = ini_mode;
1694 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1698 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1699 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1705 data_size =
sizeof(SetModeMessage_data_t);
1708 data = (SetModeMessage_data_t *)
data_ptr;
1710 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1714 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1715 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1733 data = (SetModeMessage_data_t *)
data_ptr;
1765 data->mode = new_mode;
1790 data_size =
sizeof(SetSpeedMessage_data_t);
1793 data = (SetSpeedMessage_data_t *)
data_ptr;
1795 data->speed = ini_speed;
1796 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1800 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1801 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1807 data_size =
sizeof(SetSpeedMessage_data_t);
1810 data = (SetSpeedMessage_data_t *)
data_ptr;
1812 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1816 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1817 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1835 data = (SetSpeedMessage_data_t *)
data_ptr;
1867 data->speed = new_speed;
1892 data_size =
sizeof(SetEnabledMessage_data_t);
1895 data = (SetEnabledMessage_data_t *)
data_ptr;
1897 data->enabled = ini_enabled;
1898 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1902 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1903 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1909 data_size =
sizeof(SetEnabledMessage_data_t);
1912 data = (SetEnabledMessage_data_t *)
data_ptr;
1914 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
1918 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
1919 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
1937 data = (SetEnabledMessage_data_t *)
data_ptr;
1949 return data->enabled;
1969 data->enabled = new_enabled;
1994 data_size =
sizeof(SetVelocityMessage_data_t);
1997 data = (SetVelocityMessage_data_t *)
data_ptr;
1999 data->velocity = ini_velocity;
2000 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2004 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2005 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2011 data_size =
sizeof(SetVelocityMessage_data_t);
2014 data = (SetVelocityMessage_data_t *)
data_ptr;
2016 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2020 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2021 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2039 data = (SetVelocityMessage_data_t *)
data_ptr;
2051 return data->velocity;
2071 data->velocity = new_velocity;
2096 data_size =
sizeof(SetMarginMessage_data_t);
2099 data = (SetMarginMessage_data_t *)
data_ptr;
2101 data->angle_margin = ini_angle_margin;
2102 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2106 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2107 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2113 data_size =
sizeof(SetMarginMessage_data_t);
2116 data = (SetMarginMessage_data_t *)
data_ptr;
2118 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2122 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2123 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2141 data = (SetMarginMessage_data_t *)
data_ptr;
2156 return data->angle_margin;
2179 data->angle_margin = new_angle_margin;
2207 data_size =
sizeof(SetComplianceValuesMessage_data_t);
2210 data = (SetComplianceValuesMessage_data_t *)
data_ptr;
2212 data->cw_margin = ini_cw_margin;
2213 data->ccw_margin = ini_ccw_margin;
2214 data->cw_slope = ini_cw_slope;
2215 data->ccw_slope = ini_ccw_slope;
2216 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2220 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2221 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2230 data_size =
sizeof(SetComplianceValuesMessage_data_t);
2233 data = (SetComplianceValuesMessage_data_t *)
data_ptr;
2235 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2239 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2240 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2261 data = (SetComplianceValuesMessage_data_t *)
data_ptr;
2273 return data->cw_margin;
2293 data->cw_margin = new_cw_margin;
2303 return data->ccw_margin;
2323 data->ccw_margin = new_ccw_margin;
2333 return data->cw_slope;
2353 data->cw_slope = new_cw_slope;
2363 return data->ccw_slope;
2383 data->ccw_slope = new_ccw_slope;
2408 data_size =
sizeof(SetGoalSpeedMessage_data_t);
2411 data = (SetGoalSpeedMessage_data_t *)
data_ptr;
2413 data->goal_speed = ini_goal_speed;
2414 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2418 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2419 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2425 data_size =
sizeof(SetGoalSpeedMessage_data_t);
2428 data = (SetGoalSpeedMessage_data_t *)
data_ptr;
2430 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2434 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2435 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2453 data = (SetGoalSpeedMessage_data_t *)
data_ptr;
2465 return data->goal_speed;
2485 data->goal_speed = new_goal_speed;
2510 data_size =
sizeof(SetTorqueLimitMessage_data_t);
2513 data = (SetTorqueLimitMessage_data_t *)
data_ptr;
2515 data->torque_limit = ini_torque_limit;
2516 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2520 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2521 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2527 data_size =
sizeof(SetTorqueLimitMessage_data_t);
2530 data = (SetTorqueLimitMessage_data_t *)
data_ptr;
2532 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2536 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2537 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2555 data = (SetTorqueLimitMessage_data_t *)
data_ptr;
2567 return data->torque_limit;
2587 data->torque_limit = new_torque_limit;
2612 data_size =
sizeof(SetPunchMessage_data_t);
2615 data = (SetPunchMessage_data_t *)
data_ptr;
2617 data->punch = ini_punch;
2618 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2622 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2623 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2629 data_size =
sizeof(SetPunchMessage_data_t);
2632 data = (SetPunchMessage_data_t *)
data_ptr;
2634 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2638 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2639 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2657 data = (SetPunchMessage_data_t *)
data_ptr;
2689 data->punch = new_punch;
2714 data_size =
sizeof(GotoPositionMessage_data_t);
2717 data = (GotoPositionMessage_data_t *)
data_ptr;
2719 data->position = ini_position;
2720 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2724 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2725 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2731 data_size =
sizeof(GotoPositionMessage_data_t);
2734 data = (GotoPositionMessage_data_t *)
data_ptr;
2736 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2740 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2741 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2759 data = (GotoPositionMessage_data_t *)
data_ptr;
2771 return data->position;
2791 data->position = new_position;
2817 data_size =
sizeof(SetAngleLimitsMessage_data_t);
2820 data = (SetAngleLimitsMessage_data_t *)
data_ptr;
2822 data->angle_limit_cw = ini_angle_limit_cw;
2823 data->angle_limit_ccw = ini_angle_limit_ccw;
2824 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2828 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2829 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2836 data_size =
sizeof(SetAngleLimitsMessage_data_t);
2839 data = (SetAngleLimitsMessage_data_t *)
data_ptr;
2841 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2845 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2846 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2865 data = (SetAngleLimitsMessage_data_t *)
data_ptr;
2877 return data->angle_limit_cw;
2897 data->angle_limit_cw = new_angle_limit_cw;
2907 return data->angle_limit_ccw;
2927 data->angle_limit_ccw = new_angle_limit_ccw;
2950 data_size =
sizeof(ResetRawErrorMessage_data_t);
2953 data = (ResetRawErrorMessage_data_t *)
data_ptr;
2955 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
2959 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
2960 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
2977 data = (ResetRawErrorMessage_data_t *)
data_ptr;
3004 data_size =
sizeof(SetPreventAlarmShutdownMessage_data_t);
3007 data = (SetPreventAlarmShutdownMessage_data_t *)
data_ptr;
3009 data->enable_prevent_alarm_shutdown = ini_enable_prevent_alarm_shutdown;
3010 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
3014 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
3015 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
3021 data_size =
sizeof(SetPreventAlarmShutdownMessage_data_t);
3024 data = (SetPreventAlarmShutdownMessage_data_t *)
data_ptr;
3026 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
3030 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
3031 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
3049 data = (SetPreventAlarmShutdownMessage_data_t *)
data_ptr;
3061 return data->enable_prevent_alarm_shutdown;
3081 data->enable_prevent_alarm_shutdown = new_enable_prevent_alarm_shutdown;
3106 data_size =
sizeof(SetAutorecoverEnabledMessage_data_t);
3109 data = (SetAutorecoverEnabledMessage_data_t *)
data_ptr;
3111 data->autorecover_enabled = ini_autorecover_enabled;
3112 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
3116 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
3117 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
3123 data_size =
sizeof(SetAutorecoverEnabledMessage_data_t);
3126 data = (SetAutorecoverEnabledMessage_data_t *)
data_ptr;
3128 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
3132 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
3133 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
3151 data = (SetAutorecoverEnabledMessage_data_t *)
data_ptr;
3163 return data->autorecover_enabled;
3183 data->autorecover_enabled = new_autorecover_enabled;
3206 data_size =
sizeof(RecoverMessage_data_t);
3209 data = (RecoverMessage_data_t *)
data_ptr;
3211 enum_map_ErrorCode[(int)
ERROR_NONE] =
"ERROR_NONE";
3215 enum_map_WorkingMode[(int)
JOINT] =
"JOINT";
3216 enum_map_WorkingMode[(int)
WHEEL] =
"WHEEL";
3233 data = (RecoverMessage_data_t *)
data_ptr;
3296 if ( m10 != NULL ) {
3300 if ( m11 != NULL ) {
3304 if ( m12 != NULL ) {
3308 if ( m13 != NULL ) {
3312 if ( m14 != NULL ) {
3316 if ( m15 != NULL ) {
3320 if ( m16 != NULL ) {
3324 if ( m17 != NULL ) {
3328 if ( m18 != NULL ) {
virtual Message * clone() const
Clone this message.
SetPreventAlarmShutdownMessage()
Constructor.
ResetRawErrorMessage()
Constructor.
~TimedGotoMessage()
Destructor.
size_t maxlenof_angle() const
Get maximum length of angle value.
virtual Message * clone() const
Clone this message.
void * data_ptr
Pointer to memory that contains local data.
uint8_t cw_margin() const
Get cw_margin value.
uint32_t goal_speed() const
Get goal_speed value.
StopMessage()
Constructor.
SetVelocityMessage()
Constructor.
size_t maxlenof_angle_limit_cw() const
Get maximum length of angle_limit_cw value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Joint mode to move in a range of -2.616 to +2.616 rad.
virtual Message * clone() const
Clone this message.
SetAutorecoverEnabledMessage Fawkes BlackBoard Interface Message.
~GotoPositionMessage()
Destructor.
void set_torque_limit(const uint32_t new_torque_limit)
Set torque_limit value.
void set_punch(const uint32_t new_punch)
Set punch value.
virtual Message * clone() const
Clone this message.
void set_angle_margin(const float new_angle_margin)
Set angle_margin value.
Communication with device failed.
virtual Message * clone() const
Clone this message.
void set_time_sec(const float new_time_sec)
Set time_sec value.
SetGoalSpeedMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
bool is_enabled() const
Get enabled value.
bool is_autorecover_enabled() const
Get autorecover_enabled value.
virtual Message * clone() const
Clone this message.
SetAngleLimitsMessage Fawkes BlackBoard Interface Message.
void set_angle(const float new_angle)
Set angle value.
~SetModeMessage()
Destructor.
SetAngleLimitsMessage()
Constructor.
Fawkes library namespace.
SetMarginMessage()
Constructor.
8 bit unsigned integer field
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
size_t maxlenof_cw_slope() const
Get maximum length of cw_slope value.
void set_cw_margin(const uint8_t new_cw_margin)
Set cw_margin value.
16 bit unsigned integer field
uint8_t cw_slope() const
Get cw_slope value.
void set_speed(const uint16_t new_speed)
Set speed value.
SetTorqueLimitMessage Fawkes BlackBoard Interface Message.
~SetPreventAlarmShutdownMessage()
Destructor.
RecoverMessage()
Constructor.
void set_position(const uint32_t new_position)
Set position value.
uint8_t mode() const
Get mode value.
~FlushMessage()
Destructor.
float time_sec() const
Get time_sec value.
~SetPunchMessage()
Destructor.
SetComplianceValuesMessage Fawkes BlackBoard Interface Message.
~SetEnabledMessage()
Destructor.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_mode() const
Get maximum length of mode value.
SetMarginMessage Fawkes BlackBoard Interface Message.
Base class for all Fawkes BlackBoard interfaces.
SetSpeedMessage()
Constructor.
size_t maxlenof_torque_limit() const
Get maximum length of torque_limit value.
virtual Message * clone() const
Clone this message.
size_t maxlenof_enable_prevent_alarm_shutdown() const
Get maximum length of enable_prevent_alarm_shutdown value.
SetEnabledMessage()
Constructor.
void set_angle_limit_cw(const uint32_t new_angle_limit_cw)
Set angle_limit_cw value.
ResetRawErrorMessage Fawkes BlackBoard Interface Message.
GotoPositionMessage()
Constructor.
StopMessage Fawkes BlackBoard Interface Message.
~SetAngleLimitsMessage()
Destructor.
Wheel mode to use the servo in a continuously rotating mode.
message_data_ts_t * data_ts
data timestamp aliasing pointer
virtual Message * clone() const
Clone this message.
~SetTorqueLimitMessage()
Destructor.
unsigned int data_size
Size of memory needed to hold all data.
size_t maxlenof_position() const
Get maximum length of position value.
SetModeMessage Fawkes BlackBoard Interface Message.
~SetVelocityMessage()
Destructor.
FlushMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
uint32_t angle_limit_cw() const
Get angle_limit_cw value.
uint32_t torque_limit() const
Get torque_limit value.
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
const char * type() const
Get type of interface.
FlushMessage()
Constructor.
virtual Message * clone() const
Clone this message.
void set_autorecover_enabled(const bool new_autorecover_enabled)
Set autorecover_enabled value.
SetAutorecoverEnabledMessage()
Constructor.
~SetMarginMessage()
Destructor.
SetModeMessage()
Constructor.
void set_velocity(const float new_velocity)
Set velocity value.
bool is_enable_prevent_alarm_shutdown() const
Get enable_prevent_alarm_shutdown value.
void set_goal_speed(const uint32_t new_goal_speed)
Set goal_speed value.
SetPunchMessage Fawkes BlackBoard Interface Message.
uint16_t speed() const
Get speed value.
void set_ccw_slope(const uint8_t new_ccw_slope)
Set ccw_slope value.
float angle() const
Get angle value.
uint32_t punch() const
Get punch value.
size_t maxlenof_enabled() const
Get maximum length of enabled value.
~GotoMessage()
Destructor.
size_t maxlenof_goal_speed() const
Get maximum length of goal_speed value.
TimedGotoMessage Fawkes BlackBoard Interface Message.
~StopMessage()
Destructor.
virtual Message * clone() const
Clone this message.
uint8_t ccw_margin() const
Get ccw_margin value.
SetGoalSpeedMessage()
Constructor.
~ResetRawErrorMessage()
Destructor.
~SetGoalSpeedMessage()
Destructor.
SetComplianceValuesMessage()
Constructor.
size_t maxlenof_angle_limit_ccw() const
Get maximum length of angle_limit_ccw value.
virtual Message * clone() const
Clone this message.
SetEnabledMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_cw_margin() const
Get maximum length of cw_margin value.
Some unspecified error occured.
~SetComplianceValuesMessage()
Destructor.
size_t maxlenof_speed() const
Get maximum length of speed value.
size_t maxlenof_ccw_slope() const
Get maximum length of ccw_slope value.
GotoMessage()
Constructor.
~SetSpeedMessage()
Destructor.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
size_t maxlenof_ccw_margin() const
Get maximum length of ccw_margin value.
TimedGotoMessage()
Constructor.
SetTorqueLimitMessage()
Constructor.
ErrorCode
Error code to explain an error.
virtual Message * clone() const
Clone this message.
float velocity() const
Get velocity value.
size_t maxlenof_angle() const
Get maximum length of angle value.
SetSpeedMessage Fawkes BlackBoard Interface Message.
void set_enable_prevent_alarm_shutdown(const bool new_enable_prevent_alarm_shutdown)
Set enable_prevent_alarm_shutdown value.
GotoPositionMessage Fawkes BlackBoard Interface Message.
GotoMessage Fawkes BlackBoard Interface Message.
void set_ccw_margin(const uint8_t new_ccw_margin)
Set ccw_margin value.
float angle_margin() const
Get angle_margin value.
void set_angle(const float new_angle)
Set angle value.
WorkingMode
Mode to be set for the servo.
uint32_t position() const
Get position value.
DynamixelServoInterface Fawkes BlackBoard Interface.
~SetAutorecoverEnabledMessage()
Destructor.
void set_cw_slope(const uint8_t new_cw_slope)
Set cw_slope value.
void set_enabled(const bool new_enabled)
Set enabled value.
void set_mode(const uint8_t new_mode)
Set mode value.
size_t maxlenof_angle_margin() const
Get maximum length of angle_margin value.
void set_angle_limit_ccw(const uint32_t new_angle_limit_ccw)
Set angle_limit_ccw value.
~RecoverMessage()
Destructor.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
uint8_t ccw_slope() const
Get ccw_slope value.
size_t maxlenof_punch() const
Get maximum length of punch value.
size_t maxlenof_autorecover_enabled() const
Get maximum length of autorecover_enabled value.
size_t maxlenof_time_sec() const
Get maximum length of time_sec value.
RecoverMessage Fawkes BlackBoard Interface Message.
float angle() const
Get angle value.
SetPunchMessage()
Constructor.
32 bit unsigned integer field
size_t maxlenof_velocity() const
Get maximum length of velocity value.
SetVelocityMessage Fawkes BlackBoard Interface Message.
uint32_t angle_limit_ccw() const
Get angle_limit_ccw value.
SetPreventAlarmShutdownMessage Fawkes BlackBoard Interface Message.
Desired angle is out of range.