Skip to content

Commit

Permalink
update nullspace ctrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Poignonec committed Aug 27, 2024
1 parent c12907f commit 1fbbecc
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,23 @@ bool VanillaCartesianImpedanceRule::compute_controls(
auto error_position_nullspace = \
vic_input_data.nullspace_desired_joint_positions - vic_input_data.joint_state_position;
// Add nullspace contribution to joint accelerations
vic_command_data.joint_command_acceleration += nullspace_projection_ * M_inv_nullspace_ * (
-D_nullspace_ * vic_input_data.joint_state_velocity +
K_nullspace_ * error_position_nullspace +
external_joint_torques_
);
if (vic_input_data.has_external_torque_sensor()) {
RCLCPP_DEBUG(logger_, "Cmd nullspace joint acc with external torques...");
vic_command_data.joint_command_acceleration += nullspace_projection_ * M_inv_nullspace_ * (
- D_nullspace_ * vic_input_data.joint_state_velocity
+ K_nullspace_ * error_position_nullspace
+ external_joint_torques_
);
} else {
// Use natural joint space inertia
RCLCPP_DEBUG(
logger_,
"Cmd nullspace joint acc with natural joint inertia (no ext torque sensor)...");
vic_command_data.joint_command_acceleration += nullspace_projection_ * (
- D_nullspace_ * vic_input_data.joint_state_velocity
+ K_nullspace_ * error_position_nullspace
);
}
} else {
// Pure (small) damping in nullspace for stability
RCLCPP_WARN_THROTTLE(
Expand Down

0 comments on commit 1fbbecc

Please sign in to comment.