I am using the argos3 implementation of FootBot, and I have my own controller for the robots' movement.
In my implementation, the robots notice the block's direction by summing the sensor vectors and normalizing them, just as in the Diffusion example.
However, if there is a block (to the left of the robot), I have a line in my code as follows:
Code: Select all
m_pcWheels->SetLinearVelocity(turnRate, -turnRate);
However, in the next tick in the simulator, the robot does not see anything on any sensor, so it corrects its orientation concerning its destination, making it turn to the left. And I, therefore, have an infinite loop or a livelock.
I have tried to debug print the values of the sensors in this situation, and they are as follows:
Code: Select all
.
.
.
Lenght of cAccumulator: 0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
(Next tick)
Angle Value:0.000000
Angle Value:0.000000
Angle Value:1.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Angle Value:0.000000
Lenght of cAccumulator: 0.083333
.
.
. (Repeating forever)
Is there something I can do in the implementation of the robots that makes sure that they do not overlap?
Thanks in advance!
- Martin Kristjansen