AA Fundamentals - Thinking VEX
AA Fundamentals - Thinking VEX
Fundamentals
In this lesson, you will learn about the roles of the programmer and the robot, and how the two
need to work together in order to accomplish their goals.
Robots are made to perform useful tasks. Each one is designed to solve a specific problem,
in a specific way.
Robotic Tractor
Problem:
Drive safely through a field
which may contain obstacles
Solution:
Move towards the destination,
making small detours if any
obstacles are detected
Labyrinth Robot
Problem:
Get through the maze.
Solution:
Move along a predetermined
path in timed segments.
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 1
ROBOTC
Fundamentals
Let’s take a closer look at the Labyrinth robot. How does it find its way through the maze?
How does it know how to do that?
Creating a successful robot takes a team effort between humans and machines.
15.25”
58.5”
11”
26”
14” 1
17”
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 2
ROBOTC
Fundamentals
The human and the robot accomplish the task together by dividing up the responsibilities.
The human programmer must come up with the plan and communicate it to the robot. The robot
must follow the plan.
Human Robot
Because humans and robots don’t normally speak the same language, a special language must be used
to translate the necessary instructions from human to robot. These human-to-robot languages are called
programming languages. Instructions written in them are called programs. ROBOTC is just one of
many such programming languages that humans use to talk to machines.
Human Robot
End of Section.
Humans and robots communicate by using programming languages such as ROBOTC. A human
who writes a program is called a programmer. The programmer’s job is to identify the problem
that the robot must solve, create a plan to solve it, and turn that plan into a program that the
robot can understand. The robot will then run the program and follow its instructions to perform the
task.
A robot can only follow its program. It cannot think for itself! Just as it can be no stronger than it
is built, the robot can be no smarter than the program that a human programmer gave it. You, as
programmer, will be responsible for planning and describing to the robot exactly what it needs to
do to accomplish its task.
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 3
ROBOTC
Fundamentals
In this lesson, you will learn how thinking in terms of “behaviors” can help you to see the logic
behind your robot’s actions, and break a big plan down into practical parts.
Behaviors are a convenient way to talk about what a robot is doing and what it must do. Moving
forward, stopping, turning, looking for an obstacle… these are all behaviors.
1 1
As you start programming, you should also start thinking about the robot’s actions in terms of
behaviors. Recall that as programmer, your primary responsibilities are:
• First, to come up with a plan for the robot to reach the goal.
• Second, to translate that plan into a program that the robot can follow.
The plan will simply be the sequence of behaviors that the robot needs to follow. The program will
be those behaviors translated into the programming language.
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 4
ROBOTC
Fundamentals
1. Examine problem
2 To find a solution, start by examining the problem.
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 5
ROBOTC
Fundamentals
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 6
ROBOTC
Fundamentals
End of Section
Start with a very large solution behavior and break it down into smaller and smaller sub-behaviors.
This gives you a logical way to figure out what the robot needs to do to accomplish its task.
Recording the robot’s behaviors in English is the first step toward writing good pseudocode. It
allows you to easily review these behaviors and their organization as you prepare to translate them
into program code.
The only step remaining is to translate your behaviors from English pseudocode into the ROBOTC
programming language.
© Carnegie Mellon Robotics Academy / For use with VEX® Robotics Systems Thinking about Programming • 7