LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:

Slides:



Advertisements
Similar presentations
Exercise 1: Install PC Software & NXT Firmware
Advertisements

Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
LabView Basics.
© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication.
VEX Robotics Platform and ROBOTC Software Introduction.
VEX Robotics Platform and ROBOTC Software
Building Mindstorms NXT Robots Dr. David Johnson School of Computing.
Mingo County Shewey Science Academy: NXT Training.
Computer Basics. The Computer (Generic) Processor executes commands. Memory stores program and data. Input devices transfer information from outside world.
Vex 1.0 © 2005 Carnegie Mellon Robotics Academy Inc. Programming in easyC.
RobotC Programming for LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
EducateNXT NXT... an introduction The Kit and the Software.
RobotC For Beginners Tyler Lutz and Keaton Bonds DRSS Enterprise.
The NXT is the brain of a MINDSTORMS® robot. It’s an intelligent, computer-controlled LEGO® brick that lets a MINDSTORMS robot come alive and perform.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
Dr. Wenbin Luo Engineering Department St. Mary’s University San Antonio, TX June 9, 2012.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Oregon Robotics Tournament and Outreach Program Opening doors to the worlds of science and technology for Oregon’s youth 2008 Getting Started with FTC.
VEX Robotics Platform and ROBOTC Software
Robotics Abstractions: Levels of language, world view
Topics Introduction Hardware and Software How Computers Store Data
Adapted for STLP Camp ‘10 STLP Robotics Camp June 3 & 4.
ECE 191: Group 2 NXT Robots & Their Applications in Machine Learning Mentor: Anjum Gupta Group: Roanne Manzano Eric Tsai Jacob Robison Sponsored by: SPAWAR.
[Low-level] Programming of NXT Robots Pavel Petrovič Department of Applied Informatics, Faculty of Mathematics, Physics and Informatics
Demonstrating the Capabilities of MindStorms NXT for the AI Curriculum Myles McNallyFrank Klassner Alma CollegeVillanova University AAAI Spring Symposium.
Adapted for STLP Camp ‘09 Mobile Robots Why do robots need to move?
Introduction to the Basic Parts of LEGO’s NXT Robotics
Coding for the FIRST Tech Challenge: RobotC Presented by: Audrey Yeoh Acknowledgements: Team Unlimited FTC 0001.
Why do robots need to move?
ROBOTC for VEX On-Site Professional Development
Coding for the FIRST Tech Challenge: RobotC
Exploring with Lego Robots Daniel Limbrick (Texas A&M University) Emily Sherrill (Tennessee Tech University)
Robotics Overview of NXT-G Actuators in Mindstorms. Touch sensor Labwork: Right turn. Touch/bump. [Explore move versus Motor Move mini & motor mini. Motor*.]
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
Mobile Robots Why do robots need to move?. What defines a robot? Sense – a robot has to take in information about its environment Plan – a robot has to.
Sentry System Multiple Sensors
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Robotics NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room.
How to control LEGO® Mindstorms devices Thomas Mueller thomas _ tmspecial.com.
Minds and Computers 2.1 The RCX l Hitachi H8/3297 series processor l 3 inputs/sensors (1, 2, 3) l 3 outputs/motors (A, B, C) l 32k RAM/ 16k ROM ä 12 kB.
Introduction to Robots and the Mind Bert Wachsmuth & Michael Vigorito Seton Hall University.
ROBOTC Software EV3 Robot Workshop
ROBOTC Software EV3 Robot Workshop Lawrence Technological University.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
DPS Secondary Science Institute 1 Agenda 8:30-8:45 Introduction and Overview 8:45-9:15 The Bumper Car 9:15-10:15 The Line Follower 10:15-10:30 Questions.
Programming Basics - RobotC Introduction to Robotics.
Lego Mindstorm Robots 9797 kit.  Students will learn how to identify how to detect a change in a condition.  Students will learn where and how to identify.
Mobile Robots Why do robots need to move?. What defines a robot? Sense – a robot has to take in information about its environment Plan – a robot has to.
Embedded C- Language Lets Learn fundamentals !!. An Embedded system is combination of computer hardware and software, and perhaps additional mechanical.
Robotics Education & Competition Foundation
Lets Learn fundamentals !!
Robotics Abstractions: Levels of language, world view
Introduction to LEGO Mindstorms EV3 What is in the box?
NXT Mindstorms Kit Programming
Development Environment
Deriving Consistency from LEGOs
Topics Introduction Hardware and Software How Computers Store Data
Java on the LEGO Mindstorms EV3
Robotics Abstractions: Levels of language, world view
CIS16 Application Development – Programming with Visual Basic
What is a Robot?.
Topics Introduction Hardware and Software How Computers Store Data
Programming Basics - RobotC
Warm Up- What is a robot? Describe in one sentence what you understand by the term ‘robot’ 2. What are the main parts of a robot? What do people do to.
RobotC Programming for LEGO Mindstorms NXT
Presentation transcript:

LEGO Mindstorms NXT Carnegie Mellon Dacta Lego Timothy Friez Miha Štajdohar SOURCES:

Principles of Robotics Integrity. Robots hold together throughout the competition (no small task when you are talking about robots built out of Legos). Accuracy. The robot's mechanical outputs and its location acquisition and feedback to the RCX and subsequent programming provide the intelligence for precise performance. Execution. The robot performs the tasks it was designed to accomplish. Repeatability. The robot can perform the exact routine time and time again. Ergonomics. The robot is easy to handle, reconfigure, and change batteries or reprogram if necessary. Efficiency. The robot's design makes optimal use of its parts to execute tasks, minimize friction, and use power.

Why students learn more when they participate in a real challenge?

Sophisticated robots can be build Accuracy of mapping program and NXTAccuracy of mapping program and NXT –Draw letter “E” –Circle Program –Light Following on simulation More videos at ce191nxtMore videos at ce191nxt

Examples of mobile and humanoid robots MotivationMotivation Project OverviewProject Overview Hardware SpecificationHardware Specification –Lego Robot Programming EnvironmentsProgramming Environments –NXC –RobotC Method and ApproachMethod and Approach IdeasIdeas DesignDesign

Mindstorms NXT mindstorms.lego.com

Mindstorms NXT mindstorms.lego.com

Ideas youtube.com...

Brick 4 sensor inputs 3 sensor inputs / motor outputs Programmable

Purchasing NXT Kits Two options (same price; $250/kit) –Standard commercial kit –Lego Education kit education kitAdvantages of education kit –Includes rechargeable battery ($50 value) –Plastic box superior to cardboard –Extra touch sensor (2 total) commercial kitStandard commercial kit –Includes NXT-G visual language

From Idea to Pseudo-Code to software to robot behavior

Thinking about Programming Creating a successful robot takes a team effort between humans and machines. Role of the Robot The robot follows the instructions it is given, thereby carrying out the plan.

Human/Machine Communication 1.Because humans and robots don’t normally speak the same language, a special language must be used to translate the necessary instructions from human to robot. 2.These human-to-robot languages are called programming languages. 3.Instructions written in them are called programs. 4.ROBOTC is just one of many such programming languages that humans use to talk to machines.

Think about “Behaviors” Behaviors are a convenient way to talk about what a robot is doing and what it must do. Moving forward, stopping, turning, looking for an obstacle… these are all behaviors. Complex Behavior Some behaviors are big, like “solve the maze.” Basic or Simple Behavior 1.Some behaviors are small, like “go forward for 3 seconds.” 2.Big behaviors are actually made up of these smaller ones.

Planning the Behaviors

The main principle is braking large behaviors into hierarchies of smaller and smaller behaviors. You have to understand every piece of input-output behavior of a robot

PSEUDOCODE programming language itself, like if-else statements and loops 1.As the programmer becomes more experienced, the organization of the behaviors in English will start to include important techniques from the programming language itself, like if-else statements and loops. hybrid language 2.This hybrid language, halfway between English and the programming language, is called pseudocode. larger programs understandable 3.It is an important tool in helping to keep larger programs understandable.

ROBOTC is text based! 1.Commands to the robot are first written as text on the screen. 2.They are then processed by the ROBOTC compiler into a machine language file that the robot can understand. 3.Finally, they are loaded onto the robot, where they can be run.

Software development options Onboard programs –RobotC –leJOS –NXC/NBC Remote control –iCommand –NXT_Python

NXT Brick Features 64K RAM, 256K Flash 32-bit ARM7 microcontroller 100 x 64 pixel LCD graphical display Sound channel with 8-bit resolution Bluetooth radio Stores multiple programs –Programs selectable using buttons

Programming languages NBC, NXC NXT Python,.NET IDE – interactive development environment

Programming Environments NXC –A High-level language –Similar to C –Stand-alone language (No plug-ins or add-ons) –The program runs in the robot itself. NXC On Bot More Robust language Takes and uses values Robust language can Graphically represent Desired input and results

NXT Python demo bluetooth remote control

Python IDE Python Programming Environments Python 2.4.4Python –Scripted Programming Language –Plug ins PyGame: “Simulated World”PyGame: “Simulated World” PyODE: Shapes, vectorsPyODE: Shapes, vectors PyBluez: Bluetooth communicationPyBluez: Bluetooth communication Python NXT: Python Libraries for NXTPython NXT: Python Libraries for NXT –Programs Light SensorLight Sensor Ultrasound SonarUltrasound Sonar Sound SensorSound Sensor Python NXT PyBluez PyODE PyGame

Mapping ProgramMapping Program –Generate movement on NXT robot, record movement and plot robot’s path in real time in a simulated world. Python + SimulatorPython + Simulator –Thread function, lock on global objects NXC + SimulatorNXC + Simulator –Separate program activates robot, simulator polls output values Moves Robot Method and Approach Sends motor readings Starts Pygames Draws readings on Pygames

ROBOTC firmware tasks, program loop Sensors, motors data bluetooth, messages

RobotC Commercially supported – Not entirely free of bugs Poor static type checking Nice IDE Custom firmware Costly –$50 single license –$250/12 classroom computers

Bluetooth PyBluez

Motors Configured in terms of percentage of available power Built-in rotation sensors –360 counts/rotation –No rotation sensors in old Lego

Working with Motors Selecting Your Hardware Platform 1.RobotC supports a variety of different hardware platforms. Tetrix/FTC robots pure LEGO robots 2.For these exercises we will configure RobotC to include support for the Tetrix/FTC robots as well as pure LEGO robots. 3.The “FIRST Tech Challenge (NXT)” platform is a superset of the “NXT” platform. 4.Whether your robot is using LEGO motors or the Tetrix 12V motors, you can control them with nearly identical code.

On the Robot / Platform Type menu make sure that you have “FIRST Tech Challenge (NXT)” selected. Click on the New icon on the RobotC toolbar to start a new program.

Configuring your Motors You need to tell RobotC how your motors are attached to your NXT. On the Robot menu, open the Motors and Sensors Setup wizard and select the FTC Servo/Motor Ctrl tab. A. Using LEGO NXT Motors –If your robot is using LEGO NXT motors for the drive wheels, select “No controllers configured”:

Using pragmas #pragmaTwo #pragma statements and a comment line should have been inserted into your program looking something like this: #pragma config(Motor, motorA, motorLeft, tmotorNormal, PIDControl) #pragma config(Motor, motorB, motorRight, tmotorNormal, PIDControl) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// #pragmaA #pragma is an instruction to the RobotC compiler to change something about how your program gets compiled. config()necessary prefix code to configure your programThe config() pragma tells RobotC to automatically include the necessary prefix code to configure your program to use the motor and sensor ports you specified in the wizard.

Important recommendations to Robot C programmer should not modify 1.You should not modify these lines of code by hand. 2.If the configuration of your robot changes 2.If the configuration of your robot changes, go back into the Motor and Sensor Setup wizard and change the values there. 3.When you exit the wizard it will update the #pragmas to reflect the changes you made. 4.Comment lines in RobotC begin with “//”. 5.Everything that follows a double-slash to the end of the line is ingored by the compiler. 6.The comment inserted by the wizard is a reminder that the #pragmas preceeding it were automatically created for you.

Using Tetrix 12 Volt Motors

Three #pragma statements and a comment line should have been inserted into your program looking something like this: #pragma config(Hubs, S1, HTMotor, HTServo, none, none) #pragma config(Motor, mtr_S1_C1_1, motorRight, tmotorNormal, PIDControl, reversed) #pragma config(Motor, mtr_S1_C1_2, motorLeft, tmotorNormal, PIDControl) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// A #pragma is an instruction to the RobotC compiler to change something about how your program gets compiled. tells RobotC to automatically include the necessary prefix codeThe config() pragma tells RobotC to automatically include the necessary prefix code to configure your program to use the motor and sensor ports you specified in the wizard. Using Tetrix 12 Volt Motors

1.You should not modify these lines of code by hand. 2.If the configuration of your robot changes, go back into the Motor and Sensor Setup wizard and change the values there. 3.When you exit the wizard it will update the #pragmas to reflect the changes you made. Using Tetrix 12 Volt Motors

1.Comment lines in RobotC begin with “//”. 2.Everything that follows a double-slash to the end of the line is ingored by the compiler. 3.The comment inserted by the wizard is a reminder that the #pragmas preceeding it were automatically created for you. Using Tetrix 12 Volt Motors

First example of Programming Motors