Skip to content

Commit 477ae94

Browse files
Merge pull request #84 from ROBOTIS-GIT/hotfix_bug
Hotfix bug
2 parents c4125a3 + f50ebe4 commit 477ae94

File tree

5 files changed

+134
-32
lines changed

5 files changed

+134
-32
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Dynamixel2Arduino
2-
version=0.4.9
2+
version=0.5.1
33
author=ROBOTIS
44
license=Apache-2.0
55
maintainer=Will Son([email protected])

src/Dynamixel2Arduino.cpp

Lines changed: 93 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ const uint16_t model_number_table[] PROGMEM = {
4545
XM540_W150, XM540_W270,
4646
XH430_V210, XH430_V350, XH430_W210, XH430_W350,
4747
XH540_V150, XH540_V270, XH540_W150, XH540_W270,
48+
XD430_T210, XD430_T350,
49+
XD540_T150, XD540_T270,
50+
XW430_T200, XW430_T333,
4851
XW540_T140, XW540_T260,
4952

5053
PRO_L42_10_S300_R,
@@ -350,12 +353,18 @@ bool Dynamixel2Arduino::setBaudrate(uint8_t id, uint32_t baudrate)
350353
case XH430_V350:
351354
case XH430_W210:
352355
case XH430_W350:
356+
case XD430_T210:
357+
case XD430_T350:
353358
case XM540_W150:
354359
case XM540_W270:
355360
case XH540_W150:
356361
case XH540_W270:
357362
case XH540_V150:
358363
case XH540_V270:
364+
case XD540_T150:
365+
case XD540_T270:
366+
case XW430_T200:
367+
case XW430_T333:
359368
case XW540_T140:
360369
case XW540_T260:
361370
switch(baudrate)
@@ -669,12 +678,18 @@ bool Dynamixel2Arduino::setOperatingMode(uint8_t id, uint8_t mode)
669678
case XH430_V350:
670679
case XH430_W210:
671680
case XH430_W350:
681+
case XD430_T210:
682+
case XD430_T350:
672683
case XM540_W150:
673684
case XM540_W270:
674685
case XH540_W150:
675686
case XH540_W270:
676687
case XH540_V150:
677688
case XH540_V270:
689+
case XD540_T150:
690+
case XD540_T270:
691+
case XW430_T200:
692+
case XW430_T333:
678693
case XW540_T140:
679694
case XW540_T260:
680695
if(mode == OP_POSITION){
@@ -1102,14 +1117,12 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_ctable_2_0_common[] PROGM
11021117
|| ENABLE_ACTUATOR_XC330 \
11031118
|| ENABLE_ACTUATOR_XC430 \
11041119
|| ENABLE_ACTUATOR_XL430 \
1105-
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
1106-
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540)
1120+
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430 \
1121+
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540 \
1122+
|| ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430)
11071123
{SET_POSITION, GOAL_POSITION, UNIT_DEGREE, -1048575, 1048575, 0.088},
11081124
{GET_POSITION, PRESENT_POSITION, UNIT_DEGREE, -2147483647 , 2147483647, 0.088},
11091125

1110-
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1111-
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1112-
11131126
{SET_PWM, GOAL_PWM, UNIT_RAW, -885, 885, 1},
11141127
{GET_PWM, PRESENT_PWM, UNIT_RAW, -885, 885, 1},
11151128
#endif
@@ -1120,6 +1133,9 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx64_2[] PROGMEM = {
11201133
#if (ENABLE_ACTUATOR_MX64_PROTOCOL2)
11211134
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},
11221135
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 3.36},
1136+
1137+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1138+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11231139
#endif
11241140
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11251141
};
@@ -1128,21 +1144,32 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_mx106_2[] PROGMEM = {
11281144
#if (ENABLE_ACTUATOR_MX106_PROTOCOL2)
11291145
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},
11301146
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 3.36},
1147+
1148+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1149+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11311150
#endif
11321151
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11331152
};
11341153

11351154
const ModelDependencyFuncItemAndRangeInfo_t dependency_xl330_M288_M077[] PROGMEM = {
11361155
#if (ENABLE_ACTUATOR_XL330)
1137-
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
1138-
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1150, 1150, 1},
1156+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},
1157+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1750, 1750, 1},
11391158

11401159
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
11411160
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -2047, 2047, 0.229},
11421161
#endif
11431162
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11441163
};
11451164

1165+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xl430_xc430[] PROGMEM = {
1166+
#if (ENABLE_ACTUATOR_MX28_PROTOCOL2 || ENABLE_ACTUATOR_XL430 || ENABLE_ACTUATOR_XC430)
1167+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1168+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1169+
#endif
1170+
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
1171+
};
1172+
11461173
const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_m181_m288[] PROGMEM = {
11471174
#if (ENABLE_ACTUATOR_XC330)
11481175
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2352, 2352, 1},
@@ -1165,19 +1192,35 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xc330_t181_t288[] PROGMEM
11651192
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11661193
};
11671194

1168-
11691195
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm430_w210_w350[] PROGMEM = {
11701196
#if (ENABLE_ACTUATOR_XM430)
11711197
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},
11721198
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1193, 1193, 2.69},
1199+
1200+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1201+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11731202
#endif
11741203
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11751204
};
11761205

1177-
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_w210_w350[] PROGMEM = {
1178-
#if (ENABLE_ACTUATOR_XH430)
1206+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_wt210_wt350[] PROGMEM = {
1207+
#if (ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430)
11791208
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
11801209
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -648, 648, 2.69},
1210+
1211+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1212+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1213+
#endif
1214+
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
1215+
};
1216+
1217+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xw430_t200_t333[] PROGMEM = {
1218+
#if (ENABLE_ACTUATOR_XW430)
1219+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1220+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1221+
1222+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1223+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11811224
#endif
11821225
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11831226
};
@@ -1186,15 +1229,32 @@ const ModelDependencyFuncItemAndRangeInfo_t dependency_xh430_v210_v350[] PROGMEM
11861229
#if (ENABLE_ACTUATOR_XH430)
11871230
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},
11881231
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -689, 689, 1.34},
1232+
1233+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1234+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11891235
#endif
11901236
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
11911237
};
11921238

1193-
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xw540[] PROGMEM = {
1194-
#if (ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540) \
1195-
|| ENABLE_ACTUATOR_XW540
1239+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xm540_xh540_xt540_xw540[] PROGMEM = {
1240+
#if (ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 \
1241+
|| ENABLE_ACTUATOR_XD540 || ENABLE_ACTUATOR_XW540)
11961242
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
11971243
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -2047, 2047, 2.69},
1244+
1245+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1246+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1247+
#endif
1248+
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
1249+
};
1250+
1251+
const ModelDependencyFuncItemAndRangeInfo_t dependency_xh540_v150_v270[] PROGMEM = {
1252+
#if (ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540)
1253+
{SET_CURRENT, GOAL_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},
1254+
{GET_CURRENT, PRESENT_CURRENT, UNIT_MILLI_AMPERE, -1188, 1188, 2.69},
1255+
1256+
{SET_VELOCITY, GOAL_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
1257+
{GET_VELOCITY, PRESENT_VELOCITY, UNIT_RPM, -1023, 1023, 0.229},
11981258
#endif
11991259
{LAST_DUMMY_FUNC, ControlTableItem::LAST_DUMMY_ITEM, UNIT_RAW, 0, 0, 0}
12001260
};
@@ -1443,6 +1503,7 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
14431503
case XL430_W250:
14441504
case XXL430_W250:
14451505
p_common_ctable = dependency_ctable_2_0_common;
1506+
p_dep_ctable = dependency_xl430_xc430;
14461507
break;
14471508

14481509
case MX64_2:
@@ -1487,20 +1548,34 @@ static ItemAndRangeInfo_t getModelDependencyFuncInfo(uint16_t model_num, uint8_t
14871548

14881549
case XH430_W210:
14891550
case XH430_W350:
1551+
case XD430_T210:
1552+
case XD430_T350:
14901553
p_common_ctable = dependency_ctable_2_0_common;
1491-
p_dep_ctable = dependency_xh430_w210_w350;
1554+
p_dep_ctable = dependency_xh430_wt210_wt350;
14921555
break;
14931556

1557+
case XW430_T200:
1558+
case XW430_T333:
1559+
p_common_ctable = dependency_ctable_2_0_common;
1560+
p_dep_ctable = dependency_xw430_t200_t333;
1561+
break;
1562+
14941563
case XM540_W150:
14951564
case XM540_W270:
14961565
case XH540_W150:
1497-
case XH540_W270:
1498-
case XH540_V150:
1499-
case XH540_V270:
1566+
case XH540_W270:
1567+
case XD540_T150:
1568+
case XD540_T270:
15001569
case XW540_T140:
15011570
case XW540_T260:
15021571
p_common_ctable = dependency_ctable_2_0_common;
1503-
p_dep_ctable = dependency_xm540_xh540_xw540;
1572+
p_dep_ctable = dependency_xm540_xh540_xt540_xw540;
1573+
break;
1574+
1575+
case XH540_V150:
1576+
case XH540_V270:
1577+
p_common_ctable = dependency_ctable_2_0_common;
1578+
p_dep_ctable = dependency_xh540_v150_v270;
15041579
break;
15051580

15061581
// case PRO_L42_10_S300_R:
@@ -1686,5 +1761,3 @@ static float f_map(float x, float in_min, float in_max, float out_min, float out
16861761
{
16871762
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
16881763
}
1689-
1690-

src/actuator.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ const ModelControlTableInfo_t control_table_2_0[] PROGMEM = {
172172
|| ENABLE_ACTUATOR_XC330 \
173173
|| ENABLE_ACTUATOR_XL430 \
174174
|| ENABLE_ACTUATOR_XC430 \
175-
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 \
176-
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540) \
177-
|| ENABLE_ACTUATOR_XW540
175+
|| ENABLE_ACTUATOR_XM430 || ENABLE_ACTUATOR_XH430 || ENABLE_ACTUATOR_XD430 \
176+
|| ENABLE_ACTUATOR_XM540 || ENABLE_ACTUATOR_XH540 || ENABLE_ACTUATOR_XD540 \
177+
|| ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430)
178178
{ControlTableItem::MODEL_NUMBER, 0, 2},
179179
{ControlTableItem::MODEL_INFORMATION, 2, 4},
180180
{ControlTableItem::FIRMWARE_VERSION, 6, 1},
@@ -284,10 +284,9 @@ const ModelControlTableInfo_t xmh540_control_table[] PROGMEM = {
284284
{ControlTableItem::LAST_DUMMY_ITEM, 0, 0}
285285
};
286286

287-
const ModelControlTableInfo_t xw540_control_table[] PROGMEM = {
288-
#if (ENABLE_ACTUATOR_XW540)
287+
const ModelControlTableInfo_t xw430_540_control_table[] PROGMEM = {
288+
#if (ENABLE_ACTUATOR_XW540 || ENABLE_ACTUATOR_XW430 )
289289
{ControlTableItem::CURRENT_LIMIT, 38, 2},
290-
291290
{ControlTableItem::GOAL_CURRENT, 102, 2},
292291
{ControlTableItem::PRESENT_CURRENT, 126, 2},
293292
#endif
@@ -496,6 +495,8 @@ ControlTableItemInfo_t DYNAMIXEL::getControlTableItemInfo(uint16_t model_num, ui
496495
case XH430_V350:
497496
case XH430_W210:
498497
case XH430_W350:
498+
case XD430_T210:
499+
case XD430_T350:
499500
p_common_ctable = control_table_2_0;
500501
p_dep_ctable = xmh430_xl330_control_table;
501502
break;
@@ -506,14 +507,18 @@ ControlTableItemInfo_t DYNAMIXEL::getControlTableItemInfo(uint16_t model_num, ui
506507
case XH540_W270:
507508
case XH540_V150:
508509
case XH540_V270:
510+
case XD540_T150:
511+
case XD540_T270:
509512
p_common_ctable = control_table_2_0;
510513
p_dep_ctable = xmh540_control_table;
511514
break;
512515

513516
case XW540_T140:
514517
case XW540_T260:
518+
case XW430_T200:
519+
case XW430_T333:
515520
p_common_ctable = control_table_2_0;
516-
p_dep_ctable = xw540_control_table;
521+
p_dep_ctable = xw430_540_control_table;
517522
break;
518523

519524
// case PRO_L42_10_S300_R:

src/actuator.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,27 @@
149149
#ifndef XH540_V270
150150
#define XH540_V270 (uint16_t)1140
151151
#endif
152+
153+
#ifndef XD430_T210
154+
#define XD430_T210 (uint16_t)1011
155+
#endif
156+
#ifndef XD430_T350
157+
#define XD430_T350 (uint16_t)1001
158+
#endif
159+
160+
#ifndef XD540_T150
161+
#define XD540_T150 (uint16_t)1111
162+
#endif
163+
#ifndef XD540_T270
164+
#define XD540_T270 (uint16_t)1101
165+
#endif
166+
167+
#ifndef XW430_T200
168+
#define XW430_T200 (uint16_t)1280
169+
#endif
170+
#ifndef XW430_T333
171+
#define XW430_T333 (uint16_t)1270
172+
#endif
152173
#ifndef XW540_T140
153174
#define XW540_T140 (uint16_t)1180
154175
#endif

src/utility/config.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
#define ENABLE_ACTUATOR_XL320 1
1919
#define ENABLE_ACTUATOR_XL330 1
2020
#define ENABLE_ACTUATOR_XC330 1
21-
#define ENABLE_ACTUATOR_XL430 1 //Includes 2XL430
22-
#define ENABLE_ACTUATOR_XC430 1 //Includes 2XC430
21+
#define ENABLE_ACTUATOR_XL430 1 // includes 2XL430
22+
#define ENABLE_ACTUATOR_XC430 1 // includes 2XC430
2323
#define ENABLE_ACTUATOR_XM430 1
24-
#define ENABLE_ACTUATOR_XH430 1
24+
#define ENABLE_ACTUATOR_XH430 1 // includes V lineup
25+
#define ENABLE_ACTUATOR_XD430 1
2526
#define ENABLE_ACTUATOR_XM540 1
26-
#define ENABLE_ACTUATOR_XH540 1
27+
#define ENABLE_ACTUATOR_XH540 1 // includes V lineup
28+
#define ENABLE_ACTUATOR_XD540 1
29+
#define ENABLE_ACTUATOR_XW430 1
2730
#define ENABLE_ACTUATOR_XW540 1
2831

2932
#define ENABLE_ACTUATOR_PRO_R 1

0 commit comments

Comments
 (0)