Aragon Robotics Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Programming Activities

Go down

Programming Activities Empty Programming Activities

Post by Navi Mon Sep 12, 2011 1:42 am

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.
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

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum