Drivetrain#

Drive#

The Drive block is used to move the Drivetrain in the specified direction forever, until a new drivetrain command is used, or the project is stopped.

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

Drivetrain command block diagram illustrating movement, turning, and stopping functionalities for a robot.

Select which direction for the drivetrain to move in.

Diagram illustrating drivetrain movement directions and commands for robotics programming.

In this example, the robot will drive forward for 2 seconds, then stop.

Diagram illustrating Drivetrain blocks for robot movement commands like Drive, Turn, and Set Drive settings.

Drive For#

The Drive For block is used to move the Drivetrain 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.

Diagram illustrating the Drive block for controlling a robot's Drivetrain movement direction and behavior.

Select which direction for the drivetrain to move in.

Diagram illustrating drivetrain commands for robot movement, including drive, turn, and stop functionalities.

Set how far the Drivetrain will move by entering a value, and choosing the unit of measurement (inches or millimeters).

Diagram illustrating the Drive For block used to move a Drivetrain for a specified distance in programming.

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

Diagram illustrating various drivetrain commands for robot movement, including drive, turn, and stop functions.

In this example, the robot will drive in reverse for 500 mm.

Diagram illustrating various drivetrain commands for robot movement, including driving, turning, and stopping actions.

Turn#

The Turn block is used to rotate the Drivetrain forever, until a new Drivetrain block is used, or the program is stopped.

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

Image of a Drive block used in a Drivetrain programming context, showing options for movement and control commands.

Select which direction the Drivetrain will turn.

Diagram illustrating the direction options for Drivetrain movement commands in robotics programming.

In this example, the robot will turn towards the left for 2 seconds, then stop.

Diagram illustrating various drivetrain commands for robot movement, including drive, turn, and stop functions.

Turn For#

The Turn For block is used to rotate the Drivetrain for a given number of degrees.

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

Diagram illustrating the Drive block used to control a robot's movement direction and behavior in a programming environment.

Select which direction the Drivetrain will turn.

Diagram illustrating drivetrain commands for turning and driving direction in robotics programming.

Set how far the Drivetrain will turn by entering the number of degrees.

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

Diagram illustrating the various Drivetrain control blocks for robot movement and orientation adjustments.

In this example, the robot turn left for 45 degrees.

Flowchart illustrating various drivetrain commands for robot movement, including drive, turn, and stop actions.

Turn to Heading#

The Turn to Heading block is used to turn a Drivetrain to a specific heading using the built-in Gyro sensor.

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

Diagram illustrating the Turn to Heading" block for controlling a robot's drivetrain using a Gyro sensor.

The Turn to Heading block turns to an absolute degree measure. This means:

  • When the robot turns clockwise past 360 degrees, the degree measure will start increasing again from 0 degrees.

  • When the robot turns counterclockwise past 0 degrees, the degree measure start decreasing again from 360 degrees.

Image of a compass indicating direction for the 'Turn to Heading' block in a Drivetrain programming context.

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

Robot drivetrain block diagram illustrating commands for turning to heading and rotation with gyro sensor integration.

In this example, the robot will turn to face 270 degrees.

Diagram illustrating various Drivetrain commands including Drive, Turn, and Set parameters for robot navigation.

Turn to Rotation#

The Turn to Rotation block is used to turn a Drivetrain to a specific angle of rotation using the built-in Gyro sensor.

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

Image of a block diagram illustrating the Turn to Rotation function for a robot's drivetrain control.

The Turn to rotation block turns a cumulative degree measure. This means:

  • When the robot turns clockwise past the 360 degrees, the degree measure continues to increase.

  • When the robot turns counterclockwise past 0 degrees, the degree measure continues to decrease.

Image of a compass showing rotation directions for drivetrain control in robotics programming.

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

Icon representing the Turn to Rotation" block for controlling Drivetrain rotation using a Gyro sensor.

In this example, the robot will turn to 480 degrees.

Diagram illustrating drivetrain commands for turning and driving, including examples of movement and settings.

Stop Driving#

The Stop Driving block is used to stop the drivetrain.

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

Image of a block diagram illustrating the Stop Driving" command for a robot's drivetrain control.

In this example, the robot will stop driving after 4 seconds.

Diagram illustrating Drivetrain commands for driving, turning, and stopping in a robotics programming context.

Set Drive Velocity#

The Set Drive Velocity block is used to set the speed of the Drivetrain.

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

Set Drive Velocity block interface for adjusting the speed of the Drivetrain in a robotics programming environment.

The Set Drive Velocity block accepts a range from 1% to 100%. The default drive velocity is 50%.

In this example, the drive velocity is set to 100% before the robot drives forward for 600 MM.

Example of setting drive velocity for a robot, showing parameters for speed and direction in a programming interface.

Set Turn Velocity#

The Set Turn Velocity block is used to set the speed of the Drivetrain’s turns.

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

Set Turn Velocity block for adjusting the speed of the Drivetrain's turns, with a range from 1% to 100%.

The Set turn velocity block accepts a range from 1% to 100%. The default turn velocity is 50%.

In this example, the turn velocity is set to 100% before the robot turns to the left for 180 degrees.

Example of setting turn velocity for a robot, demonstrating a left turn at 100% speed for 180 degrees.

Set Drive Stopping#

The Set Drive Stopping block is used to set the behavior of the Drivetrain when the robot stops moving.

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

Diagram illustrating the Set Drive Stopping block for configuring Drivetrain stopping behavior in robotics programming.

Select which stopping behavior to use.

The three drive stopping behaviors are as follows:

  • brake - The Drivetrain will come to an immediate stop.

  • coast - The Drivetrain will spin gradually to a stop.

  • hold - The Drivetrain will come to an immediate stop. If the Drivetrain is rotated by an outside force, the built-in encoder will move the Drivetrain back to its initial stopped position.

Diagram illustrating the Set Drive Stopping block options for Drivetrain stopping behavior: brake, coast, hold.

In this example, the Drivetrain moves for 2 seconds before coasting to a stop.

Diagram illustrating Drivetrain commands for driving, turning, and stopping behaviors in robotics programming.

Set Drive Timeout#

The Set Drive Timeout block is used to set a time limit for Drivetrain movement commands.

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

Image illustrating the Set Drive Timeout block for controlling Drivetrain movement duration in programming.

The Drivetrain’s time limit is used to prevent drive blocks that do not reach their target position from waiting the execution of other blocks in the stack.

For instance, if a robot is unable to reach its target position because it encounters an obstacle like a wall, the drive block will continue running indefinitely. This would prevent any subsequent blocks in the stack from executing. By setting a time limit, the drive block will automatically stop after the specified duration, allowing the program to proceed to the next block even if the target position is not reached.

In this example, the Drivetrain is set to move forward for 25 inches with a timeout of 1 second. The robot won’t reach the target position within 1 second, so the Drive block will automatically stop, and the robot will turn right by 90 degrees.

Example of setting a drive timeout for a robot, illustrating a 1-second limit for movement commands in programming.

Set Drive Heading#

The Set Drive Heading block is used to set the Drivetrain’s Gyro heading value.

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

Image of the Set Drive Heading" block used to set the Drivetrain's Gyro heading value in programming.

The Set Drive Heading block can be used to set the Drivetrain’s position to any given heading. This block can be used to reset the orientation of the Drivetrain’s gyro when the heading is set to a value of 0.

In this example, the Drivetrain’s Gyro heading will be set to 90 degrees.

Example of setting the Drivetrain's heading to 90 degrees using the Set Drive Heading block.

Set Drive Rotation#

The Set Drive Rotation block is used to set the Drivetrain’s angle of rotation.

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

Diagram illustrating the Set Drive Rotation block for controlling a robot's angle of rotation in a drivetrain.

The Set Drive Rotation block can be used to set the Drivetrain’s angle of rotation to any given positive or negative value.

Diagram illustrating the use of the Set Drive Rotation block for controlling a robot's angle of rotation.