% tutorial2.m % % Virtual work and force using the Freeform Manipulator Analysis Tool % Created 06/2010 by Lael Odhner % start by running the script from the previous example to create a robot % object. tutorial1; % Define an energy storage mode corresponding to force at the endpoint of % the manipulator. r.Add_ES_Mode('tip', 'const_force', Link2_Dist); r.ES_Mode('tip').SetForce([1; -1; 0]); % For the moment, we'll assume that the manipulator is actuated serially, % at each joint. Thus, the actuator forces corresponding to this coordinate % system are the generalized forces. Here we calculate it for the % configuration q1 used above. f_gen = r.Force(q1); % We can also find the minimum energy configuration corresponding to this % force (should be extended at -45 degrees, straight out) q_min = r.MinimizeEnergy(q1);