Showing posts with label NXTCamel. Show all posts
Showing posts with label NXTCamel. Show all posts

October 21, 2011

NXTCamel example

I wrote a matlab function checksystem.m to check whether all motors and sensors are working on NXTCamel as I expected (I didn't test the sound and touch sensor in the first version of the function). The program can be downloaded here. Before you running this program you should make sure:
  1. The RWTH Mindstorms NXT Toolbox for matlab is installed correctly and you could connect to NXT within matlab using bluetooth without any error.
  2. All sensors and motors are connected to the same ports as in the building instruction.
  3. The ultrasonic sensor is facing to the right. I define this as the default starting position.
  4. You have enough space (at least 2 by 2 meter) for NXTCamel to run.
If everything works fine, the output in Matlab should look like the following:

>> checksystem
Make sure the ultrasonic sensor faces to the right side before you start.
========Now test driving system========
Drive forward for 3 second. Press any key to start...
Drive backward for 3 second. Press any key to start...
Turn left. Press any key to start...
Turn right. Press any key to start...
Back and turn. Press any key to start...
Back and turn to the other direction. Press any key to start...
========Driving system test finished========
========Now test the sonar system========
Sweep sonar and measure the distance. Press any key to start...
========Sonar test finished========
Light intensity is 42.3%
========All test finished========

It will also plot the distance measured by the ultrasonic sensor in a polar plot like this:


Note that the NXTCamel by definition is always facing the 90 degree (12 o'clock) direction. The number 100, 200, 300 in the plot is the distance in centimeter. I measured 10 points here. One could in principle sample more points and get a better representation of the surrounding environment though it will be slower.  

This distance information is naive compared with those from Google car. Nevertheless it is enough to let NXTCamel drive without hitting obstacles. 

Update: 
Here is an example with a simple algorithm, and I am sure there is still lot of space for improvement. Please let me know if you get a better way.

September 30, 2011

NXTCamel

I spent almost a whole weekend to design and build this platform for my next project "c.elegans" and maybe other future projects. I named it as "NXTCamel" cause it looks bit like a camel with four long legs, and it can carry a lot!






The building instructions can be downloaded here. Some features of NXTCamel are:
  • All sensors are mounted and all motors are used. (Lego Mindstorms NXT 1.0)
  • It is like a car, two back wheels for driving, and two front wheels for controlling the direction.
  • All signal lines can be tightly attached to the body so they won't stuck to somewhere easily while moving around.
  • Ultrasonic sensor can rotate 360 degrees controlled by one motor to measure distance from any angle.
  • The body is flat, spacious and stable. I could easily mount for example a webcam or smart phone on it for more sophisticated projects. 
  • It consists altogether 187 pieces.