Robotics - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Robotics

Description:

Messages may not get through. BT checks for messages of a certain data type. Good news ... To get data wires into a switch clause, need to UNCLICK the flat view ... – PowerPoint PPT presentation

Number of Views:35
Avg rating:3.0/5.0
Slides: 21
Provided by: jeanin7
Category:
Tags: robotics

less

Transcript and Presenter's Notes

Title: Robotics


1
Robotics
  • Bluetooth Communications
  • Brain storm project ideasProgramming
    considerationsHomework
  • Library project presentations.Prepare to present
    proposal for building project

2
General communications
  • Protocols (Bluetooth is a protocol) work in
    specific ways
  • handshaking, polling, timing
  • Messages may not get through
  • BT checks for messages of a certain data type
  • .

3
Good news
  • Bluetooth is the protocol for many gadgets,
    including cell phones.
  • Not all BT are the same
  • Some PC dongles work with NXT and some do not!
  • nxtasy.org and other on-line groups are very
    responsive
  • I posed a problem and get responses
  • One person said it couldnt be done
  • Another (Brian Davis) produced an example that
    (according to him) works 80 of the time.

4
General NXT-G
  • To get data wires into a switch clause, need to
    UNCLICK the flat view
  • Getting (sharing) other .rbt files is possible,
    though tricky
  • Used Brians GetKey
  • NOTE this was just to test his code. Your
    application need not use this.

5
(No Transcript)
6
(No Transcript)
7
Master echo idea
  • Problem how to communicate one slave to another
    slave
  • Solution slave sends message to the masters
    mailbox 1, 2, 3. The master passes it on to
    connection 1, 2, or 3.

8
Slave echo (test)
  • Note this program, running on all 3 slave
    robots, is just to test the concept and along
    the way demonstrates several (new to us) NXT-G
    features
  • Random number generated to be sent
  • Concatenation of text
  • Operator presses 1 of 3 NXT buttons. This
    determines the target slave.
  • Recipient (of passed on message) makes beep and
    displays message received.

9
More NXT-G
  • Makes use of Display mini-blocks
  • There also are motor and move mini-blocks.
  • Mini-blocks were/are more efficient versions of
    original blocks.
  • Should be present on the class Mindstorms.
  • If you have your own system, need to follow
    directions to download program for adding blocks
    AND this particular set.

10
masterecho.rbt
11
slaveecho.rbt
12
Caution
  • The parallel threads may be problematic.
  • NOTE the busy-wait for message does cause action
    on both the master and the slaves according to
    information on-line

13
Programming Process
  • Make small testing programs
  • The slaveecho program may be bigger than an
    actual use of relaying messages
  • Use sounds and displays
  • Using the NXT buttons for events as opposed to
    bumper or other sensors may be good for debugging
    process

14
Programming
  • Use MyBlocks the one great idea of programming
    is the concept of subroutine.
  • Write comments in NXT-G files
  • Plan / Diagram
  • Especially events triggering multi-robot action
  • Memory is limited!
  • Remove unnecessary files. This may include sound
    files used in debugging.
  • Look for use of move vs motor vs mini-blocks.
  • Next class

15
MyBlock
  • programs must be stored in MyBlock folder on
    computer running Mindstorms
  • Global variables (variables shared by calling
    program and the MyBlock) must be defined in both
  • MyBlock can have 0, 1 or more inputs and 0, 1 or
    more outputs, but these must be set up in
    original definition.
  • This may lead you to use global variables!

16
Building project Requirements
  • Make use of at least 2 if not more sensors
  • Cause change in the environment
  • This could be making another robot move
  • Can build new robot.
  • NOTE the base robot is called the Tribot
  • Can use on-line directions
  • Can use on-line programs BUT need to another them
  • Can be teams
  • Can be multiple robots (rather, multiple NXT
    bricks)

17
Requirements
  • Present proposal
  • Final project
  • Demonstrate
  • 1 page summary, including pictures and/or
    diagrams
  • NXT-G code must contain comments
  • NXT-G code must have MyBlocks

18
Ideas?
  • www.nxtasy.com (see also the projects archive)
  • has several project ideas, including
  • Maze
  • Going into 'building' and finding something

19
Ideas?
  • mindstorms.lego.com/nxtlog
  • Many projects, with photos and code
  • You must understand the code as well as the
    rationale in the physical design.
  • EXTRA credit for any accepted project.
  • (Yes, I will change a grade if this happens after
    grades are submitted.)

20
Homework
  • Postings
  • Prepare proposal for building project 4/17
  • Projects presented 5/5
Write a Comment
User Comments (0)
About PowerShow.com