惯性陀螺仪传感器#

介绍#

The VEX IQ (2nd gen) Brain has a built-in Inertial Sensor. This sensor measures how the Brain is moving and turning.

The built-in Inertial Sensor uses two parts to do this. The gyroscope measures turning, such as heading, rotation, gyro rate, and orientation. The accelerometer measures changes in motion, such as speeding up or slowing down.

The built-in Inertial Sensor is automatically configured and ready to use at the start of every project. An external Gyro Sensor can also be used, but it must be configured before use. The external VEX IQ Gyro Sensor measures turning only.

以下是所有模块的列表:

Gyro Sensing — Work with heading and rotation values.

Inertial Sensing — Use the built-in BrainInertial Sensor.

  • acceleration — Reports how quickly the Brain is speeding up or slowing down on the selected axis.

  • gyro rate — Reports how fast the Brain is rotating on the selected axis.

  • orientation — Reports the Brain’s roll, pitch, or yaw angle.

陀螺仪感应#

校准陀螺仪#

The calibrate gyro stack block calibrates a configured external Gyro Sensor.

Calibration helps the Gyro Sensor measure turns correctly. Keep the sensor still during calibration. If the sensor moves during calibration, heading and rotation 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] 秒

参数

描述

陀螺仪

The external Gyro Sensor to calibrate.

期间

传感器校准所需时间(秒):

  • 2
  • 4
  • 8

例子

当开始
[Calibrate a Gyro Sensor and display its angle of heading.]
[Gyro 1 v] 校准 [2 v] 秒
在 [Brain v] 上打印 ([Gyro 1 v] 归位角度值) ◀ 并设定光标为下一行

校准 BrainInertial#

The calibrate BrainInertial stack block calibrates the Brain’s built-in Inertial Sensor.

Calibration helps the Inertial Sensor measure turns correctly. Keep the Brain still during calibration. If the Brain moves during calibration, heading, rotation, gyro rate, and orientation values may not measure correctly.

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

IQ Brain 的屏幕向右倾斜,x、y 和 z 轴分别用从屏幕中心向外延伸的箭头表示。标有 x 的红色箭头指向右侧,标有 y 的绿色箭头向前延伸,标有 z 的蓝色箭头向下延伸。与上一张图片相同的图像,现在大脑屏幕向左倾斜,x、y、z 箭头保持其方向不变。与前一张图相同的图像,现在大脑屏幕朝上,就像平放在一个平面上一样。x、y、z方向相同。

VEX Brains attempt to calibrate themselves automatically at the start of every project. However, if the robot is being carried or moved during project start, the sensor may fail to calibrate properly or yield incorrect calibration.

校准BrainInertial

参数

描述

该块没有参数。

例子

当开始
[Calibrate the Brain's sensor and display its angle of heading.]
校准BrainInertial
在 [Brain v] 上打印 ([BrainInertial v] 归位角度值) ◀ 并设定光标为下一行

设置惯性/陀螺仪航向#

A heading is the direction the sensor is facing, measured in degrees from 0 to 359.99. The set Inertial/Gyro heading stack block changes the 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 Inertial or 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 Inertial/Gyro rotation stack block changes the 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 Inertial or 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 Inertial/Gyro heading reporter block reports the 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 Inertial or 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 Inertial/Gyro rotation reporter block reports the 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 Inertial or 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 external 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 external Gyro Sensor to report the rotation speed from.

例子

当开始
[Display the Gyro Sensor's current rotation speed.]
[右 v] 转
等待 (1) 秒
在 [Brain v] 上打印 ([Gyro 1 v] 角速度\(dps\)) ◀ 并设定光标为下一行

惯性传感#

加速度#

Acceleration is how quickly the Brain is speeding up or slowing down. The acceleration reporter block reports the Brain’s acceleration along the selected axis, from -4.00 G to 4.00 G.

A G is a unit used to measure acceleration. 1 G is about the acceleration you feel from gravity while sitting still.

The value can be positive or negative depending on the direction of acceleration on the selected axis. The axis options are x, y, and z.

(BrainInertial [X v] 轴加速度值\(g\))

参数

描述

The axis to measure acceleration on:

  • x
  • y
  • z

例子

当开始
[Display the acceleration along the x-axis while the drivetrain is moving.]
将打印精度设置为 [0.01 v] 到 [Brain v]
设定驱动速度为 (100)%
在 [Brain v] 上打印 [Resting: ] ◀ 并设定光标为下一行
在 [Brain v] 上打印 (BrainInertial [X v] 轴加速度值\(g\)) ◀ 并设定光标为下一行
等待 (1) 秒
驱动 [向前 v] (500) [毫米 v] ◀ 并且不等待
等待 (0.1) 秒
在 [Brain v] 上打印 [Startup: ] ◀ 并设定光标为下一行
在 [Brain v] 上打印 (BrainInertial [X v] 轴加速度值\(g\)) ◀ 并设定光标为下一行

陀螺仪速率#

Gyro rate is how fast the Brain is rotating. The gyro rate reporter block reports the Brain’s current rotation speed along the selected axis in degrees per second \(dps\) as a decimal number.

The value can be positive or negative depending on the direction the Brain is rotating on that axis.

(BrainInertial [X v] 轴陀螺仪角速度\(dps\))

参数

描述

The axis to report gyro rate on:

  • x
  • y
  • z

例子

当开始
[Display the gyro rate around the z-axis while the drivetrain is turning.]
[右 v] 转
等待 (1) 秒
在 [Brain v] 上打印 (BrainInertial [z v] 轴陀螺仪角速度\(dps\)) ◀ 并设定光标为下一行

方向#

Orientation is the Brain’s current angle on a selected turning axis. The orientation reporter block reports the Brain’s roll, pitch, or yaw, from -180.00 to 180.00 degrees.

Roll, pitch, and yaw describe different ways the Brain can tilt or turn.

(BrainInertial [横滚 v] 偏转角度值)

参数

描述

The orientation axis to report:

  • roll
  • pitch
  • yaw

例子

当开始
[Display the roll, pitch, and yaw of the Brain as it is rotated by hand.]
永久循环
清除 [Brain v] 所有行
在 [Brain v] 上打印 (BrainInertial [横滚 v] 偏转角度值) ◀ 并设定光标为下一行
在 [Brain v] 上打印 (BrainInertial [俯仰 v] 偏转角度值) ◀ 并设定光标为下一行
在 [Brain v] 上打印 (BrainInertial [偏转 v] 偏转角度值) ◀ 并设定光标为下一行
在 [Brain v] 设定光标至 (1) 行 (1) 列
等待 (0.05) 秒
结束