Practica 1
Practica 1
Practica 1
jta1=rigidBodyJoint('jta1','revolute');
cuerpo1.Joint=jta1;
jta1.HomePosition=pi/4;
robot=rigidBodyTree;
addBody(robot,cuerpo1,'base')
showdetails(robot);
cuerpo2=rigidBody('cuerpo2');
>> jta2=rigidBodyJoint('jta2','revolute');
>> cuerpo2.Joint=jta2;
>> addBody(robot,cuerpo2,'cuerpo1');
>> showdetails(robot);
cuerpo3=rigidBody('cuerpo3');
>> jta3=rigidBodyJoint('jta3','revolute');
>> cuerpo3.Joint=jta3;
>> addBody(robot,cuerpo3,'cuerpo2');
>> showdetails(robot);
bodyEndEffector=rigidBody('endeffector');
>> addBody(robot,bodyEndEffector,'cuerpo3');
>> showdetails(robot);
Datos generales
intermediateDistance = 0.3;
distanceFromCup.TargetPosition = [0,0,intermediateDistance];
fixOrientation.TargetOrientation = tform2quat(getTransform(lbr,qWaypoints(2,:),gripper));
finalDistanceFromCup = 0.05; distanceFromCupValues = linspace(intermediateDistance,
finalDistanceFromCup, numWaypoints-1);
maxJointChange = deg2rad(10);
tpts = 0:4;
sampleRate = 20;
tvec = tpts(1):1/sampleRate:tpts(end);
numSamples = length(tvec);
robot = loadrobot('abbIrb120',DataFormat='column');
>> rng default
frankaWaypoints = [robot.homeConfiguration robot.randomConfiguration
robot.randomConfiguration];
frankaTimepoints = linspace(tvec(1),tvec(end),3);
[q,qd] = trapveltraj(frankaWaypoints,numSamples);
>> figure
set(gcf,'Visible','on');
rc = rateControl(sampleRate);
for i = 1:numSamples
show(robot,q(:,i),FastUpdate=true,PreservePlot=false);
waitfor(rc);
end