Confuse about SetForce(0, force)

asked 2014-06-26 08:26:45 -0600

TyNguyen gravatar image

updated 2014-06-26 11:58:11 -0600

Hi, I'm getting confused with function joints[i]->SetForce(0, force ) for a wheel joint. I build a PID controller for the throtte of my car running on a steep road. Using PID tuning tool in Matlab, it worked well but when i applied to Gazebo simulation, car did not run as expectation (car always could not run up). Therefore, i guess that i misunderstood the SetForce function's parameters.

Could you tell me if i put an energy's force F to my car, then what is the value of force put into SetForce(0, force) and the acceleration of my car ( my car is two-wheel drive and wheel's radius is r, its mass is m and suppose there is only additional gravity force mgsin(alpha)).

Here is how i computed force in SetForce(0, force) and apply to each wheel: force = F*r

acceleration = (F - mgsin(alpha) ) /m

for(i=1; i<3; i++) { joints[i]->SetForce(0, force ) }

I get stuck in this issue for a lot of time. Hope a intuitive guide. Thanks

edit retag flag offensive close merge delete