Date: 19-04-12
Duration: 3 hours
Group members attending: Tore, Troels & Kristian
Goal
Complete today’s exercises, that is experiment with navigation.
Plan
1. Implement and test the given test-program from the exercises (*1).
2. Implement a program that has the robot follow a route while avoiding obstacles.
Execution
1.
We used the same car, we have used for weeks now, but detached the sensors:
The wheel diameter is 5.6 cm and the distance between the wheels is 17.1 cm.
We detached a whiteboard and put it on the floor, so we can draw where the car starts and ends.
Then it turns out that the class TachoNavigator is deprecated and we cannot use it. The package does not exist. We instead use the class DifferentialPilot. This however does not use a coordinate system.
We wrote a program, example seen below, to test the robot, The robot drives in a square with side length of 50 cm.
DifferentialPilot dp = new DifferentialPilot(5.6, 17.1, Motor.C, Motor.B);
public void driveInSquare(){
dp.travel(50.0);
dp.rotate(90.0);
dp.travel(50.0);
dp.rotate(90.0);
dp.travel(50.0);
dp.rotate(90.0);
dp.travel(50.0);
dp.rotate(90.0);
}
The following video shows the square driven. One can see, the it is about a centimeter off.
(video on the way)
Next step, we attached a marker as suggested:
We had the robot drive the square 5 times. The result is seen in the picture below.
The result is fairly good, off only by ½-1 cm.
We then found the class Navigator, which used a coordinate system. This class however did not work correctly. The method rotateTo() worked, but goTo() did not and when we tried to use it, the robot just reset. We googled solutions and the best suggestion was to use NavPathFinder instead of Navigator. We were, however, not able to import this class, it was not in our lejOS package. We finally found out that in lejOS version 0.9.1 the Navigator class does not work properly, so we skipped the coordinate system, went back to using DifferentialPilot and found out we could get the robot position/direction from the OdometryPoseProvider.
2.
The plan is to make a program that uses the travel() and rotate() methods from the DifferentialPilot and has the robot follow some pre-defined path. The robot should be able to avoid obstacles on the path. The first idea is to mount a bumper to the robot using the pressure-sensors. We would then have some hardcoded avoid function and use the OdometryPoseProvider to get the position and direction, when the robot gets back on track, to re-calculate the path from the current position. This however will be a project for another time.
Status
We did not get far in the exercises. This is because some of the classes we thought, we could use, was outdated, which we only found out after googling it a lot and reading through the different navigation classes as well as their documentation. So we did not get work done, but we still feel that we learned a lot about navigation and how to implement it.
References
(*1) http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson9.dir/Lesson.html
No comments:
Post a Comment