quinta-feira, 17 de outubro de 2013

Creating a bootable SD card for Mindstorms EV3

Este post é um relatório de aula. Ele foi primeiramente publicado em um blog restrito a sala de aula desse curso no sistema Blackboard Learn. Disponibilizei esse material aqui para fins de compartilhamento de informação.

In order to program LEGO Mindstorms with Java, we need to do several steps. One of them is create a bootable SD Card. Why do we need a bootable SD Card? We need it because the robot will start through the SD Card. The SD card will contain Java SE Embedded Virtual Machine (JVM) and the leJOS classes.

The first requirement is:  Linux Operational System, more specifically Ubuntu(12.10 is more recommended) . You can use Ubuntu in a Virtual Machine, for example using Virtual Box. I'm using Ubuntu as my second Operational System. I chose it because I'm going to deal with hardware interaction such as SD Card, wireless. For these reasons I chose to run Linux beside Windows.

After that, you have to download leJOS for Mindstorms EV3. The followed link will show some folder with different versions:

http://sourceforge.net/projects/lejos/files/lejos-EV3/

I chose the newest one: http://sourceforge.net/projects/lejos/files/lejos-EV3/0.4.0-alpha/

Download the file lejosimage.bz2 to your Ubuntu. Unpack the file. It will create a folder called lejosimage.


Next, download Java SE Embedded JVM on http://www.oracle.com/technetwork/java/embedded/downloads/javase/javaseemeddedev3-1982511.html and copy the downloaded tar file to lejosimage directory.


Next, execute the file format_sdcard.sh into the terminal. You only have to follow the instructions given on terminal.


It will ask to make sure the card is not inserted. Then, it will ask the insert the card. Later, it will ask to type the system's password, and then will ask to type something like "sdb" or maybe "sda". It asked me "sdb". Finally, it will ask to remove the card. These steps are simple. Just read the instructions given carefully.

The next step is run the file update_sdcard.sh on terminal. It will ask the password, and then it will get your card ready.







Getting started with JAVA + Mindstorms EV3

Este post é um relatório de aula. Ele foi primeiramente publicado em um blog restrito a sala de aula desse curso no sistema Blackboard Learn. Disponibilizei esse material aqui para fins de compartilhamento de informação.

Getting started with JAVA + Mindstorms EV3 

We got started with our research about how to program LEGO Mindstorms with Java. At first time, we found the following link:
It is about leJOS which is a firmware replacement for Lego Mindstorms programmable bricks. This article tells us about how Mindstorms works, and how to install and configure it in your computer.
Later, we figured out that this article and leJOS was developed for previous versions of Mindstorms once EV3 had not being created yet. Despite of all, there is a leJOS plug-in for Eclipse IDE on leJOS website. We still don’t know if this plug-in works with EV3. We tried to configure it, and it didn’t work.  Bellow follows the link to leJOS:
Additionally, leJOS is open-source. You can download and find information about it on:http://sourceforge.net/projects/lejos/.
On Source Forge website, we found some information about how to use leJOS with EV3. These materials are still in development because EV3 was just released. Follows the link:http://sourceforge.net/p/lejos/wiki/Getting%20started%20with%20leJOS%20EV3/
We also found a blog that looks interesting for us. It talks specifically about how to work with leJOS + Java + EV3. Now, we are going to focus our research and effort on the following links and` on the above link as well.

Assembly of Everstorm model

Este post é um relatório de aula. Ele foi primeiramente publicado em um blog restrito a sala de aula desse curso no sistema Blackboard Learn. Disponibilizei esse material aqui para fins de compartilhamento de informação.

Assembly of Everstorm model 

We dismounted the Tracker Model because we wanted to build the EverStorm model which contains arms and legs. The fact of it has arms and legs, makes the development more interesting once we have more features to work with.
We have searched a lot on the internet the assembly-manual of the Everstorm model, but we weren't able to find. We believe we couldn't find the Everstorm's manual because the LEGO EV3 is new on the marketing, for that we believe we couldn't find it. However, we download the software LEGO Mindstorms EV3, and we found the manual in this program's files. Bellow follows the location of the Everstorm model manual: 
C:\Program Files (x86)\LEGO Software\LEGO MINDSTORMS EV3 Home Edition\Resources\ContentPacks\Retail\nonlocalized\LEGO\pack2\project

Another way to find the manuals is by using the software. There you can choose your robot model, then get started.














Assembly of the standard model

Este post é um relatório de aula. Ele foi primeiramente publicado em um blog restrito a sala de aula desse curso no sistema Blackboard Learn. Disponibilizei esse material aqui para fins de compartilhamento de informação.

Assembly of the standard model


In the first day with the new material, we assembly the standard model of the "Lego mindstorm kit". It is called tracker, and its factory settings are: move ahead and back, and spin a propeller. This functions can be controlled by a remote control that is included in the kit.

        







The robot works with 6 AA batteries, plus 2 AAA in the remote control.

sábado, 14 de setembro de 2013

Lego Mindstorms - montando um robô

Ontem na aula de Java para Robôs, começamos a montar nossos robôs. A faculdade ofereceu para a classe alguns materiais como AR.Drone 2.0, Arduino, Raspberry Pi, e Lego Mindstorms. Os alunos estavam trabalhando em grupos ou duplas. Eu fiz dupla com a Andressa Oliveira(Fatec Presidente Prudente). Nós ficamos com o Lego Mindstorms. 

O Lego Mindstorms já é utilizado em algumas escolas particulares de nível fundamental no Brasil. Ele com certeza não é o que o mercado tem de mais avançado, afinal ele é um robo para introdução a robótica, mas não deixa de ser interessante. Ele é programável, tem portas USB e SD-card. Ele pode ser montado em N layouts diferentes. Nós montamos o modelo Tracker, que veio no manual.

Abaixo segue um vídeo e fotos tirados em aula:

Execusão por controle remoto(Hebert(Fatec São Bernardo)


















sexta-feira, 30 de agosto de 2013

Robocode - batalha de robôs

Hoje na  minha ITP 295(Java para robôs), o professor Edward Delean nos apresentou o Robocode. Robocode é um jogo de programação, onde o objetivo é construir robôs, modelo tanque de guerra, para lutar contra outros. Quando você instala, já vem alguns robôs de exemplo. Estamos utilizando a versão para programar em Java.

Para instalar basta entrar em http://robocode.sourceforge.net/download. Para o jogo rodar você precisa ter Java SE instalado: http://www.oracle.com/technetwork/java/javase/downloads/index.html.

A instalação é simples. É só seguir as instruções do próprio instalador.


Quando instalado, a primeira tela será essa:


Então você pode ir no menu Battle/New e terá a seguinte tela:


Nessa tela você terá um lista de pacotes(packages) e robôs(robots) daquele pacote selecionado .Então você adiciona os robôs que quiser na batalha, e clica no botão Start Battle. Quando você criar seus robôs e pacotes, eles serão listados nessa tela.

Aqui uma imagem da batalha:



Também temos o menu Robot/Editor. Isso irá abrir outra janela. Então na nova janela você seleciona o menu File/New/Robot. Isso irá criar uma classe com o nome que você definiu, e dentro do pacote que você criou. Essa classe por definição irá herdar da classe Robot. Sua classe virá com comandos pré-definidos, então você altera o comportamento do seu robô ao seu critério e lógica. Você sempre deve compilar sua classe para que o robô esteja disponível na listagem, ou para atualizar as modificações.

Meu robô se chama Robotec, e está no pacote fatec.robots. Veja imagem abaixo:


Abaixo segue todo o código que vem por padrão:

package fatec.robots;
import robocode.*;
//import java.awt.Color;

// API help : http://robocode.sourceforge.net/docs/robocode/robocode/Robot.html

/**
 * Robotec - a robot by (your name here)
 */
public class Robotec extends Robot
{
/**
* run: Robotec's default behavior
*/
public void run() {
// Initialization of the robot should be put here

// After trying out your robot, try uncommenting the import at the top,
// and the next line:

// setColors(Color.red,Color.blue,Color.green); // body,gun,radar

// Robot main loop
while(true) {
// Replace the next 4 lines with any behavior you would like
ahead(100);
turnGunRight(360);
back(100);
turnGunRight(360);
}
}

/**
* onScannedRobot: What to do when you see another robot
*/
public void onScannedRobot(ScannedRobotEvent e) {
// Replace the next line with any behavior you would like
fire(1);
}

/**
* onHitByBullet: What to do when you're hit by a bullet
*/
public void onHitByBullet(HitByBulletEvent e) {
// Replace the next line with any behavior you would like
back(10);
}
/**
* onHitWall: What to do when you hit a wall
*/
public void onHitWall(HitWallEvent e) {
// Replace the next line with any behavior you would like
back(20);
}
}


Você pode achar todas as classes, métodos, implementações no seguinte link: http://robocode.sourceforge.net/docs/robocode/

Espero que tenham gostado! Eu ainda não estou muito familiarizado com Robocodes, mas o pouco que utilizei achei bem interessante. Logo mais escrevo mais sobre isso!








terça-feira, 27 de agosto de 2013

Laboratório de Informática

Estou tendo aulas programação na NOVA (campus Alexandria). Eles possuem uma estrutura bacana de máquinas. São máquinas da Apple, com dois sistemas operacionais: o sistema da Apple, e o Windows da Microsoft. Segue algumas fotos: