Virtual Robot Simulator Official Guidebook
  • Coverpage
  • Introduction
  • FTC
    • Centerstage Game and Basic Rules
    • Powerplay Game and Basic Rules
  • VRS
  • Programming
    • User Interface
    • Blocks
      • LinearOpMode
      • Gamepad
      • Actuators
        • DcMotor
        • CRServo
        • Servo
      • Sensors
        • DistanceSensor
        • IMU
        • IMU-BNO055.Parameters
        • REV Color/Range Sensor
        • TouchSensor
      • Utilities
        • Acceleration
        • AngleUnit
        • AngularVelocity
        • Axis
        • Color
        • Orientation
        • PIDFCoefficients
        • Position
        • Range
        • Telemetry
        • Time
        • Vector
        • Velocity
      • Logic
      • Loops
      • Math
      • Text
      • Lists
      • Variables
      • Function
      • Miscellaneous
    • Basic Lessons
      • Drivetrain
      • IMU
      • Color Sensor
      • Telemetry
      • Range Sensor
      • Touch Sensor
      • Servo
      • CRServo
      • DCMotor
      • Logic and Loops
      • Functions
      • Tele-Op Control
    • Advanced Lessons
      • Advanced Tele-Op Control
    • Video Lessons
    • Simulation
    • Exploratory Activities
      • Wandering Robot
  • Robot Arena
    • Single Player
    • Activities
      • Coding Competition
      • CenterStage Competition
  • Conclusion
  • Author
  • Other Editions
Powered by GitBook
On this page
  1. Programming
  2. Advanced Lessons

Advanced Tele-Op Control

PreviousAdvanced LessonsNextVideo Lessons

Last updated 9 months ago

Oftentimes simple button mapping isn’t enough to pilot a robot. It's inconvenient to have to press an exact series of buttons to score an object or trigger an objective. During the game, in the heat of the moment, drivers can mess up, losing otherwise good points. To prevent this, sets of commands are usually linked to buttons.

Here is how it's typically done. We start with a simple program that has each motor mapped to a joystick.

Here is where we can enhance the program.

One common repeated set of commands is opening and releasing a robot claw to pick up and drop game objects. We could code the motor so that a joystick determines how much they open and close but this is inefficient and forgetting to close the claw after each use can cause the claw to get jammed in something. A smarter solution is to just map all the steps onto a single button.

In the main loop of the program, we can add a special trigger if a button (for the demonstration the “A” button is used) is pressed.

Now if the “A” button is pressed, we can set the robot to open and then close its claw.

First reverse the motor and give it a second so that the claw fully opens.

Then give the program a second to fully close the claw.

And there you have it, an algorithm in the press of a button!

Now, this demonstration may seem very simple but it's the effect it has that makes it so impactful. Now when you're piloting the robot, your controls are much smoother and intuitive. In real competitions, small quality of life features like this can be the tiebreaker between otherwise equally matched robots.