惯性#

介绍#

GO Brain 包含一个内置惯性传感器,可以让机器人跟踪其方向、航向和加速度。

以下是所有方法的列表:

方向

运动

方向#

get_heading#

get_heading returns the current heading of the Inertial Sensor in degrees.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.get_heading()

Usage:
inertial.get_heading()

参数

描述

该方法没有参数。

# Example coming soon

get_rotation#

get_rotation returns the current rotation of the Inertial Sensor in degrees.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.get_rotation()

Usage:
inertial.get_rotation()

参数

描述

该方法没有参数。

# Example coming soon

get_yaw#

get_yaw returns the current yaw of the Inertial Sensor in degrees.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.get_yaw()

Usage:
inertial.get_yaw()

参数

描述

该方法没有参数。

# Example coming soon

get_roll#

get_roll returns the current roll of the Inertial Sensor in degrees.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.get_roll()

Usage:
inertial.get_roll()

参数

描述

该方法没有参数。

# Example coming soon

get_pitch#

get_pitch returns the current pitch of the Inertial Sensor in degrees.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.get_pitch()

Usage:
inertial.get_pitch()

参数

描述

该方法没有参数。

# Example coming soon

calibrate#

calibrate calibrates the Inertial Sensor. All subsequent lines will wait for the calibration to complete before executing. Calibration is an internal procedure that measures and compensates for sensor noise and drift over a specified period. During this time, the Brain must remain completely still (i.e., on a stable surface without any external movement). Movement during calibration will produce inaccurate results.

**注意:**如果配置了动力传动系统,则此方法不可用。

Usage:
inertial.calibrate()

参数

描述

该方法没有参数。

# Example coming soon

reset_heading#

reset_heading resets the heading of the Inertial Sensor to 0 degrees.

**注意:**如果配置了动力传动系统,则此方法不可用。

Usage:
inertial.reset_heading()

参数

描述

该方法没有参数。

# Example coming soon

reset_rotation#

reset_rotation resets the rotation of the Inertial Sensor to 0 degrees.

**注意:**如果配置了动力传动系统,则此方法不可用。

Usage:
inertial.reset_rotation()

参数

描述

该方法没有参数。

# Example coming soon

set_heading#

set_heading sets the heading of the Inertial Sensor to a specified value.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.set_heading()

Usage:
inertial.set_heading(heading)

参数

描述

heading

以度为单位设置的航向值。

# Example coming soon

set_rotation#

set_rotation sets the rotation of the Inertial Sensor to a specified value.

**注意:**如果配置了动力传动系统,此命令将变为 drivetrain.set_rotation()

用法:

inertial.set_rotation(rotation)

参数

描述

rotation

用于新旋转的度数值。

# Example coming soon

运动#

get_acceleration#

get_acceleration returns the acceleration of the Inertial Sensor.

Usage:
inertial.get_acceleration(axis)

参数

描述

axis

The axis to return the acceleration from:

  • X
  • Y
  • Z
# Example coming soon