Jim

LEGO Mindstorms Programming General Discussion

Recommended Posts

mindstorms_ev3.png LEGO Mindstorms Programming General Discussion

Welcome to the Mindstorms Programming topic. If you have any interesting information, tips, links or questions, put them here. I will update the Index of this post when new content is available.

After every topic I will describe which programming environment is used. For a detailed list of the most popular programming environments refer to the Mindstorms Index. The software TLG includes with the retail kit and can be bought separately for the education kit is called EV3-G or X3. I will use the term EV3-G from now on.

Pseudo means it's not specific for a certain programming environment. Is a generic article with coding examples and/or principles which apply to most environments.

Line following

NXTPrograms.com Line Follower (NXT-G)

PID Controller

Tip! Great tutorial on PID controllers (Pseudo)

Share this post


Link to post
Share on other sites

It'll be good to have a place for Mindstorms queries and tips.

I've been making some nice progress on a project but have found that the editor (for NXT v1.0) starts to get really slow and unweildy once the block count gets high (~50 plus).

I'm going to go through and define some custom blocks to cut down the clutter but are there any recommendations for more robust development environments (line by line/text based or graphical)?

:classic: :classic:

Edited by AussieJimbo

Share this post


Link to post
Share on other sites

You could take a look at the Mindstorms Index under Programming Environments.

I would recommend, BricxCC, LeJos or RobotC, depending on your skills. All three do rely on basic programming skills, so they are not graphical.

You could also try Microsoft's Robotic Studio, which is more graphical if I am not mistaken.

Share this post


Link to post
Share on other sites

I have not tried Microsoft's Robotic Studio but there is also MindSqualls

RobotC I found nice and easy to use, it did lack some BT samples ages ago but this is not a free product.

BrickCC is very similar I believe and FREE!

The interesting one is LeJOS because it works on a MAC, Windows, LINUX, is free, allows remote control, and was pretty easy to get working with Android devices.

This is the one I am now learning :)

Share this post


Link to post
Share on other sites

LeJos has some pretty good things. I really like the "sensor call back functions", which provide sensor feedback in a very nice way.

Maybe I will start using LeJos again, although RobotC is great as well.

Share this post


Link to post
Share on other sites

Nice, I just had a question. Maybe some of you can answer me this. I never used Mindstorms myself but plan on buying it the next year.

Can a Mindstorms robot read barcodes? I didn't mean large custom barcodes but actual small barcodes or QR-Codes. I want my robot to drive along several barcodes and stop him at the right one. In my mind there is a barcode reader attached to it (e.g. a smartphone) which communicates with the NXT Module. Is something like this possible? Or is it too much for Lego?

Thanks in advance for your answer. If you feel that this needs its own topic, feel free to seperate it. :classic:

Share this post


Link to post
Share on other sites

Having a USB port, I think the EV3 will support webcams and other cams better than NXT.

Maybe you are better of using QRCodes, or does it have to be a barcode?

Share this post


Link to post
Share on other sites

So you want your phone to read a QR code to control the NXT, if so yes if its an Android phone and NXT 2

Having a USB port, I think the EV3 will support webcams and other cams better than NXT.

Maybe you are better of using QRCodes, or does it have to be a barcode?

Fair point, I assumed NXT 2, but yes if its Ev3 then there will be more possibilities in the future!

Share this post


Link to post
Share on other sites

Thanks for the feedback, I'll check out some of those options.

> Can a Mindstorms robot read barcodes?

I don't think so, but you could use the light/colour sensor and different coloured tiles to identify your stopping points.

:classic: :classic:

Share this post


Link to post
Share on other sites

To answer your question; yes it's possible. The actual solution depends on how you connect your phone to your brick. Do you want to let the phone do the thinking (recognizing the right bar code etc) and just sending a "No, not this one" command to the brick. Or do you want to do the processing on the brick. Lot's of options.

Share this post


Link to post
Share on other sites

I want it to work. If it is easier when the phone does the thinking, I am totally okay with it. And yes, it would be EV3. Sounds good so far.

Share this post


Link to post
Share on other sites

> Can a Mindstorms robot read barcodes?

I don't think so, but you could use the light/colour sensor and different coloured tiles to identify your stopping points.

Using just the light sensor, you are probably right. Using extra hardware like a phone, it's possible.

Share this post


Link to post
Share on other sites

I don't think so, but you could use the light/colour sensor and different coloured tiles to identify your stopping points.

Thanks for your reply, but this is exactly what I do not want. I want him to read proper QR Codes...

Thanks again for your very quick answers. This makes me wanting that thing even more :grin:

Edited by PsyKater

Share this post


Link to post
Share on other sites

Brick: Drive to first position (using Mindstorms sensors and motors)

Brick: Tell phone "do your magic"

Phone: Make a picture, scan QR code etc

Phone: Tell brick to stop or proceed

Loop this until the right code has been found.

Looking forward to seeing this in action!! :sweet:

Share this post


Link to post
Share on other sites

Well, I have just yet installed the ev3 software and begon to learn how it works. I have two questions :

-how can I install 'gyroscopic sensor' block in the ev3 software (or other blocks from the educationnal version, or the nxt version)?

-how can I create my own blocks ? I have read somewhere on the net that there is a section called 'my blocks' to do that but I can't find it :/

Thanks for your help !

Edited by GuiliuG

Share this post


Link to post
Share on other sites

RE: reading QR codes. This might be able to do it: http://mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=78 . One of my students was looking into using an iPhone to do line follow work but didn't get very far with it. It was going to have regional visual sensing so it could correlate what it sees and where it sees it with its position and use this to decide which direction it would go (i.e. forward, backward, left or right using proportional steering).

On another note... the NXT (not sure about EV3) is based on LabVIEW and in LabVIEW you can do optical sensing. There is a good YouTube video on it but I didn't bookmark it and am struggling to find it again.

Edited by TasV

Share this post


Link to post
Share on other sites

You could take a look at the Mindstorms Index under Programming Environments.

I would recommend, BricxCC, LeJos or RobotC, depending on your skills. All three do rely on basic programming skills, so they are not graphical.

You could also try Microsoft's Robotic Studio, which is more graphical if I am not mistaken.

Don't forget simulink, it is graphical! http://www.mathworks.com/hardware-support/lego-mindstorms-simulink.html

Share this post


Link to post
Share on other sites

> -how can I create my own blocks ? I have read somewhere on the net that there is a section called 'my blocks' to do that but I can't find it :/

In NXT v1.0, you use Edit Menu -> Make a New My Block.

Then on the left hand side there is a set of tabs at the bottom of the Block Pallet, the right hand tab brings up your My Blocks.

I don't have EV3 but this might help you.

:classic: :classic:

Share this post


Link to post
Share on other sites

Ok ,thanks for your answer AussieJimbo, it's quite easy in fact to create his own blocks (was probably tired yesterday :p).

Share this post


Link to post
Share on other sites

Hello!

Does anybody programm ev3 set using Microsoft Robotics Developer Studio 4? I have spent a lot of time learning those VPL (Visual Programming Language) and have many projects done in MSRDS 4. How I can use them with my Mindstorms EV3 set? I found MSRDS 4 is rother convinient for developing robot control alorithms. Please, give any information or links on this topic.

Share this post


Link to post
Share on other sites

I haven't seen any information on this matter, which of course doesn't mean that people aren't testing this. I will do some research and let you know.

I guess MRDS should be made suitable for EV3 or the other way around, which might not be the case yet.

Share this post


Link to post
Share on other sites

Thanks for reply!

I'm searching all the day long since EV3 appears. And no use yet. MS Support is keeping quet about this, so Lego Support does, too.

I will be waiting for any news from you, thank you very much.

Share this post


Link to post
Share on other sites

I have added Monobrick to the Mindstorms Index. I will test this soon and write a small review.

Monobrick.dk

MonoBrick

MonoBrick is a LEGO Mindstorms communication library written in C# that works with both the EV3 and NXT. MonoBrick runs on a wide variety of operating systems including Linux, Mac OS and Windows. The library can communicate with the brick using either USB, Bluetooth or WiFi(only EV3). Furthermore it is also possible to communicate with the brick over the Internet using a tunnel connection. Tunnel communication is done using MonoBrick Tunnel or MonoBrick Tunnel for Android. Since MonoBrick works with both Monoand Microsoft’s.Net Framework it can be used with either Visual Studio or MonoDevelop/Xamarin Studio. Although most Windows users will prefer Visual Studio – MonoDevelop is definitely worth a try. For the EV3 and the NXT MonoBrick has the following features:

  • Communicates with the brick using USB, Bluetooth, WiFi or a tunnel connection
  • Works with Linux, Mac OS, Windows, Windows Phone and Android
  • Support for all LEGO sensors that comes with the Retail and Educational sets
  • Support for a wide range of Hitechnic sensors (not yet supported on the EV3)
  • Control the motors individual or as a vehicle
  • Use the mailbox system to send messages/data to the brick
  • Play tones and sound files
  • Use the file system to download and upload files
  • Start and stop on-brick programs
  • Use exceptions to catch sensor and communication errors
  • Open and close connections with multiple bricks
  • and more..

Share this post


Link to post
Share on other sites

Hello,

i'm working on a program to my Road System. (http://www.eurobrick...em#entry1497823)

My problem is in the "Wait"-block. When i want it to wait at "go"-signal, then there's a "!" in the corner of the icon, and i haven't any idea why?

BQVA8.png

The same is with the "!Rotation sensor" ?

W7bCJ.png

i do hope someone know what this is. I have to make the program work before LEGO Fan Weekend at friday. ;-)

Share this post


Link to post
Share on other sites

I moved your question to this topic.

I haven't used NXT-G mucht so I don't know the answer right away.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.