CS 102B Robot Design Thursday, 92804 - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

CS 102B Robot Design Thursday, 92804

Description:

Example 1: Program robot to distinguish dark from light that works in a variety ... Yellow Book' Documentation. Contains 3 documents: ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 10
Provided by: Mathematic53
Category:

less

Transcript and Presenter's Notes

Title: CS 102B Robot Design Thursday, 92804


1
CS 102B Robot DesignThursday, 9/28/04
  • Todays Class
  • Introduction to NQC
  • NQC Lab
  • Reading
  • Ferrari, Chap. 6
  • Assignments
  • Work on Sumobot project
  • Complete lab work assigned today.
  • NO CLASS ON THURSDAY
  • NO OFFICE HOURS UNTIL MONDAY 10/4/04

2
Limits of RCX Code
  • Example 1 Program robot to distinguish dark from
    light that works in a variety of room conditions.
  • Example 2 Program robot to wander randomly,
    recording 50 light readings for later analysis
  • These tasks cannot be done with RCX Code.

3
Alternative Languages
  • ROBOLAB (see Chap. 16 in Erwin text)
  • A graphical programming language (like RCX code)
    commercial product
  • Extensions of general (text-based) prgoramming
    languages
  • Visual BASIC (Erwin Chap. 15)
  • leJOS extension of Java
  • NQC extension of C
  • leJOS and NQC are open-source, freely available
    on intrnet.

4
NQC
  • NQC is short for Not Quite C
  • Written by Dave Baum
  • Text-based language
  • Based on C programming language, but specialized
    for robots, and simpler than full C
  • Syntax is similar to C and Java
  • Helpful for transition into CS 106 and other
    programming courses

5
GUIs for NQC
  • GUI means graphic user interface
  • An environment providing windows, menus, button,
    etc. to make writing and using programs easier
  • RcxCC RCX Command Center and
  • Bricx CC (updated version)
  • A GUI for using NQC in Windows environment
  • Written by Mark Overmars (Netherlands)
  • Up-to-date version available on our course web
    site (dont use older version from disk with
    Erwin text)
  • MacNQC
  • A GUI for using NQC in Mac environment
  • Available on disk with Erwin Text

6
RcxCC/BricxCC
  • Our next project will use RcxCC, which is
    installed on lab machines
  • You can install it on your own machine from the
    text disk.
  • Once installed, a folder is created containing
  • An executable file to run RcxCC
  • A folder with three Word documents with
    information on how to use NQC and RxcCC

7
A Simple example of NQC code
task main() SetSensor(SENSOR_1,
SENSOR_LIGHT) On(OUT_A OUT_C) while(true)
if (SENSOR_1 lt 43) SetDirection(OUT_A
OUT_C, OUT_FWD) else
SetDirection(OUT_A OUT_C, OUT_REV)

8
Comparing NQC with RCX Code
  • Every NQC program contains a block task main()
  • Output ports are called OUT_A, OUT_B, OUT_C
  • Control output with statements OnFwd(), OnRev(),
    Off(), etc.
  • Input ports are called SENSOR_1 (or 2 or 3)
  • Every RCX program starts with a program block
  • On/Off blocks refer to output ports A, B, C
  • Sensor blocks assign input ports to sensors, and
    associate actions with sensor readings

9
Yellow Book Documentation
  • Contains 3 documents
  • Part 1 is a short text on how to write robot
    control programs using NQC
  • Part 2 is a reference guide on how to use the
    RcxCC GUI interface
  • Part 3 is a reference guide for NQC
  • Inside and back covers contain a brief,
    alphabetized NQC reference
Write a Comment
User Comments (0)
About PowerShow.com