e-Puck Robot won't stop in front of obstacle

Typically: "How do I... ", "How can I... " questions
Post Reply
robothusiast
Posts: 4
Joined: 12 May 2021, 08:41

e-Puck Robot won't stop in front of obstacle

Post by robothusiast »

Hello everyone,
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.

Image

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
But it seems to not working as I expected.

My question is, how can I resolve this? I want to manage the robot completely stop in front of the obstacle.

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: e-Puck Robot won't stop in front of obstacle

Post by coppelia »

Hello,

my best guess is that this is directly linked with the physics engine. Try to switch to another engine, or try to select a more precise dynamics configuration mode.

But the best is probably to slightly increase the mass and inertias of the wheels/body, following the dynamics design considerations 7 and 8.

Cheers

robothusiast
Posts: 4
Joined: 12 May 2021, 08:41

Re: e-Puck Robot won't stop in front of obstacle

Post by robothusiast »

coppelia wrote: 14 May 2021, 08:29 Hello,

my best guess is that this is directly linked with the physics engine. Try to switch to another engine, or try to select a more precise dynamics configuration mode.

But the best is probably to slightly increase the mass and inertias of the wheels/body, following the dynamics design considerations 7 and 8.

Cheers
Hello,

You're right! I already lookup the same answer that you say on this posts https://forum.coppeliarobotics.com/view ... uck#p29424 (Pardon me for asking same question)
But there's another thing I wanted to ask. When I try to switch the engine, my Algorithm won't work the way it supposed to be (I don't know why) so I intended to not to change the engine and keep using Bullet 2.78.
I also try to change the mass & inertias of the wheels according to that post and it work!. So the question is how can I change the inertias using sim.setShapeInertia ? I still don't understand the documentation. Perhaps you could enlight me with an example code.

Thanks!
Last edited by robothusiast on 15 May 2021, 00:36, edited 1 time in total.

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: e-Puck Robot won't stop in front of obstacle

Post by coppelia »

Just change the inertia via the GUI. That's the easiest, since you only need to do that once.

Cheers

robothusiast
Posts: 4
Joined: 12 May 2021, 08:41

Re: e-Puck Robot won't stop in front of obstacle

Post by robothusiast »

Noted, Thank you so much for helping me out!

Post Reply