CourseWare Wiki
Search
Log In
b181
help
common
robot_pan_tilt_megarobot_en
Warning
This page is located in archive.
Differences
This shows you the differences between two versions of the page.
View differences:
Side by Side
Inline
Go
Link to this comparison view
Both sides previous revision
Previous revision
2014/02/19 13:29 zimmerk [How to control the PT unit]
2014/02/19 13:29 zimmerk [How to control the PT unit]
2014/02/19 13:28 zimmerk
2014/02/19 13:27 zimmerk [How to control the unit]
2014/02/19 13:25 zimmerk [Pan-Tilt unit Megarobot]
2014/02/19 13:23 zimmerk
2014/02/19 13:23 zimmerk
2014/02/19 13:22 zimmerk
2014/02/19 13:21 zimmerk [How to control the unit]
2014/02/19 13:20 zimmerk
2014/02/19 13:14 zimmerk created
Go
Next revision
Previous revision
2014/02/19 13:29 zimmerk [How to control the PT unit]
2014/02/19 13:29 zimmerk [How to control the PT unit]
2014/02/19 13:28 zimmerk
2014/02/19 13:27 zimmerk [How to control the unit]
2014/02/19 13:25 zimmerk [Pan-Tilt unit Megarobot]
2014/02/19 13:23 zimmerk
2014/02/19 13:23 zimmerk
2014/02/19 13:22 zimmerk
2014/02/19 13:21 zimmerk [How to control the unit]
2014/02/19 13:20 zimmerk
2014/02/19 13:14 zimmerk created
Go
help:common:robot_pan_tilt_megarobot_en [2014/02/19 13:25]
zimmerk
[Pan-Tilt unit Megarobot]
help:common:robot_pan_tilt_megarobot_en [2018/02/03 10:49]
(current)
Line 10:
Line 10:
* We encourage the student to read a short description of the "{{:help:common:zaciname_s_aimotorem.pdf|Zacínáme s AI-MOTORem}}", provided by ([[http://www.megarobot.net/|MEGAROBOT.NET]]), where the first step of working with the drive in that program are described.
* We encourage the student to read a short description of the "{{:help:common:zaciname_s_aimotorem.pdf|Zacínáme s AI-MOTORem}}", provided by ([[http://www.megarobot.net/|MEGAROBOT.NET]]), where the first step of working with the drive in that program are described.
-
==== How to control the unit ====
+
==== How to control the
PT
unit ====
-
Pan -Tilt unit can be controlled in MATLAB using [[http://www.mathworks.com/help/matlab/matlab_external/getting-started-with-serial-i-o.html|Serial Port I/O]].
+
Pan-Tilt unit can be controlled in MATLAB using [[http://www.mathworks.com/help/matlab/matlab_external/getting-started-with-serial-i-o.html|Serial Port I/O]].
- Pan-Tilt is initialized by the following sequence of commands <code>ser = serial('COM1');
- Pan-Tilt is initialized by the following sequence of commands <code>ser = serial('COM1');
set(ser,'BaudRate',57600);
set(ser,'BaudRate',57600);
fopen(ser);</code>
fopen(ser);</code>
-
- You can control the unit by writing corresponding control bytes (see {{:help:common:aimotor701_manual_megarobot.pdf|manuál}}) to the file ''ser'' using command ''fwrite''.
+
- You can control the
PT
unit by writing corresponding control bytes (see {{:help:common:aimotor701_manual_megarobot.pdf|manuál}}) to the file ''ser'' using command ''fwrite''.
-
- To simplify the
unit
control the following function is provided:<code>ptmove(ser, pan_pos, tilt_pos);</code> where ''pan_pos'' corresponds to the absolute rotation angle around vertical axis, ''tilt_pos'' absolute
roation
angle around horizontal axis. Range of values for ''pan_pos'' and ''tilt_pos'' is from 0 to 254.
I
covers approximately 80 degrees in a given direction. To set the unit into the initial position (i.e. the position camera optical axis is perpendicular to LCD screen) use the following values ''pan_pos==127'', ''tilt_pos==127''.<code>function ptmove(ser, pan_pos, tilt_pos, speed)
+
- To simplify the
PT
control the following function is provided:<code>ptmove(ser, pan_pos, tilt_pos);</code> where ''pan_pos'' corresponds to the absolute rotation angle around vertical axis, ''tilt_pos''
corresponds to the
absolute
rotation
angle around horizontal axis. Range of values for ''pan_pos'' and ''tilt_pos'' is from 0 to 254.
It
covers approximately 80 degrees in a given direction. To set the unit into the initial position (i.e. the position
, where
camera optical axis is perpendicular to
the
LCD screen) use the following values ''pan_pos==127'', ''tilt_pos==127''.<code>function ptmove(ser, pan_pos, tilt_pos, speed)
if nargin<4
if nargin<4
speed = 3;
speed = 3;
Line 36:
Line 36:
end
end
</code>
</code>
-
- In the end, the communication is
close
as follows:<code>fclose(ser);
+
- In the end, the communication is
closed
as follows:<code>fclose(ser);
delete(ser);</code>
delete(ser);</code>
help/common/robot_pan_tilt_megarobot_en.1392812732.txt.gz
· Last modified: 2018/02/03 10:48 (external edit)