Open bcontino opened 8 years ago
If our speed is well controlled, we should read near zero. If we receive a high acceleration in the opposite direction of our motion then we can assume we have hit the other robot. If we get a high acceleration in our direction of motion, after we know we have hit our maximum speed then we can assume we were hit from behind
We can keep track of how far we have travelled since last seeing a white line at the time we are hit, to determine our best plan of action to either push the other robot or to get out of being pushed. If we were very close to the edge when we hit the other robot we probably want to perform a defensive maneuver even though we were the ones making contact so that we can hit them when we are the closest ones to the center and pushing them out
If we have travelled a distance that is some amount further than the length of the ring, then we can turn down our requested speed to the motors which should be seen as an acceleration by the accelerometer. If a much lower acceleration than expected is sensed, then we can assume that we have been pushing a robot and were not making much progress, at which point we should do a maneuver to attach from another angle
Accelerometer implementation from micromouse has been added. It needs additional functions to return accelerometer data because they only put in functions for gyro data.
An interesting feature is its use of the logging class that logs data to a queue and prints it out to the terminal later when you call a certain function. This can be used for logging data while running the sumo to test it.
When the robots been hit. Where to go from there