Movimiento#

Introducción#

The VEX AIM Coding Robot uses a holonomic drivetrain to move forward, reverse, left, right, or at an angle while also being able to turn independently. Motion blocks control how the robot moves and turns, how fast it moves, and how its x and y position are tracked.

Esfera de brújula circular de 0 a 315 grados que rodea una pantalla gris oscuro con pantalla azul marino. La parte frontal del robot apunta a 0 grados en la esfera de brújula.

A continuación se muestra una lista de todos los bloques:

Acciones: Mover y girar el robot.

  • move — Moves the robot forward, reverse, left, or right forever.

  • move at angle — Moves the robot at a specific angle forever.

  • mover para — Mueve el robot en una dirección específica durante una distancia determinada.

  • move at angle for — Moves the robot at a specific angle for a specific distance.

  • turn — Turns the robot left or right forever.

  • turn for — Turns the robot left or right for a specific number of degrees.

  • turn to heading — Turns the robot to face a specific heading.

  • mover con controlador — Permite que el robot sea conducido usando el controlador.

  • detener todo movimiento — Detiene todo movimiento del robot.

Ajustes: Ajusta la velocidad de movimiento y de giro.

Posición: Rastrea y modifica la posición del robot.

  • position — Reports the robot’s current x or y coordinate.

  • set robot position — Changes the robot’s current x and y position to new values.

Valores: comprobar el estado del movimiento.

  • move active? — Reports whether the robot is moving.

  • turn active? — Reports whether the robot is turning.

  • stopped? — Reports whether the robot is neither moving nor turning.

Comportamiento#

mover#

The move stack block moves the robot forward, reverse, left, or right forever using the current move velocity. The robot will continue to move until it is given another action, like moving in a different direction, turning, or stopping.

mover bloque de pila hacia adelante#
move [forward v]

Parámetros

Descripción

dirección

The direction the robot moves:

  • forward
  • reverse
  • left
  • right

Ejemplo

Cuando comiences, sigue adelante#
when started
[Move forward]
move [forward v]

moverse en ángulo#

The move at angle stack block moves the robot forever at a specific angle using the current move velocity. The angle is relative to the current position of the robot. The robot will continue to move until it is given another action, like moving in a different direction, turning, or stopping.

mover el bloque de pila a 90 grados#
move at (90) degrees

Parámetros

Descripción

ángulo

The angle, in degrees, that the robot moves. This can be an integer or decimal from -360 to 360.

Ejemplos

Cuando se inicia, se mueve 90 grados a la derecha, espera 1 segundo, luego se mueve hacia adelante 0 grados, espera 1 segundo y detiene todo movimiento.#
when started
[Move right, then move forward and stop.]
move at (90) degrees
wait (1) seconds
move at (0) degrees
wait (1) seconds
stop all movement

Cuando se inicia, se mueve en diagonal hacia la derecha a 45,33 grados, espera 1 segundo y luego detiene todo movimiento.#
when started
[Move diagonally to the right and stop.]
move at (45.33) degrees
wait (1) seconds
stop all movement

moverse para#

The move for stack block moves the robot forward, reverse, left, or right for a specific distance using the current move velocity. The direction is relative to the current position of the robot. The project will wait until the robot is done moving before the next block in the stack runs.

Avanzar para bloque de pila de 200 mm#
move [forward v] for (200) [mm v] ▶

Parámetros

Descripción

dirección

The direction the robot moves:

  • forward
  • reverse
  • left
  • right

distancia

The distance the robot moves. This can be an integer or a decimal.

unidad

The distance unit: mm (millimeters) or inches.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplo

Al iniciar, avanzar un bloque de pila de 200 mm.#
when started
[Move forward for 200 mm]
move [forward v] for (200) [mm v] ▶

moverse en ángulo para#

The move at angle for stack block moves the robot at a specific angle for a specific distance using the current move velocity. The angle is relative to the current position of the robot. The project will wait until the robot is done moving before the next block in the stack runs.

mover en ángulo para el bloque de pila#
move at (45) degrees for (200) [mm v] ▶

Parámetros

Descripción

ángulo

The angle, in degrees, that the robot moves. This can be an integer or decimal from -360 to 360.

distancia

The distance the robot moves. This can be an integer or a decimal.

unidad

The distance unit: mm (millimeters) or inches.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplos

Al iniciarse, se mueve 90 grados a la derecha durante 50 mm, luego se mueve hacia adelante 0 grados durante 100 mm.#
when started
[Move right, then move forward.]
move at (90) degrees for (50) [mm v] ▶
move at (0) degrees for (100) [mm v] ▶

Cuando se inicia, avanza a 0 grados durante 100 mm mientras todos los LED parpadean en rojo.#
when started
[Drive forward and blink all LEDs red.]
move at (0) degrees for (100) [mm v] ◀ and don't wait
set [lightall v] LED color to [red v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds
set [lightall v] LED color to [red v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds

doblar#

The turn stack block turns the robot left or right forever using the current turn velocity. The robot will continue to turn until it is given another action, like moving or stopping.

bloque de pila de giro a la derecha#
turn [right v]

Parámetros

Descripción

dirección

The direction the robot turns: left or right.

Ejemplo

Al iniciarse, gira a la izquierda, espera 1 segundo y luego detiene todo movimiento.#
when started
[Turn left, then stop.]
turn [left v]
wait (1) seconds
stop all movement

girar para#

The turn for stack block turns the robot left or right for a specific number of degrees using the current turn velocity. The turn is relative to the current direction the robot is facing. The project will wait until the robot is done turning before the next block in the stack runs.

Gire a la derecha para el bloque de pila de 90 grados#
turn [right v] for (90) degrees ▶

Parámetros

Descripción

dirección

The direction the robot turns: left or right.

ángulo

The number of degrees the robot turns. This can be an integer or a decimal.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplos

Al arrancar, gira 90 grados a la izquierda y luego 180 grados a la derecha.#
when started
[Turn left, then turn around to the right.]
turn [left v] for (90) degrees ▶
turn [right v] for (180) degrees ▶

Al iniciarse, gira 180 grados a la derecha mientras parpadean todos los LED en azul.#
when started
[Turn right and blink all LEDs blue.]
turn [right v] for (180) degrees ◀ and don't wait
set [lightall v] LED color to [blue v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds
set [lightall v] LED color to [blue v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds

girar al rumbo#

A heading is the direction the robot is facing, measured in degrees. The turn to heading stack block turns the robot to face a specific heading using the current turn velocity. The robot will turn the shortest direction to reach the target heading.

The robot’s starting heading is 0 degrees.

The project will wait until the robot is done turning before the next block in the stack runs.

Gire a la dirección 90 grados bloque de pila#
turn to heading (270) degrees ▶

Parámetros

Descripción

título

The heading the robot should face, from -360 to 360 degrees.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplos

when started
[Turn to face each cardinal direction.]
turn to heading (90) degrees ▶
wait (2) seconds
turn to heading (180) degrees ▶
wait (2) seconds
turn to heading (270) degrees ▶
wait (2) seconds
turn to heading (0) degrees ▶
wait (2) seconds

Al iniciarse, gira rápidamente 180 grados mientras todos los LED parpadean en verde.#
when started
[Turn around quickly and blink all LEDs green.]
turn to heading (180) degrees ◀ and don't wait
set [lightall v] LED color to [green v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds
set [lightall v] LED color to [green v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds

moverse con el controlador#

The move with controller stack block lets you drive the robot using the One Stick Controller. This block only reads the controller input once, unless placed inside of a loop, such as a forever loop. If the loop stops and there are no other blocks telling the robot to move, the robot will keep going in the last direction you pushed the joystick.

move with controller

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

when started
[Drive with the controller for five seconds.]
reset timer
while <(timer in seconds) [math_less_than v] [5]>
move with controller
fin
stop all movement

detener todo movimiento#

The stop all movement stack block stops all movement of the robot.

Detener todo bloque de pila de movimiento#
stop all movement

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al iniciarse, gira a la derecha, espera 1 segundo y luego detiene todo movimiento.#
when started
[Turn right, then stop.]
turn [right v]
wait (1) seconds
stop all movement

Ajustes#

establecer velocidad de movimiento#

The set move velocity stack block tells the robot how fast to move. A higher percentage makes the robot move faster and a lower percentage makes the robot move slower.

Every project begins with the robot moving at 50% velocity by default.

A move velocity of 100% is equivalent to 200 millimeters per second (mmps).

establecer la velocidad de movimiento al 50% del bloque de pila#
set move velocity to (50)%

Parámetros

Descripción

velocidad

The velocity to move with from 0% to 100%.

Ejemplo

when started
[Move forward at the default velocity.]
set move velocity to (50)%
move at (0) degrees for (100) [mm v] ▶
wait (1) seconds
[Move slower.]
set move velocity to (20)%
move at (0) degrees for (100) [mm v] ▶
wait (1) seconds
[Move faster.]
set move velocity to (100)%
move at (0) degrees for (100) [mm v] ▶
wait (1) seconds

establecer la velocidad de giro#

The set turn velocity stack block tells the robot how fast to turn. A higher percentage makes the robot turn faster and a lower percentage makes the robot turn slower.

Every project begins with the robot turning at 50% velocity by default.

A turn velocity of 100% is equivalent to 150 degrees per second \(dps\).

Establezca la velocidad de giro al 50 % del bloque de pila#
set turn velocity to (50)%

Parámetros

Descripción

velocidad

The velocity to turn with from 0% to 100%.

Ejemplo

when started
[Turn around at default velocity.]
set turn velocity to (50)%
turn [right v] for (180) degrees ▶
wait (1) seconds
[Turn around slower.]
set turn velocity to (20)%
turn [right v] for (180) degrees ▶
wait (1) seconds
[Turn around faster.]
set turn velocity to (100)%
turn [right v] for (180) degrees ▶
wait (1) seconds

Posición#

posición#

The position reporter block reports the robot’s current x or y-coordinate.

At the beginning of a project, the robot’s x and y positions are set to 0. The position values change as the robot moves and can be set using the set robot position block.

Posición x en el bloque de reportero mm#
[x v] position in [mm v]

Parámetros

Descripción

coordinar

The coordinate axis to report: x or y.

unidad

The position unit: mm (millimeters) or inches.

Ejemplo

Cuando se inicia, se mueve hacia adelante 200 mm, restablece la posición, se mueve en diagonal a 45 grados durante 200 mm e imprime las coordenadas X e Y actualizadas en la pantalla.#
when started
move at (0) degrees for (200) [mm v] ▶
[Move forward and print the new coordinate and heading.]
set robot position x:[0] y:[0]
move at (45) degrees for (200) [mm v] ▶
print ([x v] position in [mm v]) on screen ▶
set cursor to next row on screen
print ([y v] position in [mm v]) on screen ▶

establecer la posición del robot#

The set robot position stack block changes the robot’s current x and y position to new values.

For example, if the robot has moved away from its starting point, setting x to 0 and y to 0 makes the robot’s current location the new 0, 0 position. Then the robot can track future positions based on that new value.

bloque de pila de posición de establecimiento#
set robot position x:[0] y:[0]

Parámetros

Descripción

incógnita

The x-position value to set for the robot, in mm.

y

The y-position value to set for the robot, in mm.

Ejemplo

when started
[Reset the robot's position after moving.]
move [forward v] for [60] [mm v] ▶
set robot position x:[0] y:[0]
print ([y v] position in [mm v]) on screen ▶

Valores#

move active#

The move active Boolean block reports whether the robot is moving. This can be used to control the timing of other behaviors based on the robot’s movement.

  • True — The robot is moving.

  • False — The robot is not moving.

This block works together with Motion blocks that have the and don’t wait parameter.

¿Es un bloque de reportero activo el movimiento?#
<move active?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al iniciarse, avanza 200 mm mientras todos los LED parpadean en rojo. Los LED se encienden y apagan cada 0,5 segundos mientras el robot se mueve y permanecen apagados al detenerse.#
when started
[Blink all of the LEDs when the robot is moving.]
move at (0) degrees for (200) [mm v] ◀ and don't wait
while <move active?>
set [lightall v] LED color to [red v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds
fin
set [lightall v] LED color to [off v]

turn active#

The turn active Boolean block reports whether the robot is turning. This can be used to control the timing of other behaviors based on the robot’s movement.

  • True — The robot is turning.

  • False — The robot is not turning.

This block works together with Motion blocks that have the and don’t wait parameter.

Activar el bloque de reportero#
<turn active?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al arrancar, gira 180 grados a la derecha mientras todos los LED parpadean en rojo. Los LED parpadean cada 0,5 segundos y se apagan al finalizar el giro.#
when started
[Blink all of the LEDs while the robot is turning.]
turn [right v] for (180) degrees ◀ and don't wait
while <turn active?>
set [lightall v] LED color to [red v]
wait (0.5) seconds
set [lightall v] LED color to [off v]
wait (0.5) seconds
fin
set [lightall v] LED color to [off v]

stopped#

The stopped Boolean block reports whether the robot is neither moving nor turning. This can be used to control the timing of other behaviors based on the robot’s movement.

  • True — The robot is not moving or turning.

  • False — The robot is moving or turning.

Se detiene el bloqueo del reportero#
<stopped?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Al iniciarse, el robot avanza 200 mm mientras realiza un espectáculo de luces y luego gira 180 grados a la derecha, continuando con el espectáculo. Los LED alternan entre verde y morado cada 0,5 segundos mientras el robot se mueve o gira. Al detenerse, el espectáculo de luces finaliza y los LED se apagan.#
definir light show
[Flash LEDs while the robot is moving or turning.]
repeat until <stopped?>
set [lightall v] LED color to [green v]
wait (0.5) seconds
set [lightall v] LED color to [purple v]
wait (0.5) seconds
fin


when started
[Blink all the LEDs while the robot is moving or turning.]
move at (0) degrees for (200) [mm v] ◀ and don't wait
light show
turn [right v] for (180) degrees ◀ and don't wait
light show