File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -869,12 +869,18 @@ void DynamixelHardware::CalcJointToTransmission()
869
869
}
870
870
871
871
for (size_t i = 0 ; i < num_of_transmissions_; i++) {
872
- double value = 0.0 ;
873
- for (size_t j = 0 ; j < num_of_joints_; j++) {
874
- value += joint_to_transmission_matrix_[i][j] *
875
- (*hdl_joint_commands_.at (j).value_ptr_vec .at (GOAL_CURRENT_INDEX));
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" )
873
+ {
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)
877
+ {
878
+ value += joint_to_transmission_matrix_[i][j] *
879
+ (*hdl_joint_commands_.at (j).value_ptr_vec .at (GOAL_CURRENT_INDEX));
880
+ }
881
+ }
882
+ *hdl_trans_commands_.at (i).value_ptr_vec .at (GOAL_CURRENT_INDEX) = value;
876
883
}
877
- *hdl_trans_commands_.at (i).value_ptr_vec .at (GOAL_CURRENT_INDEX) = value;
878
884
}
879
885
}
880
886
You can’t perform that action at this time.
0 commit comments