Sunday, August 30, 2009

What's the difference - NXT-G 2.0 Image Formats

The LEGO MINDSTORMS NXT-G 2.0 software allows users to easily open, edit, and save images in a variety of formats, but what is the difference between formats? Why does it matter if I save an image as a .jpg file instead of a .ric file? Prepare to be enlightened...

(If you are just interested in the straight forward facts, skip down to the conclusion of this post)

First of all, no matter which format you save images as through NXT-G 2.0, the result will almost be the same! Only differences in the size of the file may effect a common computer user - have a look at the table below...


(On this table "Empty Image" means I didn't add anything to the image before saving, and "Full Image means I completely blackened my image before saving - all images saved using the Image Editor in NXT-G 2.0)


As you can see, .bmp images are the largest files at 19.8 Kilobytes (kb), and .jpg files are the smallest size at only 742 bytes! However, every image file except .jpg files have a constant size, for as you can see from my table, only the .jpg file changes in size between a full and empty image. Interestingly enough, .jpg files change in size depending on where the blackened areas are in the image, causing the .jpg file size to alter from around 741 bytes to around 2.5 Kilobytes. But considering how much disk space our computers have, who needs to worry!



Note: These image sizes are for images on a Windows XP
computer
. The size of an image on the NXT is 0.9
Kilobytes (around 900 bytes).


The NXT only displays .ric files, and any imported image will need to be saved as a .ric file before you can use it on the NXT. Once saved as a .ric file, you can use your image through a Display Block:


Note: All images saved through NXT-G 2.0 will be saved to the folder:

C:\Program Files\LEGO
Software
\
LEGO MINDSTORMS NXT\engine\Pictures

where the red writing represemts where you installed NXT-G 2.0 to if you changed any settings during installation.

All images created in the NXT-G 2.0 Image Editor have 100 x 64 pixel dimensions (width by height)

What should I use on my computer?

The .ric files are only useful for users downloading them to their NXT brick. What happens if you want to see what image you are downloading beforehand? You internet browser does not support viewing .ric files, so that leaves .jpg, .png, and .bmp files - which is best? The image file size table shown at the beginning of this post outlined the... file sizes, but what about other differences? Here are some other facts about using images on your computer:

JPG/JPEG
* Use on: Photographs, Realistic Drawings
* Bad results on: Line and Letter Drawings
* Loses detail after every edit - becomes more blurred (check it out using MS paint or similar - on large images, as the .ric files do not show this effect))

PNG
* Use on: Line and Letter Drawings, Clipart, Computer Image Scans (E.g. When using an external scanner to load a piece of paper onto your computer)
* Bad results on: Photographs, Full colour images
* Doesn't lose detail after every edit

All of the above files formats are easily distibuted on the internet as well, as every internet browser can view them.

BMP
* Larger Files

RIC
* NXT-only file, distribute only to other NXT-G 2.0 users, or users with other software supporting .ric files (more to come on this)
* Web browsers will not view them - require download and import into NXT-G 2.0 or other supportive software

More info can be found on the web, a good, simple, but helpful website can be found here:

http://toolkit.crispen.org/formats/index.html

So, in conclusion:

* The NXT can only display .ric images
* No image viewers support .ric files - including internet browsers
* Once an image is saved as a .ric file through the NXT-G 2.0 Image Editor, it can be displayed on the NXT using a Display Block
* Images saved using the NXT-G 2.0 Image Editor can be located on your computer under the LEGO MINDSTORMS NXT\engine\Pictures directory where you installed NXT-G 2.0
* Images created in the NXT-G 2.0 Image Editor have 100 x 64 pixel dimensions
* On the XXT brick, .ric files are about 900 bytes in size

* On your computer, .JPG files have the smallest image size, and .bmp has the largest file size
* Saving an image used on the NXT as any other image file type will not change the content of the picture
* For big images on your computer, .jpg files should be photographs, and png pictures should be text and line drawings
* .JPG files with large dimensions will lose detail and become blurred after every saved edit

Saturday, August 29, 2009

Interger Blocks in NXT-G 2.0

Steve Hassenplug over at TeamHassenplug.org has found a solution to using Interger programming blocks from NXT-G 1.x software in the new NXT-G 2.0 software. NXT-G 2.0 uses Floating Point math blocks unlike previous versions of the software, however Interger blocks are also installed but not available in the programming palletes. First of all, Whats the difference?.. Read On:

Interger Calculations

- E.g. 5, 10, 100, 5567

- Round Number results

- No decimal points

- NXT-G 1.0/1.1


Floating Point Calculations

- E.g. 5.97667, 9547.9767,

- Decimal points

- Large numbers that cannot be represented as intergers

- NXT-G 2.0

Quoting TeamHassenplug:

To add them (Interger Maths Blocks) to a pallet, simply create an empty file in the BlockRegistry directory, in the pallet sub-directory, with the name of the block and a .txt extension.


Ex: [LEGO MINDSTORMS
directory]\engine\EditorVIs\BlockRegistry\Data\Numeric Operations.txt


The list of available blocks is located in: [LEGO MINDSTORMS
directory]\engine\vi.lib\LEGO\Blocks


--> Steve Hassenplug's Solution

Thursday, August 20, 2009

LEGO Education Constructopedia

Hey all, for those of us who are interested in the mechanical design behind some of the great LEGO creations that have appeared throughout the year, and if you have not already done so, check out the LEGO Education Constructopedia. There are some great diagrams and explanations on simple ways we can improve our design skills with the use of gears and pulleys, including compound gearing, changing pully direction and speed, idler gears, and a few other topics which create the 11 pages of engineering tips and tricks.

Saturday, August 15, 2009

LEGO MINDSTORMS NXT-G 2.0 - Remote Control

One of the final new additions to NXT-G 2.0 is the internal Remote Control, lets have a look...


Preliminary Actions


Run NXT-G 2.0


The Remote Control


The Remote Control can be located under the 'Tools/Remote Control...' menu in the software package.

Click on this menu option to run the Remote Control. You will know it is loading if the image on the left appears in the middle of your screen.




This window will appear - welcome to the Remote Control!

Click on the "Connetions" button to connect a NXT brick to the remote:


To control your robot, either press the buttons shown on-screen or press the corresponding buttons on your computer's keyboard. To change the speed of the movement motors, use the speed bar on the right of the Remote Control window, '+' will increase the speed, and '-' will decrease it.



Clicking on "Configure" will allow you to specify which motor ports will move the robot, the direction that the movement motors and action motor will rotate, as well as the power of the action motor.



Note that turning left or right will power BOTH the movement motors, while pressing 'Up' or 'Down' will power one of the movement motors. Therefore, the internal remote control in NXT-G 2.0 is best used for cars and other vehicles.


Lastly, you can run a program on the NXT brick while controling the robot from the Remote Control window!

Tuesday, August 4, 2009

Project: Lunar Mineral Sorter (LMS) - Static

This year hosted the celebration of the first moon landing on the 20th July 1969, as well as the release of NXT 2.0 on the 1st August 2009! The LMS (Lunar Mineral Sorter) - Static Edition combines these two events into one NXTLog project buildable using one NXT 2.0 kit!To enhance the collection of available knowledge findable on the Moon, the LMS - SE was designed. once launched from the base shuttle, this stationary robot searches for minerals/rock samples (it can rotate up to 90 degrees left or right), lowers a mechanical arm and grabs the object, followed by scanning the object using the colour sensor to check if it is the object wanted by scientists back on Earth. If so, it is collected, and further objects are searched for. The LMS - SE can collect and hold up to 3 rock samples (aka: zamor balls).

Improvements
--------------------------

* Add a counter-weight onto the claw/grabber
* Possibly reduce the weight of the claw

More information, including CAD and Program files, will be added on the NXTLog page for this project over the next few weeks!

http://mindstorms.lego.com/nxtlog/ProjectDisplay.aspx?id=9ae21e33-e40d-4250-bc99-c24e02b5d7c0

NXTasy Forum Discussion
http://forums.nxtasy.org/index.php?showtopic=4051