Robot playing Tetris on keyboard

Post your EV3 projects, project ideas, etc here!

Moderators: roger, gloomyandy, skoehler

Robot playing Tetris on keyboard

Postby Moriloke » Fri Dec 13, 2013 12:14 pm

Hello everyone !

I was looking for some solutions to make my school project doable, and well, leJOS seems to be an answer to my needs ! (And we're totaly new to the LEGO robotic world :D)

Let me explain what it consists of :

We are to program a Tetris Game, and then make a LEGO Ev3 that can play. The Tetris game will be launched on a first computer, playable through the keyboard, then we will place the LEGO machine on the keyboard so that it can play.
We will develop an AI that "solves" the Tetris, capturing the game screen via webcam, analysing it and making the 'best' choice possible. And we want to communicate with the mindstorm to give it orders each time a decision is made.

The Tetris, and AI parts are not really a problem. The vision part is a little more touchy since we never tried before, but nothing impossible i guess.
Now, the robot part... Well, creating a pattern so that lego can press keyboard keys is a challenge, but not the main problem.
The problem is that the LEGO bot cannot receive any transmission other than from the infrared remote control.

But leJOS seems to be able to give us the means to do differently !
If I'm not mistaken, and i've understood what I read about it, it would allow us to discuss with the ev3 while it's running through Wi-fi (doing polling on the wifi receiver would be sufficient for our needs) ? (I'm not sure about through USB, is it possible ? It would probably be easier for us, as we wouldn't have to search for and buy a wifi dongle and configure a connection)

So, I guess I'll update this post from time to time, as the project evolves :)
And if you have warnings/recommandations to do, please feel free to share ! I'd be glad to have your guidance :) (Mainly about the wifi dongle, since I know nothing of it yet, except regarding the model since it's written in the wiki)

Have a nice day !
Moriloke
New User
 
Posts: 4
Joined: Fri Dec 13, 2013 11:46 am
Location: France

Re: Robot playing Tetris on keyboard

Postby gloomyandy » Fri Dec 13, 2013 12:49 pm

Hi,
interesting project. A couple of points:
1. Please remember that the EV3 version of leJOS is still very new and is under very heavy development so is changing fast. I would not really recommend that you use this version of leJOS for critical projects unless you are happy to deal with issues that may come up. There is no guarantee that the leJOS code will work for you and the leJOS team may not be able to help you to quickly resolve any problems that you encounter.
2. I'm a little confused in that you say that you are only allowed to talk to the EV3 using the infra red remote, but you are proposing to use a WiFi or USB connection to control the robot. This does not seem to make sense to me?

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4184
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Robot playing Tetris on keyboard

Postby Moriloke » Fri Dec 13, 2013 2:13 pm

Thanks for your answer.

I kind of formulated my problem in a weird way I guess.
It's the LEGO software that indicated me that the robot could only respond to extern signals via the infrared remote if it was not for the existence of leJOS, or overriding the lego os ourselves.
And since we can't use that in our project, we want to replace this by communicating via USB / Wi Fi.

As for the fact that the EV3 version of leJOS is quickly evolving, well, it's not really like our project is really critical (as long as we put all the effort we can in it), and we've taken this risk into account. We'll be doing our kick-off meeting on Tuesday, and have a back up solution (even though simulating the keyboard is really not as cool as the EV3 playing on a keyboard).
We have until mid-March to finish it, so it's almost plenty of time for us to try to make it work :D
Moriloke
New User
 
Posts: 4
Joined: Fri Dec 13, 2013 11:46 am
Location: France

Re: Robot playing Tetris on keyboard

Postby gloomyandy » Fri Dec 13, 2013 3:03 pm

Hi,
Ok that make sense. Just wanted to make sure youe are aware of the possible risks of using leJOS with your project.

Good luck

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4184
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Robot playing Tetris on keyboard

Postby Moriloke » Sat Feb 01, 2014 3:14 pm

Hi, I'm finally back !

Didn't have the opportunity to work as much as I wanted on this project...

So here I am, after working on different parts of the project, to try to work with leJOS.
I followed every step of the wiki to get started, and I'm facing a little problem that saddens me as I can't find why it happens.
I properly installed the bootable SD Card (through Windows), bought a nice WiFi Dongle (NetGear WNA1100), plugged it in, and... Tried to connect to my WiFi network.
Sadly, EV3 does not find even 1 access point ! (Even though there are at least 12 detected when using this same dongle on my laptop).
Any idea on why it doesn't work (like I need to install a additionnal driver on the EV3 sd card) ? I didn't find any answer on the forums yet.

Thanks for your time.
Moriloke
New User
 
Posts: 4
Joined: Fri Dec 13, 2013 11:46 am
Location: France

Re: Robot playing Tetris on keyboard

Postby Moriloke » Tue Feb 04, 2014 12:20 pm

Hi everyone,

A update just to say that I did not resolve the problem, but I tried something else that works : connection via USB.
Recuired installing a RNDIS driver, but nothing hard.
Could compile code, send it to the EV3.
Tried to work with Motors, nothing really complicated given what I have to do with them.

Now I have to work out how to acquire orders through SSH with JAVA since I never tried it :)
Need to pass via SSH simple orders (only 4 orders, one for each key that can be pressed by the bot), one char would be enough.
I just need to find out how to acquire this data through the ssh tunnel !

Have a nice day !
Moriloke
New User
 
Posts: 4
Joined: Fri Dec 13, 2013 11:46 am
Location: France


Return to EV3 Projects

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff