Programming Activities
Aragon Robotics Forum :: Archive :: 2011-2012 :: Off-Season :: Training
Page 1 of 1
Programming Activities
Introductory Outline (link): summary of programming plans
Pseudocode:
Obstacle Course
Split into pairs: one controller, one robot. The goal of the challenge is to guide the robot across the room, give someone a hug, and return.
Human
Robot Code
Write a program, in pseudocode, that controls a fictional, autonomous (non-human-controlled) robot. Based on the human example, start with while(running_autonomous) and use both inputs and output functions.
Homework:
Play Lightbot 2.0! (At least a few levels each from Basics, Recursion, and Conditionals).
Pseudocode:
Obstacle Course
Split into pairs: one controller, one robot. The goal of the challenge is to guide the robot across the room, give someone a hug, and return.
- Code:
while (simulation == true) {
if (tap_left_shoulder)
turn_left;
else if (tap_right_shoulder)
turn_right;
if (tap_both_shoulders)
stop_turning;
walk_forward;
if (clap)
stop_turning;
stop_walking;
if (say("free hugs!")) {
target = person_in_front_of_you;
hug(target);
}
}
Human
- Code:
while (alive) {
breathe;
update_heartbeat;
update_thoughts;
update_movement;
process_input(vision, hearing, smell, touch, taste);
if (near_predator?)
reflex(move, scream);
signal(adrenaline);
if (stomach == empty)
signal(hunger);
else if (stomach == full)
signal(stuffed);
digest_food;
if (bladder == full)
signal(need_to_pee);
... // etc.
}
Robot Code
Write a program, in pseudocode, that controls a fictional, autonomous (non-human-controlled) robot. Based on the human example, start with while(running_autonomous) and use both inputs and output functions.
Homework:
Play Lightbot 2.0! (At least a few levels each from Basics, Recursion, and Conditionals).
Navi- Posts : 47
Join date : 2011-09-05
Aragon Robotics Forum :: Archive :: 2011-2012 :: Off-Season :: Training
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|