LEGO NXT-G for ROBOLAB Users
Migrating from the RCX to NXT
By Eric Wang; University of Nevada at Reno
Preface
For me, the introduction of the NXT has been both a blessing and a curse. On the up side, the NXT programmable brick is a great leap forward over the RCX in terms of capability and features. Another positive feature is that NXT-G is very easy to learn as far as programming languages go (especially if you already know ROBOLAB).
On the down side, I’ve had a very hard time dealing with the limitations of NXT-G. In the process of making the software easy to use, many “power user” features were necessarily left out and have been hard to live without. Additionally, learning to construct robots with the NXT has proven to be a lengthy process for me.
Nonetheless, as the Borg say, “resistance is futile.” ROBOLAB version 2.9 is the final version, so migrating to NXT-G was inevitable. Having gone through the migration process myself, it was only natural that I attempt to document the process so that others could be spared at least some of the headaches I suffered.
The target audience is the educator or student who is trying to make the transition from using the RCX with ROBOLAB to the NXT with NXT-G. With this book, I’ve attempted to create a Rosetta stone with examples of the same program done in both ROBOLAB and NXT-G. My goal is to help you transfer as much of your ROBOLAB knowledge to NXT-G as possible.
I’ve replaced the design challenges from my previous books with a series of related exercises. The exercises all focus on the same task: programming a line following robot. The difference between the exercises is the algorithm used. Each exercise uses a more complex algorithm than the previous one. By completing the exercises in order, you will be building up your NXT-G knowledge progressively. Unlike my previous books, this book contains at least one solution to the each of the exercises, just in case you need some help.
Don’t expect your migration from the RCX to the NXT to be trouble free. Think of it as an adventure and invest the time and energy to make it an enjoyable one. I wish you good luck. I’ll see you on the other side!
Eric Wang
|
|
Preis in anderen Währungen/ Price in other currencies |
Tabel of Contents
Chapter 1: GETTING STARTED
1.1 My opinion of the NXT
1.2 Objective of this book
1.3 Organization of This Book
1.4 Migration as a Journey
1.5 Engineering and the Design Process
1.6 The NXT Programmable Brick
1.6.1 Output and Input Devices
1.7 Software Choices
1.8 NXT-G Software
1.8.1 Robot Educator
1.8.2 Program Window
1.8.3 Profiles
1.8.4 Connecting to the NXT
1.8.5 Installing Firmware
1.8.6 Resetting the NXT
1.9 Design Skills
1.9.1 Tips for Building with LEGO® Bricks
1.9.2 Gears and Axles
1.9.3 Getting Around on Wheels
1.9.4 Getting Around on Legs
1.9.5 Bumpers and Sensors
1.9.6 Grippers and Claws
1.10 Additional Resources
1.10.1 The CMU Robotics Academy
1.10.2 NXT-G Information
1.10.3 Where to buy
1.11 LEGO® Design Challenges
Chapter 2: NXT-G BASICS
2.1 Exercises
2.1.1 Going the Distance
2.2 NXT-G Basics
2.2.1 The Functions Palette
2.2.2 The Tools Palette
2.2.3 The Configuration Panel
2.2.4 Wiring
2.2.5 Data Hubs
2.2.6 The Controller
2.2.7 Getting Help
2.3 Basic Actions
2.3.1 The Motor Block
2.3.2 The Move Block
2.3.3 The Sound Block
2.3.4 The Display Block
2.3.5 The Record/Play Block
2.4 NXT-G Wait Block
2.5 NXT-G Sensor Blocks
2.5.1 Notes About Using the LEGO® Light Sensor
2.5.2 Notes About the LEGO® Ultrasonic Sensor
2.6 Sample Output and Wait-for Programs
2.7 Good Programming Habits
2.7.1 Commenting Your Programs
2.7.2 Determining What Went Wrong
2.8 Solution to Exercise 2.1.1
Chapter 3: STRUCTURES AND VARIABLES
3.1 Exercise
3.1.1 A Classic Line Follower
3.1.2 An Improved Line Follower
3.1.3 Line Follower, Version 3.0
3.1.4 Line Follower v4.0
3.2 Flow (Structures)
3.2.1 The Stop Block
3.2.2 The Loop Block
3.2.3 The Loop Counter
3.2.4 Forever Loop
3.2.5 Sensor Loops
3.2.6 Time Loops
3.2.7 Count Loops
3.2.8 Logic Loops
3.2.9 Nested Loops
3.2.10 The Switch Block
3.2.11 Nested Switch Blocks
3.2.12 Invisible Tunnels
3.2.13 Nested Structures
3.3 Tasks
3.3.1 Task Splits
3.3.2 Conflicts, Sensors, and Variables
3.3.2 Data Dependency
3.4 The Data Sub-Palette
3.4.1 Variable Blocks
3.4.2 Creating & Deleting Variables
3.4.3 Manipulating Data
3.4.4 Data Examples
3.5 Solutions to Exercises
3.5.1 Line Follower v1.0
3.5.2 Line Follower v2.0
3.5.3 Line Follower v3.0
3.5.4 Line Follower v4.0
Chapter 4: ADVANCED BLOCKS AND BLUETOOTH®
4.1 Exercises
4.1.1 Line Follower v5.0
4.2 The Advanced Sub-Palette
4.2.1 The Keep Alive Block
4.2.2 File Access Block
4.2.3 The Calibrate Block
4.2.4 The Reset Motor Block
4.3 My Blocks
4.3.1 Adding Sub-Palettes
4.4 Bluetooth®
4.4.1 Connecting via Bluetooth®
4.4.2 Manually Sending Files
4.4.3 Sending, Receiving, and Waiting for Message
4.4.4 Message Examples
4.5 Solution to Exercise

