robot = loadrobot('kukaIiwa14', 'DataFormat', 'column');
title('Complete Robot Visualization');
arm1Bodies = robot.BodyNames(2:5);
arm2Bodies = robot.BodyNames(5:end);
for i = 1:length(arm1Bodies)
body = getBody(robot, arm1Bodies{i});
addBody(arm1, body, 'base');
addBody(arm1, body, body.Parent.Name);
for i = 1:length(arm2Bodies)
body = getBody(robot, arm2Bodies{i});
addBody(arm2, body, 'base');
addBody(arm2, body, body.Parent.Name);
title('Visualization of Arm 1');
title('Visualization of Arm 2');
configArm1 = homeConfiguration(arm1);
configArm2 = homeConfiguration(arm2);
jacobianArm1 = geometricJacobian(arm1, configArm1, arm1.BodyNames{end});
jacobianArm2 = geometricJacobian(arm2, configArm2, arm2.BodyNames{end});
disp('Jacobian for Arm 1:');
disp('Jacobian for Arm 2:');
endEffectorPoseArm1 = getTransform(arm1, configArm1, arm1.BodyNames{end});
endEffectorPoseArm2 = getTransform(arm2, configArm2, arm2.BodyNames{end});
disp('End-Effector Pose for Arm 1:');
disp(endEffectorPoseArm1);
disp('End-Effector Pose for Arm 2:');
disp(endEffectorPoseArm2);