Skip to content

Commit

Permalink
Add velocity feedforward term to HardwareInterfaceAdapter for velocit…
Browse files Browse the repository at this point in the history
…y_controllers::JointTrajectoryController.
  • Loading branch information
miguelprada committed Jun 15, 2016
1 parent b4dc152 commit d02dd6d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class HardwareInterfaceAdapter<hardware_interface::VelocityJointInterface, State

void updateCommand(const ros::Time& /*time*/,
const ros::Duration& period,
const State& /*desired_state*/,
const State& desired_state,
const State& state_error)
{
const unsigned int n_joints = joint_handles_ptr_->size();
Expand All @@ -213,7 +213,7 @@ class HardwareInterfaceAdapter<hardware_interface::VelocityJointInterface, State
// Update PIDs
for (unsigned int i = 0; i < n_joints; ++i)
{
const double command = pids_[i]->computeCommand(state_error.position[i], state_error.velocity[i], period);
const double command = desired_state.velocity[i] + pids_[i]->computeCommand(state_error.position[i], state_error.velocity[i], period);
(*joint_handles_ptr_)[i].setCommand(command);
}
}
Expand Down

0 comments on commit d02dd6d

Please sign in to comment.