Bloques específicos para robots#
Introducción#
The VR Rover Robot includes a Drivetrain, Distance Sensor and actions unique to the Rover Rescue Playground.
All standard VEXcode VR blocks are available for use in the Rover Rescue Playground.
Below is a list of all available Robot-specific Blocks:
Drivetrain - Move and turn the VR Rover.
Comportamiento
drive - Moves the VR Rover forward or reverse forever.
drive for - Moves the VR Rover forward or reverse for a specific distance.
turn - Turns the VR Rover left or right forever.
turn for - Turns the VR Rover left or right for a specific number of degrees.
girar rumbo - Gira el VR Rover para que mire hacia un rumbo específico.
ir al objeto - Gira y conduce el VR Rover hacia el objeto seleccionado.
stop driving - Stops the VR Rover’s movement.
Ajustes
set drive velocity - Tells the VR Rover how fast to drive.
set turn velocity - Tells the VR Rover how fast to turn.
set drive heading - Changes the VR Rover’s current heading to a new heading.
set drive timeout – Sets how many seconds the VR Rover will try to finish a movement.
Valores
drive is done - Reports whether the VR Rover is finished moving.
drive is moving - Reports whether the VR Rover is moving.
drive heading - Reports the VR Rover’s current heading from 0 to 359.99 degrees.
Acciones: Interactúa con los recursos, los enemigos y los sistemas de IA integrados del vehículo explorador.
Comportamiento
acción de minerales - Recoge, suelta o usa minerales.
absorber radiación enemiga - Absorbe la radiación de un enemigo.
standby - Pone el VR Rover en modo de espera hasta que se alcance un umbral de batería.
Valores
el rover ve - Devuelve si el VR Rover ve un objeto en su rango de visión.
el rover detecta - Devuelve si el VR Rover detecta minerales o enemigos en su radio de detección.
minerales en almacenamiento - Devuelve la cantidad de minerales que transporta el VR Rover.
capacidad de almacenamiento - Devuelve la capacidad de carga actual del VR Rover.
dirección del rover - Devuelve la dirección de un objeto en grados.
distancia del rover - Devuelve la distancia a un objeto en milímetros o pulgadas.
ubicación del rover - Devuelve la coordenada X o Y de un objeto en milímetros o pulgadas.
under attack - Returns whether the VR Rover is currently under attack.
Nivel del enemigo - Devuelve el nivel del enemigo detectado más cercano.
radiación enemiga - Devuelve la radiación del enemigo detectado más cercano.
nivel de batería - Devuelve el nivel actual de batería del VR Rover en %.
nivel - Devuelve el nivel actual del VR Rover.
XP - Devuelve los puntos de experiencia actuales del VR Rover.
cuando está bajo ataque - Ejecuta los bloques adjuntos cuando el VR Rover es atacado.
cuando sube de nivel - Ejecuta los bloques adjuntos cuando el VR Rover sube de nivel.
Detección: Detecta objetos cercanos con el sensor de distancia del rover.
Distance found an object - Returns whether the Distance Sensor detects an object.
distancia del objeto - Devuelve la distancia al objeto detectado más cercano.
Los ejemplos de esta página utilizan la posición de inicio predeterminada del Playground.
Tren de transmisión#
The drivetrain controls how the VR Rover drives and turns. The drivetrain can move forward or reverse, turn left or right, turn to headings, and report its heading.
Comportamiento#
conducir#
The drive stack block moves the robot forward or reverse forever. The robot will continue to move until it is given another action, like turning or stopping.
unidad [adelante v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot moves: forward or reverse. |
Ejemplo
cuando empezó
[Drive forward, then stop.]
unidad [adelante v]
esperar (2) segundos
deja de conducir
impulso para#
The drive for stack block moves the robot forward or reverse for a specific distance. The project will wait until the robot is done moving before the next block in the stack runs.
unidad [adelante v] para (200) [mm v] ▶
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot moves: forward or reverse. |
distancia |
The distance the robot drives. 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
cuando empezó
[Drive forward for 500 mm.]
unidad [adelante v] para (500) [mm v] ▶
doblar#
The turn stack block turns the robot left or right forever. The robot will continue to turn until it is given another action, like driving or stopping.
turno [derecha v]
Parámetros |
Descripción |
|---|---|
dirección |
The direction the robot turns: left or right. |
Ejemplo
cuando empezó
[Turn right, then stop.]
turno [derecha v]
esperar (2) segundos
deja de conducir
girar para#
The turn for stack block turns the robot left or right for a specific number of degrees. The turn is relative to the current position of the robot. The project will wait until the robot is done turning before the next block in the stack runs.
girar [derecha v] por (90) grado ▶
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. |
Ejemplo
cuando empezó
[Turn left, then turn right.]
girar [izquierda v] por (90) grado ▶
girar [derecha v] por (180) grado ▶
girar hacia el encabezamiento#
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 from -359 to 359 degrees. The robot will turn the shortest direction to reach the target heading.
The starting heading is 0 degrees.
The project will wait until the robot is done turning before the next block in the stack runs.
girar hacia el rumbo (90) grados ▶
Parámetros |
Descripción |
|---|---|
título |
The heading the robot should face, from -359 to 359 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. |
Ejemplo
cuando empezó
[Turn to face east.]
girar hacia el rumbo (90) grados ▶
ir al objeto#
The go to object stack block turns and drives the VR Rover to the selected object.
go to [minerals v] ▶
Parámetros |
Descripción |
|---|---|
objeto |
¿A qué objeto irá el VR Rover?:
|
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. |
Si el VR Rover detecta varios minerales o varios enemigos, se moverá a la opción más cercana.
Si no se detectan minerales o un enemigo dentro del alcance visual del rover cuando el bloque se ejecuta, el robot no avanzará. La base siempre puede ser atacada.
Ejemplo
cuando empezó
[Drive to the closest mineral.]
go to [minerals v] ▶
dejar de conducir#
The stop driving stack block stops the robot’s movement.
deja de conducir
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Drive forward, then stop.]
unidad [adelante v]
wait (4) seconds
deja de conducir
Ajustes#
establecer la velocidad de accionamiento#
The set drive velocity stack block tells the robot how fast to drive. A higher percentage makes the robot drive faster and a lower percentage makes the robot drive slower.
Every project begins with the robot driving at 50% velocity by default.
Note: A higher velocity makes the robot drive faster, but it may be less precise. A lower velocity makes the robot drive slower, but it can be more precise.
Establezca la velocidad de la unidad en (50) [% v]
Parámetros |
Descripción |
|---|---|
velocidad |
The velocity to drive with from 0% to 100%. |
unidad |
The velocity unit: % |
Ejemplo
cuando empezó
[Move faster.]
Establezca la velocidad de la unidad en (100) [% v]
unidad [adelante v] para (100) [mm v] ▶
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.
Note: A higher velocity makes the robot turn faster, but it may be less precise. A lower velocity makes the robot turn slower, but it can be more precise.
establecer la velocidad de giro a (50) [% v]
Parámetros |
Descripción |
|---|---|
velocidad |
The velocity to turn with from 0% to 100%. |
unidad |
The velocity unit: % |
Ejemplo
cuando empezó
[Turn faster.]
establecer la velocidad de giro a (100) [% v]
girar [derecha v] por (90) grado ▶
establecer dirección de conducción#
A heading is the direction the robot is facing, measured in degrees. The set drive heading stack block changes the robot’s current heading to a new heading value.
For example, if the robot has turned to face right, setting the heading to 0 degrees makes that right-facing position the new 0 degrees. Then the robot can turn to other positions based on that new heading.
establecer el rumbo de la unidad a (0) grados
Parámetros |
Descripción |
|---|---|
título |
The heading value, in degrees, to set for the robot. |
Ejemplo
cuando empezó
[Set the heading, then turn to 0 degrees.]
establecer el rumbo de la unidad a (90) grados
girar hacia el rumbo (0) grados ▶
establecer tiempo de espera de la unidad#
The set drive timeout stack block sets how many seconds the robot will try to finish a movement. If the robot cannot finish in that time it will stop trying and move on to the next block in the stack. This keeps the robot from getting stuck on a movement.
Establezca el tiempo de espera de la unidad en (1) segundos
Parámetros |
Descripción |
|---|---|
tiempo |
The number of seconds the robot can try to finish a movement. This can be a whole number or a decimal. |
Ejemplo
cuando empezó
[Drive for at most 1 second.]
Establezca el tiempo de espera de la unidad en (1) segundos
unidad [adelante v] para (25) [pulgadas v] ▶
Valores#
drive is done#
The drive is done Boolean block reports whether the robot is finished moving. This can be used to control the timing of other behaviors based on the robot’s movement.
True - The robot is finished moving.
False - The robot is still moving.
This block works together with drivetrain blocks that have the and don’t wait parameter.
<¿La unidad está lista?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Start turning when the drive is complete.]
unidad [adelante v] para (200) [mm v] ◀ y no esperes
esperar hasta <¿La unidad está lista?>
girar [derecha v] por (360) grado ▶
drive is moving#
The drive is moving 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 drivetrain blocks that have the and don’t wait parameter.
<¿La unidad se está moviendo?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Print while the rover is moving.]
unidad [adelante v] para (200) [mm v] ◀ y no esperes
mientras <¿La unidad se está moviendo?>
imprimir [Still Moving...] ▶
esperar (0.1) segundos
borrar todas las filas
fin
imprimir [Done!] ▶
dirección de conducción#
A heading is the direction the robot is facing, measured in degrees. The drive heading reporter block reports that heading from 0 to 359.99 degrees.
The robot’s starting heading is 0 degrees.
(rumbo de la unidad en grados)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Display the heading after turning.]
girar [derecha v] por (90) grado ▶
imprimir (rumbo de la unidad en grados) ▶
colocar el cursor en la siguiente fila
Comportamiento#
Comportamiento#
acción de los minerales#
minerals [pick up v]
Parámetros |
Descripción |
|---|---|
acción |
Qué hacer con los minerales:
|
Al recoger minerales, estos se almacenan en el VR Rover hasta que se sueltan o se utilizan.
El uso de minerales repone parte de la energía del VR Rover. Los minerales solo se pueden usar si están en el suelo.
El VR Rover gana puntos de experiencia (XP) al usar minerales o al dejarlos caer en la base.
Ejemplo
cuando empezó
[Drive to the closest mineral and pick it up.]
go to [minerals v] ▶
minerals [pick up v]
absorber la radiación enemiga#
El bloque absorber radiación enemiga absorbe la radiación de un enemigo en el área de juegos Rover Rescue.
absorb radiation
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
[Drive to the closest enemy and absorb radiation.]
go to [enemy v] ▶
absorb radiation
apoyar#
El bloque en espera pone el VR Rover en modo de espera hasta que se alcance el umbral de batería especificado.
standby until [50] % battery
Parámetros |
Descripción |
|---|---|
por ciento |
El umbral de batería que provoca que el VR Rover salga del modo de espera, de 0 a 100. |
Mientras está en modo de espera, el VR Rover consume su batería más lentamente, pero el contador de Número de días superados aumenta a un ritmo mayor.
Cuando la batería alcanza el umbral seleccionado, el VR Rover sale del modo de espera y vuelve al uso normal de la batería y al transcurso del día.
Si el umbral seleccionado es igual o superior al nivel actual de la batería, el VR Rover no entrará en modo de espera.
Ejemplo
cuando empezó
[Wait in standby until battery reaches 35%.]
standby until [35] % battery
go to [minerals v] ▶
Valores#
El rover ve#
El bloque rover ve devuelve un valor booleano que indica si el VR Rover ve el objeto seleccionado utilizando su tecnología de IA integrada.
Verdadero: El objeto seleccionado se encuentra a menos de 1000 milímetros del VR Rover y dentro de su campo de visión.
Falso: El objeto seleccionado está a más de 1000 milímetros de distancia y/o fuera del campo de visión.
<sees [minerals v]?>
Parámetros |
Descripción |
|---|---|
objeto |
¿Qué objeto comprobar?:
|
El campo de visión del VR Rover es de 40 grados, que se muestra en el minimapa como un cono gris translúcido que se extiende desde la parte frontal del rover.
Ejemplo
cuando empezó
para siempre
if <sees [minerals v]?> then
go to [minerals v] ▶
fin
fin
El rover detecta#
El bloque el rover detecta devuelve un valor booleano que indica si el VR Rover detecta minerales o enemigos utilizando su tecnología de IA integrada.
Verdadero: El objeto seleccionado se encuentra dentro del radio de detección del rover.
Falso: El objeto seleccionado no se encuentra dentro del radio de detección del rover.
<detects [minerals v]?>
Parámetros |
Descripción |
|---|---|
objeto |
¿Qué objeto detectar?:
|
El radio de detección del VR Rover es de 800 milímetros, representado en el minimapa por un círculo amarillo alrededor del rover.
Ejemplo
cuando empezó
para siempre
if <detects [minerals v]?> then
go to [minerals v] ▶
fin
fin
minerales en almacenamiento#
El bloque minerales en almacenamiento devuelve la cantidad actual de minerales que el VR Rover tiene en su almacenamiento.
(minerals in storage)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
print (minerals in storage) ▶
colocar el cursor en la siguiente fila
capacidad de almacenamiento#
El bloque capacidad de almacenamiento devuelve la capacidad de almacenamiento del VR Rover.
(storage capacity)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
print (storage capacity) ▶
colocar el cursor en la siguiente fila
dirección del rover#
El bloque dirección del rover devuelve la dirección desde el VR Rover hasta el objeto seleccionado en grados.
([minerals v] direction in degrees)
Parámetros |
Descripción |
|---|---|
objeto |
¿Qué objeto indica la dirección?:
|
En el caso de minerales y enemigos, este bloque solo informa valores cuando el objeto seleccionado se encuentra a menos de 1000 milímetros y dentro del campo de visión de 40 grados del rover.
Si se selecciona base, se informa la dirección incluso cuando la base no está en el campo de visión. Para la base, este bloque informa un valor de -180 a 180 grados.
Ejemplo
cuando empezó
print ([minerals v] direction in degrees) ▶
colocar el cursor en la siguiente fila
distancia del rover#
El bloque distancia del rover devuelve la distancia desde el VR Rover hasta el objeto seleccionado.
([minerals v] distance in [mm v] :: custom-actions)
Parámetros |
Descripción |
|---|---|
objeto |
¿A qué objeto se le debe informar la distancia?:
|
unidad |
The unit used to report the distance: mm or inches |
En el caso de minerales y enemigos, este bloque solo informa valores cuando el objeto seleccionado se encuentra a menos de 1000 milímetros y dentro del campo de visión de 40 grados del rover.
Si se selecciona base, la distancia se informa incluso cuando la base no está en el campo de visión.
Ejemplo
cuando empezó
print ([minerals v] distance in [mm v] :: custom-actions) ▶
colocar el cursor en la siguiente fila
ubicación del rover#
El bloque ubicación del rover devuelve la coordenada X o Y del objeto seleccionado utilizando la tecnología de IA integrada del rover.
([minerals v] location [X v] in [mm v])
Parámetros |
Descripción |
|---|---|
objeto |
¿Qué objeto se debe reportar? Ubicación:
|
eje |
¿Qué coordenada devolver?:
|
unidad |
The unit used to report the coordinate: mm or inches |
En el caso de minerales y enemigos, este bloque solo informa valores cuando el objeto seleccionado se encuentra a menos de 1000 milímetros y dentro del campo de visión de 40 grados del rover.
Si se selecciona base, se informará de la ubicación incluso cuando la base no esté en el campo de visión.
Ejemplo
cuando empezó
print ([base v] location [X v] in [mm v]) ▶
colocar el cursor en la siguiente fila
print ([base v] location [Y v] in [mm v]) ▶
colocar el cursor en la siguiente fila
under attack#
The under attack block returns a Boolean indicating whether the VR Rover is currently under attack from an enemy.
Cierto: el VR Rover está siendo atacado.
Falso: el VR Rover no está siendo atacado.
<under attack?>
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
para siempre
if <under attack?> then
drive [reverse v] for [500] [mm v] ▶
fin
fin
nivel de enemigo#
El bloque Nivel del enemigo devuelve el nivel del enemigo más cercano detectado por el VR Rover.
(enemy level)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
When no enemies are detected in the VR Rover’s detect radius, this block returns 0.
Ejemplo
cuando empezó
para siempre
if <(enemy level) [math_equal v] [1]> then
go to [enemy v] ▶
demás
drive [reverse v] for [500] [mm v] ▶
fin
fin
radiación enemiga#
El bloque radiación enemiga devuelve la radiación del enemigo más cercano detectado por el VR Rover.
(enemy radiation)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
When no enemies are detected in the VR Rover’s detect radius, this block returns 0.
Ejemplo
cuando empezó
print (enemy radiation) ▶
colocar el cursor en la siguiente fila
nivel de batería#
El bloque nivel de batería devuelve el nivel actual de batería del VR Rover como un porcentaje.
(battery level in % :: custom-actions)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
print (battery level in % :: custom-actions) ▶
colocar el cursor en la siguiente fila
nivel#
El bloque nivel devuelve el nivel actual del VR Rover.
(level)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
print (level) ▶
colocar el cursor en la siguiente fila
XP#
El bloque XP devuelve la cantidad actual de Puntos de Experiencia que tiene el VR Rover.
(XP)
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
cuando empezó
print (XP) ▶
colocar el cursor en la siguiente fila
cuando está bajo ataque#
El bloque cuando está bajo ataque ejecuta su pila adjunta cada vez que el VR Rover es atacado por un enemigo.
when under attack
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
when under attack
absorb radiation
cuando subas de nivel#
El bloque cuando sube de nivel ejecuta su pila adjunta cada vez que el VR Rover se mueve de un nivel al siguiente.
when level up
Parámetros |
Descripción |
|---|---|
Este bloque no tiene parámetros. |
Ejemplo
when level up
print [The VR Rover has leveled up!] ▶
colocar el cursor en la siguiente fila
Detección#
Distancia#
Distance found an object#
The Distance found an object block returns a Boolean indicating whether the Distance Sensor has detected an object within 2000 mm.
Verdadero: el sensor de distancia ha detectado un objeto.
Falso: el sensor de distancia no ha detectado ningún objeto.
<[distance v] found an object?>
Parámetros |
Descripción |
|---|---|
sensor de distancia |
Which Distance Sensor to use. In this Playground, the available sensor is |
Ejemplo
cuando empezó
[Turn until the Distance Sensor detects an object.]
turno [derecha v]
wait until <[distance v] found an object?>
deja de conducir
distancia del objeto#
El bloque distancia del objeto devuelve la distancia del objeto más cercano al sensor de distancia.
([distance v] in [mm v])
Parámetros |
Descripción |
|---|---|
sensor de distancia |
Which Distance Sensor to use. In this Playground, the available sensor is |
unidad |
The distance unit: mm or inches |
Ejemplo
cuando empezó
[Wait until the Distance Sensor detects an object, then print the distance.]
turno [derecha v]
wait until <[distance v] found an object?>
deja de conducir
print ([distance v] in [mm v]) ▶