-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforceToTorque_11.m
28 lines (22 loc) · 1.02 KB
/
forceToTorque_11.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function tau = forceToTorque_11(F, J)
% FORCETOTORQUE_GROUPNO Calculate the joint torques required to exert a
% specific set of end-effector forces/torques in a given configuration.
% Note that you can write this function entirely generally, with no
% reference to the Lynx. CHANGE GROUPNO TO YOUR GROUP NUMBER.
%
% INPUTS:
% F - 1 x 6 vector of desired forces/torques (where F(1:3) is the
% forces and F(4:6) is the torques)
% J - the 6xN jacobian of the robot in its current configuration
%
% OUTPUTS:
% tau - Nx1 vector of joint torques required to generate F.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Your Code Starts Here %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tau = transpose(J)*F.'; %get torque vector from force vector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Your Code Ends Here %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end