Cody

Solution 1882923

Submitted on 24 Jul 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[0 0 0]; robot = forwardkinematics(robot); yc=robot.attitude; correct_attitude=[0 sum(robot.links) pi/2]; assert(isequal(yc,correct_attitude))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test1 (line 3) robot = forwardkinematics(robot);

2   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[pi/4 0 0]; robot = forwardkinematics(robot); yc=robot.attitude; correct_attitude=[-0.5*sqrt(2)*sum(robot.links) 0.5*sqrt(2)*sum(robot.links) 3*pi/4]; assert(isequal(yc,correct_attitude))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test2 (line 3) robot = forwardkinematics(robot);

3   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[pi/4 pi 3*pi/4]; robot = forwardkinematics(robot); yc=robot.attitude correct_attitude=[-0.5*sqrt(2)*(robot.links(1)-robot.links(2)) 0.5*sqrt(2)*(robot.links(1)-robot.links(2))+robot.links(3) pi/2] assert(all(abs(yc-correct_attitude)<=eps))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test3 (line 3) robot = forwardkinematics(robot);

4   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[-pi/4 pi/4 0]; robot = forwardkinematics(robot); yc=robot.attitude; correct_attitude=[0.5*sqrt(2)*robot.links(1) 0.5*sqrt(2)*robot.links(1)+sum(robot.links(2:3)) pi/2]; assert(all(abs(yc-correct_attitude)<=eps))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test4 (line 3) robot = forwardkinematics(robot);

5   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[-2.1513 2.9568 2.8725]; robot = forwardkinematics(robot); yc=robot.attitude correct_attitude=[0.246878929631356 -0.220349832044192 5.248796326794897] assert(all(abs(yc-correct_attitude)<=1e-8))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test5 (line 3) robot = forwardkinematics(robot);

6   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[-0.0919 1.8867 -2.2501]; robot = forwardkinematics(robot); yc=robot.attitude correct_attitude=[-0.260952279814086 0.667368060676958 1.115496326794896]; assert(all(abs(yc-correct_attitude)<=1e-8))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test6 (line 3) robot = forwardkinematics(robot);

7   Fail
robot.links=[0.5 0.45 0.3]; robot.jointangles=[-0.4916 2.6121 1.8360]; robot = forwardkinematics(robot); yc=robot.attitude correct_attitude=[0.070611406176580 -0.000086942065283 5.527296326794897]; assert(all(abs(yc-correct_attitude)<=1e-8))

Output argument "newrobot" (and maybe others) not assigned during call to "forwardkinematics". Error in Test7 (line 3) robot = forwardkinematics(robot);