Robot Specific Blocks#

All standard VEXcode VR Blocks are available for use in the V5RC Virtual Skills - High Stakes Playground.

Motion#

This Playground’s Blocks will have access to the Arm Motor and Pusher Motor parameters for all Motion blocks.

When selecting a direction for Motion blocks, up will spin the Arm forward and down spins the Arm in reverse.

For the Pusher Motor, lower will spin the Pusher Motor forward and raise spins the Pusher Motor in reverse.

Spin#

The Spin block is used to spin a motor indefinitely.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

The block shows a command used to spin a motor labeled "ArmMotor" in the "up" direction.

Select which motor to use.

The image shows a block from a visual coding interface where the user is selecting a motor for a "spin" command. The selected motor is "ArmMotor," and the alternative option in the dropdown menu is "PusherMotor." The block is set to spin the "ArmMotor" in the "up" direction.

Select which direction for the motor to move in.

The Arm Motor can spin in the up or down directions.

The image shows a coding block from a visual programming interface, where the user is selecting the direction for a "spin" command. The selected motor is "ArmMotor," and the direction is set to "up," with an option to switch to "down" in the dropdown menu.

The Pusher Motor can spin in the lower or raise directions.

The image displays a visual coding block where the "spin" command is applied to the "PusherMotor." The direction for the spin is currently set to "lower," with an option in the dropdown menu to switch to "raise."

In this example, the Arm Motor will spin up for 1 second to move it in preparation to score.

The image displays a sequence of visual coding blocks that represent a code for lifting an arm using the "ArmMotor" before moving to a mobile goal. The code starts with a "when started" block followed by a comment that says, "Lift the Arm before moving to a Mobile Goal." The next block instructs the "ArmMotor" to "spin" in the "up" direction. This is followed by a "wait" block that pauses the execution for "1 second." Finally, the code includes a "stop" block that stops the "ArmMotor."

Spin for#

The Spin for block is used to spin a motor for a given distance.

This is can be a non-waiting or waiting block depending on if the and don’t wait option is used.

The image shows a visual coding block representing a command to control an "ArmMotor." The block is designed to "spin" the motor in the "up" direction for a duration of "90 degrees."

Select which motor to use.

The image shows a block from a visual coding interface that is used to control a motor. In this specific block, the "ArmMotor" is selected from a dropdown menu and is set to spin "up" for a duration of "90 degrees." The dropdown menu is visible, offering an option to select "PusherMotor" instead of "ArmMotor."

Select which direction for the motor to move in.

The Arm Motor can spin in the up or down directions.

The image shows a visual coding block that is used to control a motor. In this block, the "ArmMotor" is selected, and the direction is set to "up" from a dropdown menu. The block specifies that the motor will spin "up" for "90 degrees." The dropdown menu is visible, offering the option to select "down" instead of "up."

The Pusher Motor can spin in the lower or raise directions.

The image shows a coding block that controls a motor labeled "PusherMotor." The block specifies that the motor should spin in the "lower" direction for 90 degrees. A dropdown menu is visible, allowing the user to select "lower" or "raise" as the direction.

Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or turns).

The image shows a coding block used to control the "ArmMotor." The block is set to spin the motor in the "up" direction for 90 units, where the units can be selected from a dropdown menu that offers "degrees" or "turns" as options.

By default, the Spin for block will block any subsequent blocks from executing until it’s finished. By expanding the Spin for block to show and don’t wait, blocks will continue to execute while the motor is moving.

The image displays a coding block used to control the "ArmMotor." The block is set to spin the motor in the "up" direction for 90 degrees. Additionally, the block includes an option indicating that the motor should "not wait" after spinning, meaning the code will continue executing the next instruction immediately after the motor starts spinning for the specified 90 degrees.

In this example, the Arm Motor will spin up by 350 degrees to not block the AI Vision Sensor.

The image shows a coding block that is set to run when the code starts. The block instructs the "ArmMotor" to spin in the "up" direction for 350 degrees.

Spin to position#

The Spin to position block is used to spin a motor to a set position.

This is can be a non-waiting or waiting block depending on if the and don’t wait option is used.

The image shows a coding block that commands the "ArmMotor" to spin to a specific position. The motor is set to rotate to the position of 90 degrees.

Select which motor to use.

The image displays a coding block where the "ArmMotor" is selected to spin to a specific position of 90 degrees. There's an option to select between "ArmMotor" and "PusherMotor" for this action.

Set how far the motor will spin by entering a value, and choosing the unit of measurement (degrees or turns).

The image shows a coding block where the "ArmMotor" is set to spin to a position of 90 units. The units can be selected between "degrees" and "turns," with "degrees" currently selected.

By default, the Spin to position block will block any subsequent blocks from executing until it’s finished. By expanding the Spin to position block to show and don’t wait, blocks will continue to execute while the motor is moving.

The image displays a coding block where the "ArmMotor" is programmed to spin to a position of 90 degrees. The action is set to occur without waiting for the motor to reach the position before continuing with the next command.

In this example, the Arm Motor will spin to the 350 degrees position to not block the AI Vision Sensor.

The image displays a coding block that starts by lifting the "ArmMotor" to a position of 350 degrees. The purpose of this action is to prevent the arm from waiting the AI Vision Sensor. The command is triggered when the code starts.

Stop Motor#

The Stop Motor block is used to stop the motor from moving.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

The image shows a coding block that commands the "ArmMotor" to stop.

Select which motor to use.

The image shows a coding block where the user can select between "ArmMotor" and "PusherMotor" to stop the selected motor.

In this example, the Arm Motor will spin up for 1 second to move it in preparation to score.

The image displays a sequence of visual coding blocks that represent a code for lifting an arm using the "ArmMotor" before moving to a mobile goal. The code starts with a "when started" block followed by a comment that says, "Lift the Arm before moving to a Mobile Goal." The next block instructs the "ArmMotor" to "spin" in the "up" direction. This is followed by a "wait" block that pauses the execution for "1 second." Finally, the code includes a "stop" block that stops the "ArmMotor."

Set Motor position#

The Set Motor position block is used to set a motor’s encoder position(s) to the entered value.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

The image displays a coding block used to set the position of the "ArmMotor" to 0 degrees.

Select which motor to use.

The image shows a coding block that sets the position of the "ArmMotor" to 0 degrees. The dropdown menu is expanded, displaying two options: "ArmMotor" and "PusherMotor." The "ArmMotor" is currently selected, indicating that the position command will apply to this specific motor.

Set the unit of measurement to use, degrees or turns.

The image shows a coding block where the position of the "ArmMotor" is set to 0, with the unit of measurement being selected from a dropdown menu. The dropdown menu is currently expanded, showing two options: "degrees" and "turns." The "degrees" option is selected, indicating that the position command will be executed in degrees.

In this example, the Arm is raised to the 350 degrees position, and sets that as its new 0 degrees position.

The image displays a coding sequence that begins with a "when started" block, indicating that these commands will execute when the code starts. The first block within the sequence commands the "ArmMotor" to spin to a position of 350 degrees. The second block then sets the "ArmMotor" position to 0 degrees, making the new position the reference point or "0 degrees" position.

Set Motor velocity#

The Set Motor velocity block is used to set the speed of a motor.

This is a non-waiting block and allows any subsequent blocks to execute without delay.

The image shows a coding block that sets the velocity of the "ArmMotor" to 50%.

Select which motor to use.

The image shows a coding block that sets the velocity of the "ArmMotor" to 50%. The dropdown menu is open, showing options to select either "ArmMotor" or "PusherMotor" for the velocity setting. The "ArmMotor" is currently selected.

The Set Motor velocity block will accept a range of -100% to 100%.

In this example, the Motor’s velocity is set to 100% before the Arm raises.

The image shows a set of coding blocks used to control the "ArmMotor" when the code starts. The first block sets the velocity of the "ArmMotor" to 100%, ensuring that it will move at full speed. The second block instructs the "ArmMotor" to spin upward for 350 degrees.

Set Motor timeout#

The Set Motor timeout block is used to set a time limit for Motor movement blocks.

This prevents Motion blocks that do not reach their intended position from preventing subsequent blocks from running.

This is a non-waiting command and allows any subsequent commands to execute without delay.

The image displays a coding block that sets the timeout for the "ArmMotor" to 1 second. This means that the motor will automatically stop after running for 1 second, regardless of whether it has completed its intended action or not.

Select which motor to use.

The image shows a coding block where the user can set the timeout for a motor. In this case, the "ArmMotor" is selected from a dropdown menu, with an option to switch to "PusherMotor" if desired. The timeout is set to 1 second, meaning the selected motor will stop running after 1 second, regardless of its current task.

In this example, the motor timeout is set to 1 second before the Arm raises.

The image shows a coding sequence that begins with the "when started" block, indicating that the code will run when the code begins. The first block sets the timeout for the "ArmMotor" to 1 second. This means that after 1 second, the ArmMotor will automatically stop, regardless of what it is doing. The second block instructs the ArmMotor to spin "up" for 5 turns. This command will cause the motor to rotate in the specified direction for the given number of turns. The timeout set in the first block ensures that the motor will stop after 1 second, even if it hasn't completed the 5 turns.

Sensing#

Axel has access to the standard Brain, Drivetrain, Bumper, Distance Sensing Blocks.

Eye Sensing has been renamed to Optical Sensing to match the Front Optical Sensor.

Motor Sensing#

Motor is done#

The Motor is done block is used to report if the selected Motor or Motor Group has completed its movement.

The image shows a block labeled "ArmMotor is done?" This block is used to check whether the "ArmMotor" has completed its task, such as reaching a target position or finishing a spin command.

Select which Motor or Motor Group to use.

The image shows a block labeled "ArmMotor is done?" with a dropdown menu selecting the motor. The dropdown currently shows "ArmMotor" selected, but it also allows the user to choose "PusherMotor." This block is used to check if the selected motor, either the "ArmMotor" or "PusherMotor," has completed its action, such as reaching a specified position or finishing a rotation.

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.

The Motor is done block is used in blocks with hexagonal (six-sided) spaces.

Motor is spinning#

The Motor is spinning block is used to report if the selected Motor or Motor Group is moving.

The image shows a block labeled "ArmMotor is spinning?" with a dropdown menu for selecting the motor. The dropdown currently has "ArmMotor" selected. This block is used to check whether the "ArmMotor" or another selected motor is currently spinning.

Select which Motor or Motor Group to use.

The image shows a block labeled "ArmMotor is spinning?" with a dropdown menu currently expanded. The dropdown menu allows you to choose between "ArmMotor" and "PusherMotor," with "ArmMotor" currently selected. This block is used to check whether the selected motor, in this case, the "ArmMotor," is currently spinning.

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.

The Motor is spinning block is used in blocks with hexagonal (six-sided) spaces.

Position of motor#

The Position of motor block is used to report the position of a Motor or the first motor in a Motor Group.

The image displays a block labeled "ArmMotor position in degrees." This block is designed to retrieve the current position of the "ArmMotor" and return it in degrees. The dropdown menus allow you to select a different motor or change the unit of measurement, though currently, "ArmMotor" and "degrees" are selected.

Select which Motor or Motor Group to use.

The image shows the "ArmMotor position in degrees" block with a dropdown menu that allows you to select between different motors. The "ArmMotor" is currently selected, with "PusherMotor" as another available option.

Select when unit to use, degrees or turns.

The image displays the "ArmMotor position in degrees" block, with a dropdown menu currently showing "degrees" as the selected unit. The dropdown offers an additional option to measure the position in "turns."

The Position of motor block is used in blocks with circular spaces.

In this example, the Arm will raise until its position is greater than 300 degrees.

The image shows a block-based coding sequence that begins with a "when started" block. The code is designed to raise the ArmMotor to ensure it doesn't block the AI Vision Sensor. The sequence starts by instructing the ArmMotor to spin in the "up" direction. Then, the code waits until the ArmMotor's position, measured in degrees, exceeds 300. Once the ArmMotor has moved past 300 degrees, the motor is stopped, ensuring that the ArmMotor is raised to a position that clears the AI Vision Sensor before stopping.

Velocity of motor#

The Velocity of motor block is used to report the current velocity of a Motor or the first motor in a Motor Group.

The image shows a block that is used to retrieve the velocity of the ArmMotor in percentage. This block is part of a block-based coding interface, where you can select different motors and measure their velocity in terms of percentage. The ArmMotor is selected from a dropdown menu, and the unit of velocity is set to percentage.

Select which Motor or Motor Group to use.

The image displays a block from a block-based coding interface where the user can select a motor to retrieve its velocity in percentage. The dropdown menu is currently expanded, showing the options to select either "ArmMotor" or "PusherMotor." The "ArmMotor" is selected, and the unit of velocity is set to percentage ("%").

The Velocity of motor block is used in blocks with circular spaces.

Rotation Sensing#

Set Rotation Position#

The Set Rotation Position block is used to set the Pusher Motor’s current rotation position to a new value.

The image displays a block from a block-based coding interface that allows the user to set the position of a rotational sensor or motor. The block is currently configured to set the "PusherRotation" to a position of 0 degrees.

In this example, the rotation that will pushes the Ring off the Arm will be set to 0 degrees.

The image displays a block-based coding sequence where the code is set to perform two actions when started. First, it spins the "PusherMotor" to lower it for 270 degrees. After this action, the code sets the "PusherRotation" to a new position of 0 degrees, essentially making the lower Pusher position the new reference point for 0 degrees rotation.

Rotation Angle#

The Rotation Angle block is used to report the Pusher Motor’s current rotation angle in degrees.

The image shows a coding block that retrieves the current angle of the "PusherRotation" in degrees.

In this example, the Pusher will push the Ring off the Arm, and then report the rotation angle of the motors.

The image displays a sequence of coding blocks. The code begins by setting a new zero-degree rotation position for the lower pusher mechanism. The "spin" block commands the "PusherMotor" to lower the mechanism by 270 degrees. After this action, the "print" block retrieves and prints the current angle of the "PusherRotation" in degrees, providing feedback on the exact rotational position of the Pusher Motor.

Rotation Position#

The Rotation Position block is used to report the Pusher Motor’s current position.

The image shows a coding block labeled "PusherRotation position in degrees." This block is used to retrieve the current position of the "PusherRotation" component and represent it in degrees.

Select which unit to report in, degrees or turns.

The image displays a coding block where the "PusherRotation" component's position can be checked in either "degrees" or "turns." The dropdown menu is currently set to "degrees," but it also offers the option to switch to "turns" as a unit of measurement.

In this example, the Pusher will push the Ring off the Arm, and then report the position of the motors in degrees.

The image shows a coding block sequence where the "PusherMotor" is set to lower for 270 degrees. Once the motor spins to this position, the block then prints the "PusherRotation" position in degrees. The purpose of this sequence appears to be setting the new zero degrees rotation position for the lower Pusher, ensuring that the starting position is accurately tracked for subsequent operations.

GPS Sensing#

GPS position#

The GPS position block is used to report the positional offset of the robot’s turning reference point from the center of a field.

The image shows a coding block labeled "GPS position X in mm." This block is used to retrieve the X-coordinate of the GPS sensor's position in millimeters.

Select either the X or Y axis to report.

The image shows a coding block that allows the user to select between the X and Y coordinates for retrieving the position from a GPS sensor. The selected option in the dropdown menu is "X," but "Y" is also available as an alternative.

Select what unit to report the offset value in, millimeters (MM) or inches.

The image displays a coding block that allows the user to select between units of measurement for the GPS position, specifically between millimeters (mm) and inches. The current selection in the dropdown menu is "mm," indicating that the position will be measured in millimeters.

GPS heading#

The GPS heading block is used to report the heading that a robot is currently facing based on a GPS Sensor’s readings from the VEX GPS Field Code.

GPS heading reports a range from 0.00 to 359.99 degrees.

The image displays a coding block that is used to obtain the GPS heading in degrees. This block allows the user to select the GPS sensor and then retrieves the heading information, which indicates the direction the robot or object is facing, measured in degrees.

AI Vision Sensing#

Take Snapshot#

The Take snapshot block will capture the current image from the AI Vision Sensor to be processed and analyzed for AI Classifications.

AI Classifications are Mobile Goals, Red Rings, and Blue Rings.

The block says, "take a AI Vision snapshot of AI Classifications." It involves taking a snapshot using the AI Vision sensor, specifically focused on AI Classifications.

All subsequent AI Vision Sensor blocks rely on data from the most recent snapshot taken. To ensure you’re working with the most up-to-date information, it’s important to take new snapshots regularly. Each new snapshot refreshes the data available to all AI Vision Sensor blocks, allowing them to process the latest visual information from the sensor’s environment.

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In this example a snapshot is taken and the largest detected AI Classification’s width and height are printed to the Print Console.

  • By default, objects are indexed by size, with the largest object at index 1.

  • The AI Vision Sensor automatically selects the largest object (index 1) after a snapshot.

In the image, the blocks present a code that begins when the code starts, spinning the Arm Motor upward for 270 degrees to prevent the AI Vision Sensor from being obstructed. A snapshot is taken using the AI Vision sensor focused on AI Classifications, and the code checks if any AI Classifications were detected in the last snapshot. If an object is detected by the AI Vision sensor, the code then prints the width of the largest detected object.

AI Classification is#

The AI Classification is block will report if the specified AI Classification has been detected.

The block in the image reads: "AI Vision AI Classification is MobileGoal?" The block is structured to check if the AI Vision sensor has detected an object classified as "MobileGoal."

Choose what AI Classification to detect in the last snapshot.

The block in the image reads: "AI Vision AI Classification is MobileGoal?" The dropdown menu next to "MobileGoal" is open, showing options to select "MobileGoal," "RedRing," or "BlueRing."

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In this example, after a snapshot is taken, the code will check if any Mobile Goals were detected.

This image displays a coding sequence where the Arm Motor is set to spin for 270 degrees to ensure the AI Vision Sensor is not obstructed. The AI Vision sensor then takes a snapshot, checking if any AI classifications were detected. If any object is detected, the sequence checks if the object is classified as a Mobile Goal.

Set Object Item#

The Set Object Item block will set the object item (of the object you want to learn more information about) from the objects detected. By default, the Object item is set to 1 at the start of a project.

The image shows a coding block that sets the AI Vision system's object item to 1.

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In this example, after a snapshot is taken, the current object index is set to the second-largest detected object and its height is printed to the Print Console.

The image shows a block-based coding sequence. The code starts by spinning the Arm Motor up for 270 degrees so that the AI Vision Sensor is not blocked. Next, the AI Vision Sensor takes a snapshot of AI Classifications. The program then checks if any AI Classifications were detected in the last snapshot. If an object exists, the program sets the AI Vision object's item to 2, representing the second-largest object. Finally, the program prints the height of this object and sets the cursor to the next row.

Object Count#

The Object Count block will set the object item (of the object you want to learn more information about) from the objects detected. By default, the Object item is set to 1 at the start of a project.

The image shows a block labeled "AIVision object count." The dropdown menu at the beginning of the block is set to "AIVision," and the block will return the number of objects detected by the AI Vision sensor.

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In this example, the code will check if an AI Classification is detected after a snapshot, and if any are detected, will print how many AI Classifications were detected.

The image shows a sequence of blocks used to execute a program that interacts with an AI Vision sensor. The program starts by spinning an arm motor upward for 270 degrees to avoid waiting the AI Vision sensor. After the motor completes its motion, a snapshot of AI Classifications is taken. The program then checks if any objects were detected by the AI Vision sensor. If an object is detected, the program prints the count of detected objects and moves the cursor to the next row.

Object Exists#

The Object Exists block will report if the AI Vision Sensor detects an AI Classification.

The image shows a block that checks if an object exists as detected by the AI Vision sensor. The block outputs a Boolean value indicating whether an object was detected.

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In this example, the code will check if an AI Classification is detected after a snapshot, and if any are detected, will print how many AI Classifications were detected.

The image shows a sequence of blocks used to execute a program that interacts with an AI Vision sensor. The program starts by spinning an arm motor upward for 270 degrees to avoid waiting the AI Vision sensor. After the motor completes its motion, a snapshot of AI Classifications is taken. The program then checks if any objects were detected by the AI Vision sensor. If an object is detected, the program prints the count of detected objects and moves the cursor to the next row.

AI Vision Object#

The AI Vision Object block will report information about an AI Classification from the last use of the Take Snapshot block.

The image shows a block that retrieves the width of an object detected by the AI Vision sensor. The block contains dropdown menus for selecting the AI Vision sensor and specifying the measurement type as width. It outputs the width value of the detected object.

Choose what property to report about the AI Classification:

  • width: How wide the AI Classification is in pixels.

  • height: How tall the AI Classification is in pixels.

  • centerX: The X coordinate at the exact center of the AI Classification.

  • centerY: The Y coordinate at the exact center of the AI Classification.

  • originX: The X coordinate at the top-left corner of the AI Classification.

  • originY: The Y coordinate at the top-left corner of the AI Classification.

The image shows a set of rounded blue buttons labeled "AIVision," "object," and "width" aligned horizontally at the top. Below the "width" button, a dropdown menu is expanded, displaying a list of options that includes "width" (which is selected), "height," "centerX," "centerY," "originX," and "originY."

Before attempting to access data stored from the last snapshot, you should always check if AI Classifications were detected. To do this:

  1. Wrap your AI Vision blocks after a Take Snapshot with an If block.

  2. Use the Object exists? block as the condition for the If block.

  3. This will check if an AI Classification was detected before attempting to pull any data from the last taken snapshot.

In the image, the blocks present a code that begins when the code starts, spinning the Arm Motor upward for 270 degrees to prevent the AI Vision Sensor from being obstructed. A snapshot is taken using the AI Vision sensor focused on AI Classifications, and the code checks if any AI Classifications were detected in the last snapshot. If an object is detected by the AI Vision sensor, the code then prints the width of the largest detected object.