Professional Documents
Culture Documents
Simple Behaviors 2
3
Timeline (8:30 – 11:30 AM Classes)
Time Period Duration Task
8:30 – 8:45 AM 15 mins • Review of Simple Behaviors
8:45 – 8:50 AM 5 mins • Borrowing of Materials
8:50 – 9:50 AM 60 mins • Building of Standard Drive Base Robot
• Doing the activity (time-based vs. rotation-based
9:50 – 10:00 AM 10 mins
programming)
• Programming the robot to perform the challenge
10:00 – 10:50 AM 50 mins
(forward, point turn + swing turn)
10:50 – 11:00 AM 10 mins • Dismantling the robot
11:00 – 11:20 AM 20 mins • Returning of materials
4
Timeline (11:30 AM – 2:30 PM Classes)
Time Period Duration Task
11:30 – 11:45 AM 15 mins • Review of Simple Behaviors
11:45 – 11:50 AM 5 mins • Borrowing of Materials
11:50 AM – 12:50 PM 60 mins • Building of Standard Drive Base Robot
• Doing the activity (time-based vs. rotation-based
12:50 – 1:00 PM 10 mins
programming)
• Programming the robot to perform the challenge
1:00 – 1:50 PM 50 mins
(forward, point turn + swing turn)
1:50 – 2:00 PM 10 mins • Dismantling the robot
2:00 – 2:20 PM 20 mins • Returning of materials
5
Timeline (1:00 – 4:00 PM Classes)
Time Period Duration Task
1:00 – 1:15 PM 15 mins • Review of Simple Behaviors
1:15 – 1:20 PM 5 mins • Borrowing of Materials
1:20 – 2:20 PM 60 mins • Building of Standard Drive Base Robot
• Doing the activity (time-based vs. rotation-based
2:20 – 2:30 PM 10 mins
programming)
• Programming the robot to perform the challenge
2:30 – 3:20 PM 50 mins
(forward, point turn + swing turn)
3:20 – 3:30 PM 10 mins • Dismantling the robot
3:30 – 3:50 PM 20 mins • Returning of materials
6
Simple Behaviors
7
Recall: Behavior
• anything that your robot does
• examples:
turning on a single motor
moving forward
tracking a line
navigating a maze
• Three types:
1. Basic Behavior
2. Simple Behavior
3. Complex Behavior 8
Recall: Basic vs. Simple vs. Complex Behaviors
9
Recall: Basic vs. Simple vs. Complex Behaviors
10
Recall: Basic vs. Simple vs. Complex Behaviors
11
Programming Simple Behaviors in RobotC
12
Simple Behaviors (Linear Movement)
• Linear movement commands in RobotC:
forward and backward
In general, 𝐶𝑤 = 𝜋 × 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑤ℎ𝑒𝑒𝑙 .
14
Simple Behaviors (Linear Movement)
Sample computations:
20 cm
• Target distance: 20 cm nr 1 rotation
20 cm
60 cm
• Target distance: 60 cm nr 3 rotations
20 cm
90 cm
• Target distance: 90 cm nr 4.5 rotations
20 cm
15
Simple Behaviors (Linear Movement)
• Converting rotation to degrees:
nd nr 360
where:
𝑛𝑑 = number of degrees
𝑛𝑟 = number of rotations
16
Simple Behaviors (Turning)
Two types of turn:
(Cr )
nr
Cw (360)
where:
𝑛𝑟 = number of rotations needed
𝜃 = target turn angle
𝐶𝑟 = circumference of the robot = 𝜋 × 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑟𝑜𝑏𝑜𝑡
𝐶𝑤 = circumference of the wheel 19
Simple Behaviors (Turning)
Cr diameterrobot
3.1416 18 cm
56.55 cm
Approximate diameter
of the robot: 18 cm
20
Simple Behaviors (Turning)
Sample computations (Point Turn):
(45)(56.55 cm)
• Target turn angle: 45° nr 0.35 rotation
(20 cm)(360)
(90)(56.55 cm)
• Target turn angle: 90° nr 0.71 rotation
(20 cm)(360)
(180)(56.55 cm)
• Target turn angle: 180° nr 1.41 rotations
(20 cm)(360)
21
Turning Concepts (Swing Turn)
• A swing turn is where a vehicle
"swings" around a pivot point.
This occurs when one side of the
vehicle is traveling faster than the
other.
(2Cr )
nr
Cw (360)
where:
𝑛𝑟 = number of rotations needed
𝜃 = target turn angle
𝐶𝑟 = circumference of the robot = 𝜋 × 𝑑𝑖𝑎𝑚𝑒𝑡𝑒𝑟𝑟𝑜𝑏𝑜𝑡
𝐶𝑤 = circumference of the wheel 23
Simple Behaviors (Turning)
Sample computations (Swing Turn):
(45)(2 56.55 cm)
• Target turn angle: 45° nr 0.71 rotation
(20 cm)(360)
25
Lab Activity 3: Simple Behaviors (Physical)
26
Lab Activity 3
Activity No.: Lab 3
Title: Simple Behaviors (Physical)
EMT05L Lab 3 R204/R208
Simple Behaviors (Physical)
1 unit Standard Drive Base Kit 1 unit Standard Drive Base Kit
1 unit Laptop
1 unit Laptop
1 unit Mouse
1 unit Charger
1 unit Extension Cord (to be assigned by Instructor)
1 unit Mouse
1 unit Charger Instructor’s
Borrower’s Signature
(after borrowing)
Signature