0

In the old code, there used to be an option to select between inverse_dynamics_controller and kuka_torque_controller. The two are slightly different where the inputs to the kuka_torque_controller has a "Tau input". The inverse_dynamics_controller is selected for position control where kuka_torque_controller is selected for torque control.

In the new code for manipulation_station, how come the option to use kuka_torque_controller is gone and inverse_dynamics_controller is the only type of controller being used? Does this mean that manipulation station is made only for position control and not torque control?

If not, then how would you enable torque control?

The code below is from kuka_simulation

// Adds a iiwa controller.
  StateFeedbackControllerInterface<double>* controller = nullptr;
  if (FLAGS_torque_control) {
    VectorX<double> stiffness, damping_ratio;
    SetTorqueControlledIiwaGains(&stiffness, &damping_ratio);
    stiffness = stiffness.replicate(num_iiwa, 1).eval();
    damping_ratio = damping_ratio.replicate(num_iiwa, 1).eval();
    controller = builder.AddController<KukaTorqueController<double>>(
        RigidBodyTreeConstants::kFirstNonWorldModelInstanceId, tree.Clone(),
        stiffness, damping_ratio);
  } else {
    VectorX<double> iiwa_kp, iiwa_kd, iiwa_ki;
    SetPositionControlledIiwaGains(&iiwa_kp, &iiwa_ki, &iiwa_kd);
    iiwa_kp = iiwa_kp.replicate(num_iiwa, 1).eval();
    iiwa_kd = iiwa_kd.replicate(num_iiwa, 1).eval();
    iiwa_ki = iiwa_ki.replicate(num_iiwa, 1).eval();
    controller = builder.AddController<InverseDynamicsController<double>>(
        RigidBodyTreeConstants::kFirstNonWorldModelInstanceId, tree.Clone(),
        iiwa_kp, iiwa_ki, iiwa_kd,
        false /* without feedforward acceleration */);
  }

Thanks

Yuki
  • 139
  • 6

1 Answers1

0

The manipulation station is just a wrapper on multibodyplant (which also adds cameras, and objects, etc) in the way that we use it for teaching in an MIT manipulation class. In that use case, we always run the kuka in it's joint impedance control mode; the inverse dynamics block in drake accomplishes almost the same. (I'm actually planning to replace it with the proper joint impedance controller soon, but it's not been a top priority yet).

But if you use multibodyplant yourself, or are willing to change/copy the manipulation station code, then you can absolutely send torque commands to the robot. (that's what the inverse dynamics controller is doing right now)

Russ Tedrake
  • 4,703
  • 1
  • 7
  • 10