File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -840,7 +840,7 @@ DxlError Dynamixel::GetDxlValueFromSyncRead()
840
840
dxl_info_.ConvertValueRPMToVelocityRPS (ID, static_cast <int32_t >(dxl_getdata));
841
841
} else if (indirect_info_read_[ID].item_name .at (item_index) == " Present Current" ) {
842
842
*it_read_data.item_data_ptr_vec .at (item_index) =
843
- dxl_info_.ConvertCurrentToEffort (ID, static_cast <int16_t >(dxl_getdata));
843
+ dxl_info_.ConvertCurrentToEffort (ID, static_cast <int16_t >(dxl_getdata));
844
844
} else {
845
845
*it_read_data.item_data_ptr_vec .at (item_index) =
846
846
static_cast <double >(dxl_getdata);
@@ -962,7 +962,7 @@ DxlError Dynamixel::GetDxlValueFromBulkRead()
962
962
dxl_info_.ConvertValueRPMToVelocityRPS (ID, static_cast <int32_t >(dxl_getdata));
963
963
} else if (indirect_info_read_[ID].item_name .at (item_index) == " Present Current" ) {
964
964
*it_read_data.item_data_ptr_vec .at (item_index) =
965
- dxl_info_.ConvertCurrentToEffort (ID, static_cast <int16_t >(dxl_getdata));
965
+ dxl_info_.ConvertCurrentToEffort (ID, static_cast <int16_t >(dxl_getdata));
966
966
} else {
967
967
*it_read_data.item_data_ptr_vec .at (item_index) =
968
968
static_cast <double >(dxl_getdata);
Original file line number Diff line number Diff line change @@ -869,17 +869,23 @@ void DynamixelHardware::CalcJointToTransmission()
869
869
}
870
870
871
871
for (size_t i = 0 ; i < num_of_transmissions_; i++) {
872
- if (hdl_trans_commands_.at (i).interface_name_vec .size () > GOAL_CURRENT_INDEX && hdl_trans_commands_.at (i).interface_name_vec .at (GOAL_CURRENT_INDEX) == " Goal Current" )
872
+ if (hdl_trans_commands_.at (i).interface_name_vec .size () > GOAL_CURRENT_INDEX &&
873
+ hdl_trans_commands_.at (i).interface_name_vec .at (GOAL_CURRENT_INDEX) == " Goal Current" )
873
874
{
874
- double value = 0.0 ;
875
- for (size_t j = 0 ; j < num_of_joints_; j++) {
876
- if (hdl_joint_commands_.at (j).interface_name_vec .size () > GOAL_CURRENT_INDEX && hdl_joint_commands_.at (j).interface_name_vec .at (GOAL_CURRENT_INDEX) == hardware_interface::HW_IF_EFFORT)
875
+ for (size_t j = 0 ; j < hdl_joint_commands_.size (); j++)
876
+ {
877
+ if (hdl_joint_commands_.at (j).interface_name_vec .size () > GOAL_CURRENT_INDEX &&
878
+ hdl_joint_commands_.at (j).interface_name_vec .at (GOAL_CURRENT_INDEX) ==
879
+ hardware_interface::HW_IF_EFFORT)
877
880
{
878
- value += joint_to_transmission_matrix_[i][j] *
879
- (*hdl_joint_commands_.at (j).value_ptr_vec .at (GOAL_CURRENT_INDEX));
881
+ double value = 0.0 ;
882
+ for (size_t k = 0 ; k < num_of_joints_; k++) {
883
+ value += joint_to_transmission_matrix_[i][k] *
884
+ (*hdl_joint_commands_.at (k).value_ptr_vec .at (GOAL_CURRENT_INDEX));
885
+ }
886
+ *hdl_trans_commands_.at (i).value_ptr_vec .at (GOAL_CURRENT_INDEX) = value;
880
887
}
881
888
}
882
- *hdl_trans_commands_.at (i).value_ptr_vec .at (GOAL_CURRENT_INDEX) = value;
883
889
}
884
890
}
885
891
}
You can’t perform that action at this time.
0 commit comments