... | @@ -82,11 +82,7 @@ We ended up with the following initial, concrete plan for the first steps: |
... | @@ -82,11 +82,7 @@ We ended up with the following initial, concrete plan for the first steps: |
|
|
|
|
|
### **Experimenting with LineFollower**
|
|
### **Experimenting with LineFollower**
|
|
|
|
|
|
In order to use the LineFollower program, we rebuilt the robot so that the light sensor pointed towards the ground (see Figure 2).
|
|
In order to use the LineFollower program, we rebuilt the robot so that the light sensor pointed towards the ground, as shown in Figure 3 where the only difference is that the robot has two light sensors mounted.
|
|
|
|
|
|
![Robot rebuilt for line following](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/[TODO])
|
|
|
|
|
|
|
|
*Figure 2: The robot rebuilt to use the light sensor for following a line on the ground.*
|
|
|
|
|
|
|
|
In order to have some clear goals for our experiments, we began by identifying issues with using the LineFollower program, in order to try and solve them individually before attempting to figure out a solution for the entire task - sort of a divide and conquer approach. This resulted in the following problems and motivations to solve them:
|
|
In order to have some clear goals for our experiments, we began by identifying issues with using the LineFollower program, in order to try and solve them individually before attempting to figure out a solution for the entire task - sort of a divide and conquer approach. This resulted in the following problems and motivations to solve them:
|
|
|
|
|
... | @@ -148,11 +144,11 @@ The robot performed very poorly, often making a sudden turn off the track. After |
... | @@ -148,11 +144,11 @@ The robot performed very poorly, often making a sudden turn off the track. After |
|
|
|
|
|
The next experiment was whether or not equipping the robot with a gyro sensor would enable it to detect the movement when driving onto a platform.
|
|
The next experiment was whether or not equipping the robot with a gyro sensor would enable it to detect the movement when driving onto a platform.
|
|
|
|
|
|
As in the other experiments we started out by rebuilding the robot - this time using the gyro sensor. Initially we intended to place the sensor at the center of the robot (directly above the wheels). We however realized that there would be less motion on the center axis than on either front or back of the robot, resulting in more steady readings of the gyro, which in our case, where we want to detect small changes, is an unwanted property. Therefore we decided to mount the gyro in front of the robot as seen in figure 3.
|
|
As in the other experiments we started out by rebuilding the robot - this time using the gyro sensor. Initially we intended to place the sensor at the center of the robot (directly above the wheels). We however realized that there would be less motion on the center axis than on either front or back of the robot, resulting in more steady readings of the gyro, which in our case, where we want to detect small changes, is an unwanted property. Therefore we decided to mount the gyro in front of the robot as seen in Figure 2.
|
|
|
|
|
|
![Robot with gyro sensor](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/[TODO])
|
|
![Robot with gyro sensor](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/[TODO])
|
|
|
|
|
|
*Figure 3: The robot rebuilt to use a gyro sensor for detecting a level change.*
|
|
*Figure 2: The robot rebuilt to use a gyro sensor for detecting a level change.*
|
|
|
|
|
|
To test whether the gyro sensor can be used to detect when the robot reaches a platform, we wrote a small program **GyroTest.java **[TODO ref], that records and displays the minimum - and maximum seen values so far while the robot drives forward at a steady paste (both motors run with a power of 80). We intended to log the gyro readings throughout each test, but had some errors that we couldn’t find an immediate solution for. Instead we moved on without logs and used the displayed minimum - and maximum values instead.
|
|
To test whether the gyro sensor can be used to detect when the robot reaches a platform, we wrote a small program **GyroTest.java **[TODO ref], that records and displays the minimum - and maximum seen values so far while the robot drives forward at a steady paste (both motors run with a power of 80). We intended to log the gyro readings throughout each test, but had some errors that we couldn’t find an immediate solution for. Instead we moved on without logs and used the displayed minimum - and maximum values instead.
|
|
|
|
|
... | @@ -162,17 +158,17 @@ Running the GyroTest.java program was done in two tries. First we started the pr |
... | @@ -162,17 +158,17 @@ Running the GyroTest.java program was done in two tries. First we started the pr |
|
|
|
|
|
At this point in time, we decided to stop experimenting and generating ideas for optimizations and instead just tried implement a program that enabled the robot to go up and down the ramp with no special concerns about time. This program could then later be optimized with the earlier findings to give a better resulting time.
|
|
At this point in time, we decided to stop experimenting and generating ideas for optimizations and instead just tried implement a program that enabled the robot to go up and down the ramp with no special concerns about time. This program could then later be optimized with the earlier findings to give a better resulting time.
|
|
|
|
|
|
We started out by rebuilding the robot such that it now had two light sensors instead of one (see figure 4) and no gyro sensor. We also made it easy to change the distance between the two sensors, making it adjustable if necessary later on.
|
|
We started out by rebuilding the robot such that it now had two light sensors instead of one (see figure 3) and no gyro sensor. We also made it easy to change the distance between the two sensors, making it adjustable if necessary later on.
|
|
|
|
|
|
![Robot rebuilt to use to light sensors](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/[TODO])
|
|
![Robot rebuilt to use two light sensors](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/rebuilt.png)
|
|
|
|
|
|
*Figure 4: The robot rebuilt to use two light sensor for following a line on the ground.*
|
|
*Figure 3: The robot rebuilt to use two light sensor for following a line on the ground.*
|
|
|
|
|
|
After rebuilding the robot, we began implementing the **_InitialClimber.java_** [TODO ref] program. The program started out as a copy of **_LineFollower.java_**** **[TODO ref], and the idea was to use one of the two sensors to follow the line on the ramp, and the other to detect and initiate a turn at the big black line at the end of the platforms. The general idea can be seen in figure 5.
|
|
After rebuilding the robot, we began implementing the **_InitialClimber.java_** [TODO ref] program. The program started out as a copy of **_LineFollower.java_**** **[TODO ref], and the idea was to use one of the two sensors to follow the line on the ramp, and the other to detect and initiate a turn at the big black line at the end of the platforms. The general idea can be seen in Figure 4.
|
|
|
|
|
|
![180 degree turn](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/InitClimber-idea.png)
|
|
![180 degree turn](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week1011/img/InitClimber-idea.png)
|
|
|
|
|
|
*Figure 5: An illustration of the robot driving forward onto the platform and turning nearly 180 degrees to go back onto the next ramp*
|
|
*Figure 4: An illustration of the robot driving forward onto the platform and turning nearly 180 degrees to go back onto the next ramp*
|
|
|
|
|
|
The extension of the code consisted in an if-statement checking if both sensors were reading black. If this was the case, the robot should turn a little less than 180 degrees and thereby drive towards the next ramp where the hope was that it would be able to rediscover the black line. We purposefully set the power for the motors very low, in order to more easily observe errors. The turn was implemented by rotating the robot while letting the thread sleep for a certain amount of milliseconds - the sleep time was figured out by performing test runs with the robot to try out different values.
|
|
The extension of the code consisted in an if-statement checking if both sensors were reading black. If this was the case, the robot should turn a little less than 180 degrees and thereby drive towards the next ramp where the hope was that it would be able to rediscover the black line. We purposefully set the power for the motors very low, in order to more easily observe errors. The turn was implemented by rotating the robot while letting the thread sleep for a certain amount of milliseconds - the sleep time was figured out by performing test runs with the robot to try out different values.
|
|
|
|
|
... | @@ -372,11 +368,11 @@ TODO |
... | @@ -372,11 +368,11 @@ TODO |
|
|
|
|
|
## **Appendix A: Unconstrained idea generation**
|
|
## **Appendix A: Unconstrained idea generation**
|
|
|
|
|
|
In the experiments with the faster initial ramp climb, where we had the robot simply race up the track, it was suggested that we give the robot "arms" to allow it to hold onto the sides of the ramp while going up. This way, the robot would be prevented from running off the track. However, we foresaw an abundance of issues with raising the arms before reaching the platform, and doing so in time. The idea is illustrated in Figure 6.
|
|
In the experiments with the faster initial ramp climb, where we had the robot simply race up the track, it was suggested that we give the robot "arms" to allow it to hold onto the sides of the ramp while going up. This way, the robot would be prevented from running off the track. However, we foresaw an abundance of issues with raising the arms before reaching the platform, and doing so in time. The idea is illustrated in Figure 5.
|
|
|
|
|
|
![image alt text](image_0.png)![image alt text](image_1.png)
|
|
![image alt text](image_0.png)![image alt text](image_1.png)
|
|
|
|
|
|
*Figure 6: The robot (Frej) with arms extending below the track to keep Frej in place.*
|
|
*Figure 5: The robot (Frej) with arms extending below the track to keep Frej in place.*
|
|
|
|
|
|
Another idea along the same lines involved extendable arms to reach for the second platform and pull the robot from the starting area. This led to the even more unrealistic suggestion of letting the robot throw a grappling hook at hoist itself to the second platform.
|
|
Another idea along the same lines involved extendable arms to reach for the second platform and pull the robot from the starting area. This led to the even more unrealistic suggestion of letting the robot throw a grappling hook at hoist itself to the second platform.
|
|
|
|
|
... | | ... | |