-
Notifications
You must be signed in to change notification settings - Fork 0
/
DriveJoints.m
40 lines (37 loc) · 1.12 KB
/
DriveJoints.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
% DriveJoints(Robot,Name,Value,Steer,Order)
% Drive Robots joint
% NOT TESTED
% Amirkabir University of Tehran (Tehran Polytechnic)
% Summer 2011
% http://www.mechatronics3d.com
function DriveJoints(Robot,Name,Value,Steer,Order)
if nargin > 5
error('Too many input arguments');
elseif nargin < 2
error('Too few input arguments');
elseif nargin == 5
Msg=['DRIVE {Name ' Name '}'];
if ~ischar(Value)
Msg=[Msg ' {Value ' num2str(Value) '}'];
end
if ~ischar(Steer)
Msg=[Msg ' {Steer ' num2str(Steer) '}'];
end
if ~ischar(Order)
Msg=[Msg ' {Order ' num2str(Order) '}'];
end
elseif nargin == 4
Msg=['DRIVE {Name ' Name '}'];
if ~ischar(Value)
Msg=[Msg ' {Value ' num2str(Value) '}'];
end
if ~ischar(Steer)
Msg=[Msg ' {Steer ' num2str(Steer) '}'];
end
elseif nargin == 3
Msg=['DRIVE {Name ' Name '} {Value ' num2str(Value) '}'];
elseif nargin == 2
Msg=['DRIVE {Name ' Name '} {Value 0}'];
end
fprintf(Robot.Connection,Msg);
end