VFF-tour hits
This first practice is to program a robot so as to move randomly around the stage without actually colliding. For this, the robot moves in a straight line until it meets an obstacle, then turns back a bit and a random number of degrees to avoid the obstacle. Once you have turned again to move to find a new obstacle. To do it I had to change the function yourcode_iteration found in the file navegación.c Once code is written you have to compile using make. If there has been no problem compiling the file is copied directory jderobot introrob.so To make this behavior by using a finite automaton of three states:
- Advancing
- Backing
- Turning Initially the robot is moving in the state, until it encounters an obstacle less than 400mm, then change your status to back, and after 20 iterations change the state turning. Within the state
moving the robot can go to two different speeds depending if obstacles near or not. If it finds no obstacle is less than 600mm at a speed of 800, and if found within this distance decreases its speed to 350. If the obstruction is less than 400 starts back (receded).
The state runs it back for 20 iterations, ie 2 seconds. The rate at which back is -200. Once past that number of iterations randomly chosen as spin, from -120 degrees to 120 degrees and goes into the spinning.
Depending on whether positive or negative degree turn right or left, instead of always turning towards the same direction until reaching the desired degree. In the state
turning, the robot only rotates to reach a desired range of grades. In my case this range is 2.8 degrees. Subsequently returns to the state forward.
The problems I have encountered have been mainly condicción stop the rotation, as it had to be careful with radians, and he had to control both the upper and lower margins were between 0 and 6.28. Another problem
I've found is that if I gave a lot of speed to the robot in the state forward, gave him no time to brake and crashed, and if I put a safe distance most, when I took airspeed stopped in time, but if it was the obstacle before reaching that speed was far from the obstacle.
0 comments:
Post a Comment