I received my copy of John Hansen’s “Power Programming – Robotics in C”, second edition, a few weeks ago and I’ve read the whole thing. It’s a big book, a little over 540 pages, so it took me some time.
One of the coolest thing I like about this book is that almost all of the models can be built with either the NXT 1.0 and the NXT 2.0 kit. The only exception is the large robot arm at the end of the book. However, a detailed list of additional parts that you need is available, including some parts that may be substituted. I am sure that a skilled Lego builder would have no problems making a modified version of this arm. Another nice touch is that all the currently supported platforms (Windows, Linux and OSX) are discussed and instructions on how to set up and program your robot are available for all three OSes.
Synopsis
Section I of the the book starts off gently, with a small introduction and a quickstart. Chapters 2 and 3 discuss the hardware of the NXT such as the processor, and the way the brick can communicate with the world around it. The motors and the standard sensors are discussed, how they work and how the brick can use them to gather information from them. Chapter 3 briefly describes the function of the NXT’s firmware and how to interact with it through the menu.
Chapter 4 is a great help for people new to Technic Lego, also those who are migrating from the RCX platform and are not familiar with studless building techniques. There is a comprehensive list of the various Technic Lego pieces that come with the 1.0 and 2.0 kits as well as some additional ones, complete with their Peeron name!
Chapters 5 and 6 describe in great detail all the various aspects and workings of the BrixCC programming environment and the multitude of utilities that come with it. Everything you ever wanted to know and more! I’ve used BrixCC quite a bit in the past but I’ve also learned quite a few new handy tricks from these chapters. Definitely don’t skim or skip over these chapters, no matter how familiar you may think you are with BrixCC.
Chapters 7 and 8 introduce you to the actual programming languages with which you can instruct your NXT. What I thought was very cool was that not just NXC and NBC are discussed but also RICScript, a very nice language for drawing anything you like on the NXT’s screen. RICScript programs can be embedded in your NXC programs with great ease and their contents displayed. Chapter 7 highlights the various programming concepts you’ll need to make your NXC programs. The differences and similarities between NXC and its predecessor NQC are also outlined, another example of this book’s usefulness for those migrating from the RCX platform. Chapter 8 is great for the hardcore programmer. It covers advanced programming techniques using assembly (NBC).
Section II is where you will start doing some actual robot building and hone your programming skills. In Chapter 9 you build the basic robot that you expand on in the following chapters. Clear instructions with pictures tell you how to build it.
Chapter 10 deals with the NXT’s basic outputs. You add some extra bits to your robot and then it dives into some examples of programs that allow you to move the motors, make sounds and put stuff on the LCD screen using NXC and also NBC. Chapter 11 is like 10 only this time it deals with all the basic inputs such as the sensors that come with your NXT kit.
Chapters 12 and 13 pick up where the previous chapters left off. The inputs and outputs of the NXT are discussed in great detail. The reading and writing of files, various 3rd party sensors and how to communicate with BlueTooth. Even how to talk to your own home made sensor via I2C is explained.
In chapter 14 you get to make two cool games on your NXT, namely Tic-Tac-Toe and Pong. A friend of mine made the Pong game into a small console-like setup which is one of the most popular models at Mindstorms demonstrations.
People with two NXT bricks will love the project in chapter 15; you get to build a remote control for the robot you built earlier. It uses a feature called Direct Commands to control the robot via BlueTooth.
The final project in chapter 16, the big robot arm, is by far the coolest and most bad-ass looking project in the book. Here you will learn about a very cool technique called Inverse Kinetics (IK) to control your robot’s movements. IK is also use in industrial robots to precisely calculate and control their movements.
Conclusion
This is a great book and even if you’ve already been using NXC for a while, there is still a lot this book can teach you. The projects are fun to do and look great. If you’ve been using NXT-G for a while and are ready to take your programming skills to the next level, you’ll love the in-depth explanations of the various NXC language features. If you’re a hard-core NXC programmer and want to optimise your robots with snippets of ASM (NBC), this book will show you how.
Hi,
Thanks for the review. I own a copy of versio one of this book. Can you give me any information on how different the two books are and why someone who has the first book might consider getting the second one?
I don’t own the first edition so I am not sure I would be able to tell you, I’m afraid. I’ve asked John if he can let me know what the main differences are.
If you own the first edition of NXT Power Programming you will find the first few chapters are very similar. There are a number of updates to them, of course, for the NXT 2.0 set. The later chapters extend the original content by describing the new NXC and NXT 2.0 firmware capabilities for using floating point variables along with several of the recently added API functions such as FontTextOut, EllipseOut, and new HiTechnic sensor functions. Also you’ll find a complete description of the new support for the NXT 2.0 color sensor from LEGO.
With respect to completely new projects, the only one that made it into the book after editing for length is chapter 16 that Xander describes above. It has instructions for building a 2-degree of freedom SCARA arm and controlling it using inverse kinematic calculations and both continuous path and point-to-point movement.
John Hansen
I have the second edition and made the SCARA Robotic Arm and did all of the programming, but it will not compile. I have the 1.31 firmware. It keeps coming up with all of these errors.
Did you try asking on the Mindboards forums for help? John Hansen frequents those forums.
https://sourceforge.net/apps/phpbb/mindboards
Hello, I JUST got this set for Christmas! And I LOVE IT!!! I’ve been wanting to learn NBC/NXC! Too bad there’s only about two robots.
jojoguy10
I assume you mean “book” and not “set”? The book is far more about learning programming techniques than building actual robots. There are many books out there that cover building models but none like this book that cover the in-depth programming needed to advance beyond the basics.
Yes, I meant book. Oops! And I know that there are books out there for robots and some (like this one) are for programing, and some are for both! I’m going to be getting the LEGO Java book 1st edition soon!