Home > demos > rtandemo.m

rtandemo

PURPOSE ^

RTANDEMO Animation demo

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

RTANDEMO Animation demo

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %RTANDEMO Animation demo
0002 
0003 %**************************animation********************************************
0004 figure(2)
0005 echo on
0006 clf
0007 %
0008 % The trajectory demonstration has shown how a joint coordinate trajectory
0009 % may be generated
0010     t = [0:.056:2]';     % generate a time vector
0011     q = jtraj(qz, qr, t); % generate joint coordinate trajectory
0012 %
0013 % the overloaded function plot() animates a stick figure robot moving
0014 % along a trajectory.
0015 
0016     plot(p560, q);
0017 % The drawn line segments do not necessarily correspond to robot links, but
0018 % join the origins of sequential link coordinate frames.
0019 %
0020 % A small right-angle coordinate frame is drawn on the end of the robot to show
0021 % the wrist orientation.
0022 %
0023 % A shadow appears on the ground which helps to give some better idea of the
0024 % 3D object.
0025 
0026 pause % any key to continue
0027 %
0028 % We can also place additional robots into a figure.
0029 %
0030 % Let's make a clone of the Puma robot, but change its name and base location
0031 
0032     p560_2 = p560;
0033     p560_2.name = 'another Puma';
0034     p560_2.base = transl(-0.5, 0.5, 0);
0035     hold on
0036     plot(p560_2, q);
0037 pause % any key to continue
0038 
0039 % We can also have multiple views of the same robot
0040     clf
0041     plot(p560, qr);
0042     figure
0043     plot(p560, qr);
0044     view(40,50)
0045     plot(p560, q)
0046 pause % any key to continue
0047 %
0048 % Sometimes it's useful to be able to manually drive the robot around to
0049 % get an understanding of how it works.
0050 
0051     drivebot(p560)
0052 %
0053 % use the sliders to control the robot (in fact both views).  Hit the red quit
0054 % button when you are done.
0055 echo off

Generated on Sun 15-Feb-2009 18:09:29 by m2html © 2003