Location#
Introduction#
The VEX VR Location Sensor can track the robot’s location and angle within the different playgrounds.
Below is a list of all available blocks:
position – Returns the robot’s X or Y coordinate.
position angle – Returns the robot’s angle.
position#
The position block returns the X or Y coordinate position of the VR Robot.
(position [X v] in [mm v])
Parameters |
Description |
|---|---|
axis |
The axis to return the position of:
|
units |
The unit to represent the position:
|
when started :: hat events
[Display the Y position after driving.]
drive [forward v]
wait (2) seconds
stop driving
print (position [Y v] in [mm v]) ▶
position angle#
The position angle block returns the angle of the robot in degrees.
(position angle in degrees)
Parameters |
Description |
|---|---|
This block has no parameters. |
when started :: hat events
[Display the angle after turning.]
turn [right v]
wait (2) seconds
stop driving
print (position angle in degrees) ▶