惯性#
介绍#
GO Brain 包含一个内置惯性传感器,可以让机器人跟踪其方向、航向和加速度。
以下是所有方法的列表:
方向
get_heading – 返回当前航向。
get_rotation – 返回当前旋转。
get_yaw – 返回当前偏航角。
get_roll – 返回当前掷骰结果。
get_pitch – 返回当前音调。
calibrate – 校准惯性传感器以实现稳定的航向跟踪。
reset_heading – 将惯性传感器的航向设置为 0。
reset_rotation - 将惯性传感器的旋转角度设置为 0。
set_heading – 将惯性传感器的航向设置为指定值。
set_rotation – 将惯性传感器的旋转设置为指定值。
运动
get_acceleration – 返回沿 x、y 或 z 轴的线性加速度。
方向#
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)
参数 |
描述 |
---|---|
|
以度为单位设置的航向值。 |
# 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)
参数 |
描述 |
---|---|
|
用于新旋转的度数值。 |
# Example coming soon
运动#
get_acceleration#
get_acceleration
returns the acceleration of the Inertial Sensor.
Usage:
inertial.get_acceleration(axis)
参数 |
描述 |
---|---|
|
The axis to return the acceleration from:
|
# Example coming soon