I'm making a line following algorithm where ePuck Robot can stop in front of the obstacle (also in the end of the line). I managed to make the robot stop, but there's something odd about the robot after that. The robot seems to be drifting away from the wall even though I already set the velocity of the left and right wheel to zero as shown in the image below.
This is the footage of the problem that I encountered : https://drive.google.com/file/d/1dRIbzT ... sp=sharing
I've done some research, I'm guessing there's something I have to do with the proximity sensor, so I try this code (in the if statement where the robot have to be stopped)
Code: Select all
if (robotworking) then
-- do the turning algorithm based on the light sensor
else -- robot working state turned to false, means robot have to stop
velLeft=0
velRight=0
for i=1,8,1 do
sim.setExplicitHandling(proxSens[i],1)
end
sim.handleProximitySensor(sim.getObjectHandle('20cmHighWall25cm'))
end
My question is, how can I resolve this? I want to manage the robot completely stop in front of the obstacle.