The new LEGO 9398 RockCrawler is out, and I really enjoyed how the designers chose to mount the motors directly on the pendular axles. Looking at it I realised that by replacing the power-function motors with NXT motors I could make the RockCrawler driven by the NXT. I had a new NXT2WIFI sensor from Dani Benedettelli and figured this would be the ideal chance to test it out.
The NXT2WIFI sensor creates an ad-hoc wifi network (named appropriately enough “NXT2WIFI”). It’s a simple matter of browsing for available wifi networks on my iPhone and then attaching to the NXT2WIFI access point. The NXT2WIFI has a built-in webserver that displays a simple control page. I used this default webpage as the control interface for the car.
It took me a few tries to get the NXT motors to match up to the RockCrawler axles. There is a lot of torque on the axles, and gears and liable to fly off if you don’t brace the construction rigidly. The steering motor simply slots into the center of the body frame. I had to shift the suspension mounts forward by a few technic holes to clear the bulky part of the NXT motor. This meant that the upper body construction doesn’t perfectly line up with the chassis – not too difficult to overcome that problem.
Amazingly the NXT slides perfectly into the rear cargo bay in the RockCrawler. It’s almost like they were made for each other! The drive motors are connected on A and B ports, and the steering motor is on port C. The NXT2WIFI connects to port 4, and is mounted inside the body frame.
I use leJOS to control the car. The leJOS program builds on my leJOS NXT2WIFI driver that is now part of the leJOS release SVN repository. The nice part is that there is no network initialisation – the NXT2WIFI creates an ad-hoc access point as soon as you turn it on! All I need to do is read the event codes sent by the NXT2WIFI in my leJOS code and convert that into motor commands. Simple!
You can download the code here.
See it in action!
Some pictures of the model as I’ve built it so far.