@@ -944,31 +944,25 @@ void DynamixelHardware::SetMatrix()
944
944
}
945
945
void DynamixelHardware::CalcTransmissionToJoint ()
946
946
{
947
- // Define the indices and their corresponding state types
948
947
const std::array<size_t , 3 > indices = {
949
948
PRESENT_POSITION_INDEX,
950
949
PRESENT_VELOCITY_INDEX,
951
950
PRESENT_EFFORT_INDEX
952
951
};
953
952
954
- // Process each joint
955
953
for (size_t i = 0 ; i < num_of_joints_; i++) {
956
- // Process each state type (position, velocity, effort)
957
954
for (size_t state_idx : indices) {
958
955
double value = 0.0 ;
959
- // Calculate value using transmission matrix
960
956
for (size_t j = 0 ; j < num_of_transmissions_; j++) {
961
957
value += transmission_to_joint_matrix_[i][j] *
962
958
(*hdl_trans_states_.at (j).value_ptr_vec .at (state_idx));
963
959
}
964
960
965
- // Apply conversion if needed (only for position)
966
961
if (state_idx == PRESENT_POSITION_INDEX &&
967
962
hdl_joint_states_.at (i).name == conversion_joint_name_) {
968
963
value = revoluteToPrismatic (value);
969
964
}
970
965
971
- // Store the calculated value
972
966
*hdl_joint_states_.at (i).value_ptr_vec .at (state_idx) = value;
973
967
}
974
968
}
@@ -978,16 +972,10 @@ void DynamixelHardware::CalcJointToTransmission()
978
972
{
979
973
for (size_t i = 0 ; i < num_of_transmissions_; i++) {
980
974
double value = 0.0 ;
981
- bool temp_flag = false ;
982
975
for (size_t j = 0 ; j < num_of_joints_; j++) {
983
976
for (size_t k = 0 ; k < hdl_joint_commands_.at (j).interface_name_vec .size (); k++) {
984
977
value += joint_to_transmission_matrix_[i][j] *
985
978
(*hdl_joint_commands_.at (j).value_ptr_vec .at (k));
986
- if (hdl_joint_commands_.at (j).name == " l_rh_r1_joint" ) {
987
- if (joint_to_transmission_matrix_[i][j] == 1.0 ) {
988
- temp_flag = true ;
989
- }
990
- }
991
979
}
992
980
}
993
981
@@ -996,9 +984,7 @@ void DynamixelHardware::CalcJointToTransmission()
996
984
hdl_trans_commands_.at (i).name == conversion_dxl_name_) {
997
985
value = prismaticToRevolute (value);
998
986
}
999
- if (hdl_trans_commands_.at (i).name == " dxl38" ) {
1000
- RCLCPP_INFO_STREAM (logger_, " hdl_trans_commands_.at(i).name: " << hdl_trans_commands_.at (i).name << " , cmd_idx: " << k << " , value: " << value);
1001
- }
987
+
1002
988
*hdl_trans_commands_.at (i).value_ptr_vec .at (k) = value;
1003
989
}
1004
990
}
0 commit comments