Closed andretamm closed 10 years ago
Diagonal movement performed better today after I did a couple of fixes. The first thing I did is play around with the value of the maximum speed. In lower speeds we don't observe the "satellite" behaviour, however, in higher speeds with the addition of a stop before executing the diagonal movement the problem doesn't occur as well. I need to show it to you guys to see your opinion on the performance and then I will commit the code.
Hola, can you still commit the code if you think it's (at least kind of) working? If you're afraid of committing to the main branch, then create your own branch and push there :)
I think I did something and I branched. I know my git skills are awesome :D However, I had problems exiting the editor for the commit message, so there is my true message for the commit:
Changed the way the angle is send, I believe this caused the reseting of the brick. Added a stop before executing a diagonal movement command, as you do with backward and forward movement, and this fixed the gravity issue. If you want to see it in action, set the robot to be the blue defender, load my NXT, then start the robot and start the strategy. I made the vision system display the point where it is going, which will show as a blue line. Please tell me if it doesn't work well and how would you like me to improve it.
With the new way the defender and attacker use diagonal movement for blocking, together with the block that Konstantin described, I don't think this will be an issue any more, at least I haven't seen it happen any more, so happy to close this :)
Sometimes the robot started going round in circles around a target point it wanted to reach when doing diagonal movement. I believe this is because we get the same effect as if a satellite was orbiting a planet, we send it commands to go towards the point (gravity pulling towards the planet), but its existing velocity/inertia is perpendicular to that new direction, so it starts going round in a circle. Here's an illustration : http://upload.wikimedia.org/wikipedia/commons/4/4e/Orbital_motion.gif