IRDYn/complie/R1000 DVT GravityModel V1/calculateGravityModel.m

29 lines
1020 B
Mathematica
Raw Normal View History

2024-12-16 16:33:21 +00:00
function GravityTorque = calculateGravityModel(thetaMea,permutationMatrix,pib_MLS)
% Example:
% thetalist = [0;0;0;0;0;pi/2;0;0;0];
2024-12-17 13:44:56 +00:00
% calculateGravityModel(thetalist,permutationMatrix,pib_MLS)
2024-12-16 16:33:21 +00:00
% code start
opt.robot_def = 'direct';
opt.KM_method = 'SCREW';
opt.Vel_method = 'Direct';
opt.LD_method = 'Direct';
2024-12-17 13:44:56 +00:00
opt.debug = false;
2024-12-16 16:33:21 +00:00
opt.robotName = 'R1000_DVT';
opt.reGenerate = false;
opt.Isreal = true;
2024-12-17 13:44:56 +00:00
% get_robot_func = sprintf('get_robot_%s',opt.robotName);
% robot = feval(get_robot_func,thetaMea,zeros(size(thetaMea)),zeros(size(thetaMea)),opt);
% get_Kinematics_func = sprintf('get_Kinematics_%s',opt.robotName);
% robot = feval(get_Kinematics_func,robot,opt);
robot = get_robot_R1000_DVT(thetaMea,zeros(size(thetaMea)),zeros(size(thetaMea)),opt);
robot = get_Kinematics_R1000_DVT(robot,opt);
2024-12-16 16:33:21 +00:00
% FIXME
robot = get_velocity(robot, opt);
robot = get_regressor(robot,opt);
% get base params
% hack numberOfBaseParameters =15
Yb = robot.regressor.K*permutationMatrix(:,1:15);
2024-12-17 13:44:56 +00:00
% % get torque
2024-12-16 16:33:21 +00:00
GravityTorque = Yb*pib_MLS;