woensdag 15 juni 2011

Finalizing the code

The three tactics have been thoroughly tested and found to be working individually (see other video's). However untill the very last moment, problems had to be overcome with the camera. Sending coordinates proved not to be robust and with limited available test time, it didn't help that the earth computer stalled every two or three tries. If the camera is fully operational tomorrow, we hope to be able to show the tactics working together in a single program, and to find all the lakes within a reasonable timespan!

Tactics part 3

Goal
- Measure lake temperature

Tactics
- When mars rover is not standing above a lake the mars rover drives in a straight line until lake is found with one of the light sensors
- When lake is found the measuring device is let down. If the device hits mars instead of the lake the touch sensor (seen the picture below) is not pressed and the measurement is neglected. The rover will than turn a certain amound of degrees and try again until touch sensor is pressed and measurement is valid.
- Temperature is sent to earth computer
- Turn to tactics part 1



Execution:
Tactics part 3 has been tested as can be seen in the movie below.



Tactics part 2

Goal:

- Drive to lake

Tactics
- Transform camera coordinates to mars coordinates 
- Plan path to lake using map (straight if no edge detected)
- Drive to lake, approaching up to 30 cm. 
- Use camera to position marsrover straight in front of lake, turn to tactics part 3 (also when no coordinates received)

Execution:
Transforming the camera coordinates to lake coordinates was enough to crash the brick time after time. The transformation of the coordinates and the path planning exist in code form but have never been tested due to the crashing. We decided to comment this part and first make sure tactics part 1 and 3 would work properly.
Tactics part 2 now turns the rover in such a way that it is standing straight in front of the lake and than turns to tactics part 3. This has been tested. All intelligence is turned off for now, we hope to be able to use it in the end, but priority is now to get it to work as simple as possible.

Tactics part 1

Goal:
- Find coordinates

Tactics
- The mars-rover turns 360 degree searching for lake coordinates. (Turn certain amount of degree, waits for coordinates, if no coordinates received turn again certain amount of degree with maximum total of 360 degree).
- If no coordinates are found after turning 360 degree the marsrover drives a random distance and again starts turning and searhing for coordinates,
- If during turning coordinates are received the software turns to tactics part 2.
- If during random driving a lake is found the software turns to tactics part 3.


Execution:
Tactics part one is created and tested. It works fine.

Moving on Lightsensors

Due to our extended calibration file we were able to move quite well on the lightsensors. However, during testing on mars, especially at lower light intensities, moving on the lightsensors seemed to be not robust enough. Updating the tresholds during driving was necassary.

New method:
During calibration ten measurements are performed (per sensor) and stored in an array. A new measurement is now compared to the average of this array. If the new measurement doesn't differ much the robot concludes that it is probable on mars and the new measurement is stored in the array. In this way the array is completely renewed every ten measurements, allowing the surface to vary.

zaterdag 11 juni 2011

Presentation and line tracker contest

Last friday we did succesfully our presentation about the mission to mars contest. The slides can be found here.

The line tracker contest didn't went that well. In the morning, during testing, the tracker worked fine. But the focus will now be totally on the mars mission!

donderdag 9 juni 2011

Earth communication

Since multiple groups are still struggling to achieve communication with the earth computer we decided to release our code which allows communication with the earth station. The code consist of the comm.c library with some modifications to make everything work smoothly and the camera.c which consists of a function which sends a temperature to earth and reads the camera. In order for the code to work, cam_x and cam_y should be initialized as integers thread id's need to be created and communication should be initialized the same way as usual. The files are listed below:

http://dl.dropbox.com/u/15883361/camera.c
http://dl.dropbox.com/u/15883361/com.c

Camera to coordinates

Yesterday we started working on translating the position of a lake in pixel on the camera to the x-y position of the lake with respect to the rover. Instead of the usual approach of using the camera position and goniometrics to derive the coordinates, we decided to create a lookup table to transform the camera output to coordinates. Below is a picture of what the camera sees with a grid superimposed on top. The nodes of the grid have certain pixel coordinates, and corresponding "real world coordinates". Using this data we created a lookup table and fitted parabolic functions in matlab to describe the camera's field of view for each "real world coordinate". By transforming the lookup tables into parabolic functions we avoid using vast amounts of memory for storage.


Below are the surface plots with on x and y the camera output in pixels and in z the corresponding distance in x & y in mm.

woensdag 8 juni 2011

Presentation / pictures Mars Rover.

Today we made the first version of the presentation for friday about our Mars Rover.

We also want to show how our linetracker and mars rover looks like up till now, see understanding pictures respectivily left and right. The camera standard has already been made but is not attached in this picture. Furthermore one can see that there is a fancy spoiler on our linetracker and mars rover ;-).


Motor controllers finished

The motor controllers have been working for about two weeks now, however the blogging had a little delay. There used to be a problem with reversing the direction and the problem was found to be in the abs() function. This function returned an int, while floats were required for the controller calculation. The robot drives in a straight line with input values a speed and a reference distance in mm and it is able to turn with input variables angle in degrees, turn speed and direction.

Smart driving using the map

Keeping track of edges on mars makes it possible to do smart path planning. Once the robot has received lake coordinates from the camera, it will check if a straight line towards the lake is possible. If there are known obstacles on the way, a new path is planned, avoiding the obstacle. Of course the map is completely empty at the start, so it might occur that the robot finds an edge on its way. This is then added on the map and a new path is planned, avoiding this edge too.

Finishing the linetracker

Yesterday the linetracker was finished. It will now beep before and directly after the measurement. Furthermore, our beautiful calibration file is removed, because we are not allowed to calibrate 10 seconds before the competition.

maandag 6 juni 2011

Problem sending lake coordinates to brick solved

Last week, just before the holidays, we were succesfull in the final attempt! We had to change the com.c file to be succesfull. A semaphore was created so that two functions cannot do their job at the same time: receiving the coordinates values and writing them in to the memory. Today we checked if our success wasn't a one time lucky shot and luckily it wasn't! Further programming was done to save these coordinates so that our 'tactics department' can test with these coordinates.