陀螺仪传感器#
介绍#
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.
以下是所有模块的列表:
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.
校准陀螺仪#
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.
注意:此模块仅在传动系统外部配置了陀螺仪传感器时可用。
[Gyro 1 v] 校准 [2 v] 秒
参数 |
描述 |
|---|---|
陀螺仪 |
陀螺仪传感器需要校准。 |
期间 |
传感器校准所需时间(秒):
|
例子
当开始
[Calibrate a Gyro Sensor and display its angle of heading.]
[Gyro 1 v] 校准 [2 v] 秒
在 [Brain v] 上打印 ([Gyro 1 v] 归位角度值) ◀ 并设定光标为下一行
设置陀螺仪航向#
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.
设定 [Gyro 1 v] 归位为 (0) 度
参数 |
描述 |
|---|---|
陀螺仪 |
The Gyro Sensor to use. |
标题 |
The heading value, in degrees, to set for the sensor. This can be a value from 0 to 359.99. |
例子
当开始
[Turn to the new 0 degrees heading.]
设定 [Gyro 1 v] 归位为 (90) 度
归位至 (0) 度 ▶
设置陀螺仪旋转#
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.
设定 [Gyro 1 v] 转向为 (0) 度
参数 |
描述 |
|---|---|
陀螺仪 |
The Gyro Sensor to use. |
旋转 |
The rotation value, in degrees, to set for the sensor. This can be an integer or a decimal. |
例子
当开始
[Turn to the new 0 rotation.]
设定 [Gyro 1 v] 转向为 (-100) 度
转向至 (0) 度 ▶
陀螺仪航向角#
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] 归位角度值)
参数 |
描述 |
|---|---|
陀螺仪 |
The Gyro Sensor to report the heading from. |
例子
当开始
[Display the Gyro Sensor's heading before and after rotating.]
在 [Brain v] 上打印 ([Gyro 1 v] 归位角度值) ◀ 并设定光标为下一行
[右 v] 转 (390) 度 ▶
在 [Brain v] 上打印 ([Gyro 1 v] 归位角度值) ◀ 并设定光标为下一行
陀螺仪旋转角度#
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] 转向角度值)
参数 |
描述 |
|---|---|
陀螺仪 |
The Gyro Sensor to report the rotation from. |
例子
当开始
[Display the Gyro Sensor's angle of rotation before and after rotating.]
在 [Brain v] 上打印 ([Gyro 1 v] 转向角度值) ◀ 并设定光标为下一行
[右 v] 转 (390) 度 ▶
在 [Brain v] 上打印 ([Gyro 1 v] 转向角度值) ◀ 并设定光标为下一行
陀螺仪速率#
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] 角速度\(dps\))
参数 |
描述 |
|---|---|
陀螺仪 |
The Gyro Sensor to report the rotation speed from. |
例子
当开始
[Display the Gyro Sensor's current rotation speed.]
[右 v] 转
等待 (1) 秒
在 [Brain v] 上打印 ([Gyro 1 v] 角速度\(dps\)) ◀ 并设定光标为下一行