You can use the "getxy" block to get the current (x, y) coordinate location of the robot:
The pop-up menu also allows you to use it as a "getposition" block to get the full position of the robot, including its angle of orientation:
This lesson also uses a "print" block (found in the Text menu): Since the video was created, the way this print block works has been changed slightly. Instead of printing the result in a popup window, it opens a printing "Console" below the Workspace and displays the printed result there. (Click the "Console" button next to the "Show Ch" button to toggle the Console open or closed.) This allows us to see the results of multiple print commands at the same time in the Console, instead of one at a time as was the case with the popup window shown in the video. The other change to note is the addition of a "\n" in the print block, as seen above. The "\n" tells RoboBlockly to start a new printing line at that point ("\n" standing for "newline").
|
Drive the robot to (15,18), get its coordinates, and output the coordinates to the user. |
Drive the robot directly to the point (12,12), get its coordinates and angle of orientation, and output the results to the user. |
Grid Size: S M L | Simple View: | MinView: |
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
|||||||||||
|
|||||||||||