机器人专用积木#

所有标准 VEXcode VR 积木均可在GO 竞赛 - 火星数学探险 游乐场中使用。

运动#

这个游乐场的块将可以访问所有运动块的 ArmMotor 参数。

Spin#

Spin 块用于无限旋转电机。

这是一个非等待块,允许任何后续块无延迟地执行。

Image of a VEXcode VR Spin block used for motor control in robotics programming.

选择电机移动的方向。

该图展示了 VEXcode VR 中用于电机控制的旋转模块,演示了电机的方向和操作。

在此示例中,臂电机将沿向上方向旋转 1 秒钟,然后停止。

Diagram illustrating the VEXcode VR Spin block for motor control, demonstrating motor direction and duration settings.

Spin for#

Spin for 块用于使电机旋转给定的距离。

这可以是非等待等待块,取决于是否使用并且不等待选项。

Image of VEXcode VR Spin block, illustrating motor spinning direction and duration for robot programming.

选择电机移动的方向。

该图描绘了用于在编程中控制电机方向和运动持续时间的 VEXcode VR Spin 模块。

通过输入一个值并选择测量单位(度或圈)来设置电机旋转的距离。

图片展示了用于控制火星数学探险游乐场中的电机运动的 VEXcode VR Spin 模块。

默认情况下,旋转块会阻止任何后续块的执行,直到其完成为止。通过展开旋转块以显示不等待,块将在电机转动时继续执行。

Icon illustrating the Spin for" block in VEXcode VR

在这个例子中,臂电机将向上旋转 200 度。

Image illustrating the VEXcode VR Spin block, showing a motor spinning upward for 1 second before stopping.

Spin to position#

旋转到位置块用于将电机旋转到设定位置。

这可以是非等待等待块,取决于是否使用并且不等待选项。

VEXcode VR Spin to Position block, demonstrating motor control for precise positioning in robot programming.

通过输入一个值并选择测量单位(度或圈)来设置电机旋转的距离。

VEXcode VR 旋转到位置模块的图像,展示了机器人编程中实现精确运动的电机控制。

默认情况下,旋转到指定位置积木会阻止所有后续积木的执行,直到其完成。通过展开旋转到指定位置积木以显示不等待,积木将在电机移动时继续执行。

Image showing VEXcode VR Spin to Position block for motor control in robotics programming.

在这个例子中,电机将旋转到 180 度的位置。

Diagram illustrating the VEXcode VR Spin to Position block for motor control in robotics programming.

Stop Motor#

停止电机块用于停止电机移动。

这是一个非等待块,允许任何后续块无延迟地执行。

stop_block

在此示例中,进气电机将在 Up 中旋转 1 秒后停止。

Diagram illustrating the VEXcode VR Spin block for motor control, demonstrating motor direction and duration settings.

Set Motor position#

设置电机位置块用于将电机的编码器位置设置为输入的值。

这是一个非等待块,允许任何后续块无延迟地执行。

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

设置要使用的测量单位,度或圈。

用于机器人编程的运动控制和电机位置设置的 VEXcode VR 电机位置单元图示。

在此示例中,电机的编码器位置在电机旋转到 0 度位置之前设置为 90 度。

Diagram illustrating robot motor position and motion control blocks in VEXcode VR for the GO Competition.

Set Motor velocity#

设置电机速度块用于设置电机的速度。

这是一个非等待块,允许任何后续块无延迟地执行。

VEXcode VR Set Motor Velocity block illustration, showing motor speed adjustment for programming robot motion.

设置电机速度块将接受-100%到100%的范围。

在此示例中,电机的速度设置为 75%,然后沿进气方向旋转 1 圈。

Diagram illustrating motor velocity control in VEXcode VR for robot motion tasks.

Set Motor timeout#

设置电机超时块用于设置电机运动块的时间限制。

这可以防止未到达预定位置的运动块阻止后续块的运行。

这是一个非等待命令,允许任何后续命令无延迟地执行。

VEXcode VR Set Motor Timeout block, used to set a time limit for motor movement in programming.

在此示例中,电机超时设置为 2 秒,然后电机沿出风方向旋转 3 圈。

Example of setting motor timeout in VEXcode VR for controlling motor movement duration.

传感#

虚拟英雄机器人可以使用标准大脑和动力传动系统传感模块。

Motor Sensing#

电机已完成#

电机已完成块用于报告所选电机或电机组是否已完成其运动。

VEXcode VR block showing Motor is done" status for robot motion tasks in Mars Math Expedition Playground.

The Motor is done block reports True when the selected Motor or Motor Group has completed its movement.

The Motor is done block reports False when the selected Motor or Motor Group has not completed its movement.

电机已完成块用于具有六边形(六面)空间的块中。

示例即将推出

电机旋转#

电机正在旋转块用于报告所选电机或电机组是否正在移动。

Image of a motor spinning block from VEXcode VR, used for controlling motor movement in robotics programming.

The Motor is spinning block reports True when the selected Motor or Motor Group is moving.

The Motor is spinning block reports False when the selected Motor or Motor Group is not moving.

马达正在旋转块用于具有六边形(六面)空间的块中。

示例即将推出

电机位置#

电机位置块用于报告电机或电机组中第一个电机的位置。

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

选择使用的单位,度或圈。

用于机器人编程的运动控制和电机位置设置的 VEXcode VR 电机位置单元图示。

电机位置块用于具有圆形空间的块中。

在这个例子中,机器人将打印手臂电机的当前位置。

Diagram illustrating robot motor position and motion control blocks in VEXcode VR for the GO Competition.

电机转速#

电机速度块用于报告电机或电机组中第一个电机的当前速度。

VEXcode VR Motor Position Block diagram illustrating motor control parameters and functions for robot motion.

电机速度块用于具有圆形空间的块中。

在这个例子中,机器人将打印手臂电机的当前速度。

Diagram illustrating motor velocity control in VEXcode VR for robot motion tasks.

Eye Sensing#

找到物体#

发现物体块用于报告前眼传感器是否检测到约 40 毫米 (mm) 或 1.5 英寸范围内的物体。

found_object_block

The Found object block reports True when the Front Eye Sensor detects an object within approximately 40 millimeters (mm) or 1.5 inches.

The Found object block reports False when an object is not within approximately 40 millimeters (mm) or 1.5 inches.

发现物体块用于具有六边形(六面)空间的块中。

在这个例子中,机器人将检查其前眼传感器是否检测到物体,并打印是否检测到任何东西。

found_object_example

检测颜色#

检测颜色块用于报告前眼传感器是否检测到物体的指定颜色。

detects_color_block

选择要检测的颜色。

检测颜色

The Detects color block reports True when the Eye Sensor detects the specified color of an object.

The Detects color block reports False when the Eye Sensor does not detect the specified color of an object.

检测颜色块用于具有六边形(六面)空间的块中。

在此示例中,机器人将检查其前眼传感器是否检测到蓝色物体,如果检测到则打印。

detects_color_example

亮度#

亮度块用于报告眼睛传感器检测到的物体的亮度。

brightness_of_block

亮度块用于具有圆形空间的块中。

在此示例中,机器人将打印物体的当前亮度。由于传感器前方没有物体,因此它将打印 0。

brightness_of_example

色调#

色调块用于报告眼睛传感器检测到的颜色的色调值。

brightness_of_block

色相 模块提供 0 到 359 度之间的色相值。这可以更精确地测量颜色。

色轮

色调块用于具有圆形空间的块中。

在此示例中,机器人将打印物体的当前色调。由于传感器前方没有物体,因此它将打印 0。

hue_of_example

Gyro Sensing#

检测到碰撞?#

**检测到碰撞?**块用于报告机器人是否与墙壁或其他物体接触。

Image of a VEXcode VR block labeled Detected crash?" used for reporting robot collisions in programming.

The Detected crash? block reports True if the robot comes in contact with a wall or other object.

The Detected crash? block reports False if the robot does NOT come in contact with a wall or other object.

**检测到碰撞?**块用于具有六边形(六面)空间的块中。

在这个例子中,机器人将向前行驶直到发生碰撞,然后停止移动。

Image illustrating VEXcode VR blocks for robot motion, including Spin, Stop Motor, and Sensing features.