Skip to content

Commit f519f98

Browse files
authored
Merge pull request #54 from ROBOTIS-GIT/feature-omy-end
Add new model configuration for OMY end tool
2 parents 98be8ba + 710eab9 commit f519f98

File tree

8 files changed

+65
-22
lines changed

8 files changed

+65
-22
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog for package dynamixel_hardware_interface
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
1.4.8 (2025-06-23)
6+
------------------
7+
* Added new model for OMY to use virtual_dxl
8+
* Added goal position synchronization before torque enable for OMY sync table feature
9+
* Contributors: Woojin Wie
10+
511
1.4.7 (2025-06-19)
612
------------------
713
* Added virtual_dxl and support for rcu

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
44
<name>dynamixel_hardware_interface</name>
5-
<version>1.4.7</version>
5+
<version>1.4.8</version>
66
<description>
77
ROS 2 package providing a hardware interface for controlling Dynamixel motors via the ROS 2 control framework.
88
</description>

param/dxl_model/dynamixel.model

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Number Name
4646
35074 rh_p12_rn.model
4747
220 omy_hat.model
4848
230 omy_end.model
49+
231 omy_end_rh_p12_rn.model
4950
536 sensorxel_joy.model
5051
600 sensorxel_joy.model
5152
602 ffw_g10_rcu.model

param/dxl_model/omy_end.model

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
[type info]
2-
name value
3-
value_of_zero_radian_position 0
4-
value_of_max_radian_position 740
5-
value_of_min_radian_position -740
6-
min_radian -1.099
7-
max_radian 1.099
8-
velocity_unit 0.114
9-
101
[control table]
112
Address Size Data Name
123
0 2 Model Number
@@ -35,16 +26,6 @@ Address Size Data Name
3526
60 2 SyncTable Write Size
3627
378 2 Indirect Address
3728
634 1 Indirect Data
38-
72 1 Hardware Error Status
39-
73 1 Moving
40-
74 2 Present Current
41-
76 4 Present Velocity
42-
80 4 Present Position
43-
84 4 Position Trajectory
44-
200 1 Torque Enable
45-
202 2 Goal Current
46-
204 4 Goal Velocity
47-
208 4 Goal Position
4829
378 2 Indirect Address 1
4930
634 1 Indirect Data 1
5031
378 2 Indirect Address Write
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[type info]
2+
name value
3+
value_of_zero_radian_position 0
4+
value_of_max_radian_position 740
5+
value_of_min_radian_position -740
6+
min_radian -1.099
7+
max_radian 1.099
8+
velocity_unit 0.114
9+
10+
[control table]
11+
Address Size Data Name
12+
72 1 Hardware Error Status
13+
73 1 Moving
14+
74 2 Present Current
15+
76 4 Present Velocity
16+
80 4 Present Position
17+
84 4 Position Trajectory
18+
200 1 Torque Enable
19+
202 2 Goal Current
20+
204 4 Goal Velocity
21+
208 4 Goal Position

param/dxl_model/omy_hat.model

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ Address Size Data Name
3333
560 1 SyncTable Read Data
3434
688 1 SyncTable Write Data
3535
816 1 Indirect Data
36+
112 2 Indirect Address Write
37+
816 1 Indirect Data Write
38+
176 2 Indirect Address Read
39+
848 1 Indirect Data Read

src/dynamixel/dynamixel.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,20 @@ DxlError Dynamixel::SetDxlValueToSyncWrite()
18341834
int16_t goal_current = dxl_info_.ConvertEffortToCurrent(ID, data);
18351835
param_write_value[added_byte + 0] = DXL_LOBYTE(goal_current);
18361836
param_write_value[added_byte + 1] = DXL_HIBYTE(goal_current);
1837+
} else {
1838+
if (indirect_info_write_[comm_id].item_size.at(item_index) == 4) {
1839+
int32_t value = static_cast<int32_t>(data);
1840+
param_write_value[added_byte + 0] = DXL_LOBYTE(DXL_LOWORD(value));
1841+
param_write_value[added_byte + 1] = DXL_HIBYTE(DXL_LOWORD(value));
1842+
param_write_value[added_byte + 2] = DXL_LOBYTE(DXL_HIWORD(value));
1843+
param_write_value[added_byte + 3] = DXL_HIBYTE(DXL_HIWORD(value));
1844+
} else if (indirect_info_write_[comm_id].item_size.at(item_index) == 2) {
1845+
int16_t value = static_cast<int16_t>(data);
1846+
param_write_value[added_byte + 0] = DXL_LOBYTE(value);
1847+
param_write_value[added_byte + 1] = DXL_HIBYTE(value);
1848+
} else if (indirect_info_write_[comm_id].item_size.at(item_index) == 1) {
1849+
param_write_value[added_byte] = static_cast<uint8_t>(data);
1850+
}
18371851
}
18381852
added_byte += indirect_info_write_[comm_id].item_size.at(item_index);
18391853
}
@@ -2053,6 +2067,20 @@ DxlError Dynamixel::SetDxlValueToBulkWrite()
20532067
int16_t goal_current = dxl_info_.ConvertEffortToCurrent(ID, data);
20542068
param_write_value[added_byte + 0] = DXL_LOBYTE(goal_current);
20552069
param_write_value[added_byte + 1] = DXL_HIBYTE(goal_current);
2070+
} else {
2071+
if (indirect_info_write_[comm_id].item_size.at(item_index) == 4) {
2072+
int32_t value = static_cast<int32_t>(data);
2073+
param_write_value[added_byte + 0] = DXL_LOBYTE(DXL_LOWORD(value));
2074+
param_write_value[added_byte + 1] = DXL_HIBYTE(DXL_LOWORD(value));
2075+
param_write_value[added_byte + 2] = DXL_LOBYTE(DXL_HIWORD(value));
2076+
param_write_value[added_byte + 3] = DXL_HIBYTE(DXL_HIWORD(value));
2077+
} else if (indirect_info_write_[comm_id].item_size.at(item_index) == 2) {
2078+
int16_t value = static_cast<int16_t>(data);
2079+
param_write_value[added_byte + 0] = DXL_LOBYTE(value);
2080+
param_write_value[added_byte + 1] = DXL_HIBYTE(value);
2081+
} else if (indirect_info_write_[comm_id].item_size.at(item_index) == 1) {
2082+
param_write_value[added_byte] = static_cast<uint8_t>(data);
2083+
}
20562084
}
20572085
added_byte += indirect_info_write_[comm_id].item_size.at(item_index);
20582086
}

src/dynamixel_hardware_interface.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,11 @@ hardware_interface::CallbackReturn DynamixelHardware::start()
497497

498498
CalcTransmissionToJoint();
499499

500-
// sync commands = states joint
501500
SyncJointCommandWithStates();
502-
std::this_thread::sleep_for(std::chrono::milliseconds(500));
501+
502+
CalcJointToTransmission();
503+
504+
dxl_comm_->WriteMultiDxlData();
503505

504506
// Enable torque only for Dynamixels that have torque enabled in their parameters
505507
std::vector<uint8_t> torque_enabled_ids;

0 commit comments

Comments
 (0)