This application is very similar to the ColorTracker but instead of colors it tracks flames.
To link the wiimote to your computer you just have to have the bluetooth on and press 1 & 2 buttons.
It has some vertical lines, the white ones represent the x center of the flames and the other two, x min and x max, which are blue, divide the image in three parts. If the white lines are on the left part the application gives the robot an order to turn left and if they are on the right part it should turn right.
There are one other horizontal line, the y center of the flame which is white. The flame is represented by a yellow circle. If it is between the x min and x max lines the robot goes foward.
The blue lines can be adjusted using the correspondent sliders.
The serial commands (w,s,a,d and g) can be sent at a 4800 baud to the COM port specified on the text field, you just to write it there and press ENTER (example: "COM5").
The wiimote is a really cool controller to use with your robots. It has many buttons, accelerometers and even a camera which tells the coordinates of the four principal IR emitters that it sees.
There are many examples of applications using it, some of the most populars are from Johnny Chung Lee. But there are much more, just search for "wiimote" or "wiimote robot" on youtube or google. On LMR there are some examples too:
If they work, you can pass to the next step, the serial communication with your robot.
The application MyFirstWii is really easy to adapt.
All you have to do is to import the serial library, create a serial object, define the COM port & the baud rate and add the serial communication where the data about the buttons is analyzed. Here is an example:
import processing.serial.*;
import lll.wrj4P5.*;
Wrj4P5 wii;
Serial TheBox;
void setup() {
size(300,300,P3D);
wii=new Wrj4P5(this);
wii.connect();
TheBox = new Serial(this, "COM5", 4800);
}
void draw() {
background(0);
stroke(255);
translate(300/2,300/2,0);
lights();
rotateX((int) (wii.rimokon.senced.x*30+300));
rotateY((int) (wii.rimokon.senced.y*30+300));
rotateZ((int) (wii.rimokon.senced.z*30+300));
box(100,100,100);
}
void buttonPressed(RimokonEvent evt, int rid) {
if (evt.wasPressed(RimokonEvent.TWO)) println("2");
if (evt.wasPressed(RimokonEvent.ONE)) println("1");
if (evt.wasPressed(RimokonEvent.B)) {
println("B");
TheBox.write('g');
}
if (evt.wasPressed(RimokonEvent.A)) println("A");
if (evt.wasPressed(RimokonEvent.MINUS)) println("Minus");
if (evt.wasPressed(RimokonEvent.HOME)) println("Home");
if (evt.wasPressed(RimokonEvent.LEFT)){
println("Left");
TheBox.write('a');
}
if (evt.wasPressed(RimokonEvent.RIGHT)){
println("Right");
TheBox.write('d');
}
if (evt.wasPressed(RimokonEvent.DOWN)){
println("Down");
TheBox.write('s');
}
if (evt.wasPressed(RimokonEvent.UP)){
println("Up");
TheBox.write('w');
}
if (evt.wasPressed(RimokonEvent.PLUS)) println("Plus");
They are supposed to remote control a robot with two motors.
To make them work with yours you'll only have to do the following: - First of all you'll have to have both computers connected on a wirelless network. If you don't have any you can create an computer-to-computer network like it is explained on this site: http://www.cs.washington.edu/research/edtech/presenter/doc/adhoc.html.
- Open your board correspondent Firmata, change the highlighted areas and upload it
- Open SimpleServer.pde on your controller computer and run it.
- Open SimpleClient.pde on the computer connected to your board, change the highlighted areas (COM port and server IP) and run it.
They work like this:
When you press one key (UP, DOWN, LEFT, RIGHT or S) on your controller computer keyboard, the server application analyzes, shows the arrows images and sends the correspondent letter (w, s, a, d or g) to the client application that analyzes, shows the arrows images and re-sends the letter to the arduino or the picaxe board which analyzes again and do whatever you wrote on the highlighted areas of the Firmata.
This application is very similar to the ColorTracker but instead of colors it tracks faces.
It has three vertical lines, the yellow one represents the x center of the face and the other two, x min and x max, which are red, divide the image in three parts. If the yellow line is on the left part the application gives the robot an order to turn left and if it is on the right part it should turn right.
There are other two horizontal lines, y max which is red and the y center of the face which is yellow. So, if the blob is between the x min and x max lines and it's above the y max the robot goes backward, if it's below the line it goes foward.
All those red lines can also be adjusted using the correspondent sliders.
The serial commands (w,s,a,d and g) can be sent at a 4800 baud to the COM port specified on the text field, you just to write it there and press ENTER (example: "COM5").
Description: This application finds a color specified on the sliders and tracks it.
It has three vertical lines, the yellow one represents the center of the blob and the other two, x min and x max, which are red, divide the image in three parts. If the yellow line is on the left part the application gives the robot an order to turn left and if it is on the right part it should turn right. There are other two horizontal lines, y max which is red and the y center of the blob which is yellow. So, if the blob is between the x min and x max lines and it's above the y max the robot goes backward, if it's below the line it goes foward.
All those red lines can also be adjusted using the correspondent sliders.
The serial commands (w,s,a,d and g) can be sent at a 4800 baud to the COM port specified on the text field, you just to write it there and press ENTER (example: "COM5").
Movie from a previous version with the robot TheBox:
We've started building it last Saturday and here are the first movies and photos.
The tracks are really good and easy to make, they just take a lot of pacience.
It uses two 15€ drills' motors, but instead of an metal chassis our has a wooden one.
We use a netbook on the robot just as Calex64 uses on hisPROTOS III to reduce the costs and to facilitate the comunications.
On the controller PC we have a processing application that sends an information of a key we press over an ad hoc wireless network, on the robot PC we have an other application that intrepretates the information and sends it to the arduino that decides what command gives to the servos witch move the switches that control the motors.
Navigate arround being remote controlled by someone on another computer
Output Devices:
2 Servos
2 DC Motors
Microcontrollers:
PICAXE 28x1 - AXE020 - For the Servos
PICAXE 28x1 - Botn 'Roll ONE - For the motors
Power Sources:
7,2 V Battery Pack for the Botn 'Roll ONE
4 AA Batteries for the AXE020
4 AA Batteries for the Servos
It was basically formed by two 28x1 that are serial controlled by a processing application, one for the motors and other for the two servos of the Pan&Tilt system
It could be remotely controlled by Remote Assistance of Windows Live Messenger, as it is shown in the video.
It was very easy to build, I just needed to learn the basics of processing.
The application I made sends E,D,S,D to the servos Picaxe when these keys are pressed and X,W,Y,Z to the motors picaxe when the direction keys are pressed.