Sensor giroscópico#
Introducción#
The VEX IQ Gyro Sensor measures rotational movement around a single axis. It is used to track how far a robot has turned and which direction it is facing.
A continuación se muestra una lista de todos los bloques:
calibrate gyro — Calibrates a configured Gyro Sensor.
set Gyro heading — Sets the Gyro Sensor’s current heading to a new heading value.
set Gyro rotation — Sets the Gyro Sensor’s current rotation to a new rotation value.
angle of Gyro heading — Reports the direction the Gyro Sensor is facing, from 0 to 359.99 degrees.
angle of Gyro rotation — Reports how far the Gyro Sensor has turned.
rate of gyro — Reports the Gyro Sensor’s current rotation speed.
calibrar giroscopio#
The calibrate gyro stack block calibrates a configured Gyro Sensor.
Calibration helps the Gyro Sensor measure turns correctly. Keep the sensor still during calibration. If the sensor moves during calibration, heading, rotation, and rate values may not measure turns correctly.
The project will wait until calibration is done before the next block in the stack runs.
Nota: Este bloque solo está disponible si hay un sensor giroscópico configurado fuera de un sistema de transmisión.
calibrar [Gyro 1 v] durante [2 v] segundo
Parámetros |
Descripción |
|---|---|
giroscopio |
El sensor giroscópico necesita calibración. |
duración |
Tiempo de calibración del sensor en segundos:
|
Ejemplo
cuando empezó
[Calibrate a Gyro Sensor and display its angle of heading.]
calibrar [Gyro 1 v] durante [2 v] segundo
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
establecer dirección del giroscopio#
A heading is the direction the sensor is facing, measured in degrees from 0 to 359.99. The set Gyro heading stack block changes the Gyro Sensor’s current heading to a new heading value.
For example, if the sensor has turned to face right, setting the heading to 0 degrees makes that right-facing position the new 0 degrees. Then the sensor can track other headings based on that new direction.
Establecer el rumbo [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to use. |
título |
The heading value, in degrees, to set for the sensor. This can be a value from 0 to 359.99. |
Ejemplo
cuando empezó
[Turn to the new 0 degrees heading.]
Establecer el rumbo [Gyro 1 v] a (90) grado
girar hacia el rumbo (0) grados ▶
Configurar la rotación del giroscopio#
Rotation is how much the sensor has turned, measured in degrees. Unlike heading, rotation can increase past 359.99 degrees or decrease below 0 degrees. At the beginning of a project, the rotation value is set to 0 degrees. The set Gyro rotation stack block changes the Gyro Sensor’s current rotation to a new value.
For example, if the sensor has made two full turns to the right, its rotation value will be 720 degrees. Setting the rotation to 0 degrees will reset that rotation from 720 to 0 degrees. Then the sensor can track rotations based on that new value.
Establezca la rotación [Gyro 1 v] a (0) grado
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to use. |
rotación |
The rotation value, in degrees, to set for the sensor. This can be an integer or a decimal. |
Ejemplo
cuando empezó
[Turn to the new 0 rotation.]
Establezca la rotación [Gyro 1 v] a (-100) grado
girar a rotación (0) grados ▶
ángulo de dirección del giroscopio#
A heading is the direction the sensor is facing, measured in degrees from 0 to 359.99. The angle of Gyro heading reporter block reports the Gyro Sensor’s current heading.
The starting heading is 0 degrees. If the sensor turns past 359.99 degrees, the heading wraps back to 0 degrees.
([Gyro 1 v] rumbo en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to report the heading from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's heading before and after rotating.]
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
girar [derecha v] por (390) grado ▶
imprimir ([Gyro 1 v] rumbo en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
ángulo de rotación del giroscopio#
Rotation is how much the sensor has turned, measured in degrees. Unlike heading, rotation can increase past 359.99 degrees or decrease below 0 degrees. At the beginning of a project, the rotation value is set to 0 degrees. The angle of Gyro rotation reporter block reports the Gyro Sensor’s current rotation.
Turning right increases the rotation, and turning left decreases the rotation. For example, making two full turns to the right will report a rotation of 720 degrees. Turning one full turn to the left from 0 degrees will report a rotation of -360 degrees.
([Gyro 1 v] rotación en grados)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to report the rotation from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's angle of rotation before and after rotating.]
imprimir ([Gyro 1 v] rotación en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
girar [derecha v] por (390) grado ▶
imprimir ([Gyro 1 v] rotación en grados) en [Brain v] ◀ y coloque el cursor en la siguiente fila
velocidad del giroscopio#
The rate of gyro reporter block reports the Gyro Sensor’s current rotation speed in degrees per second \(dps\). The value can be positive or negative depending on the direction the Gyro Sensor is rotating.
([Gyro 1 v] tasa de dps)
Parámetros |
Descripción |
|---|---|
giroscopio |
The Gyro Sensor to report the rotation speed from. |
Ejemplo
cuando empezó
[Display the Gyro Sensor's current rotation speed.]
turno [derecha v]
esperar (1) segundos
imprimir ([Gyro 1 v] tasa de dps) en [Brain v] ◀ y coloque el cursor en la siguiente fila