Search code examples
drake

What kind of input does "actuation input port" refer to?


Recently I try to implement a "velocity-resolved" controller to a robotic manipulator in drake simulation.In detail, given a desired velocity v_d in task space, we calculate the joints' velocity q_dot via v_d = J * q_dot.

Hence I want to directly access to joint velocity in my multibody::plant(from urdf file). Here are some questions confusing me:


  1. What kind of input does "plant->get_actuation_input_port()" refer to?
    Dose it refer to"position", "velocity" or "torque"?
    Is there a way to specify one of them?(The multibod::plant is imported from a urdf file)

  2. Is it better if I directly "set angular rate" of joints in every time step?
    Another way to directly access to velocity is setting angular rate of the joints; i.e.,

const multibody::RevoluteJoint<double>& joint_1 = 
            plant->GetJointByName<multibody::RevoluteJoint>("joint1");

for ( double t = FLAGS_sim_dt ; t < FLAGS_simulation_sec; t += FLAGS_sim_dt)  
{
   joint_1.set_angular_rate(&plant_context, v_d);
   simulator.AdvanceTo(t);
}

In this way I can directly command the velocity but there is no controllerSystem connect to the plant->get_actuation_input_port().


Solution

    1. The actuation input port are torques.

    2. If you set the joint velocity at every time step, you will be overwriting the physics. I don't think you want to do that. The current approach to accomplishing this goal is to use an InverseDynamicsController to regulate the actual velocity to the desired velocity. (This is a fairly accurate representation of what would happen on a real system).