RobotnikAutomation / rbcar_sim

Robotnik Car Simulation Packages
BSD 2-Clause "Simplified" License
36 stars 25 forks source link

robot_control node steering angle computation #3

Open glebos opened 7 years ago

glebos commented 7 years ago

Hi, I am trying to understand the source code of the robot_control_node.

// Compute state control actions // State feedback error 4 position loops / 4 velocity loops // Single steering double d1 =0.0; double d = RBCAR_D_WHEELS_M; // divide by 2 for dual Ackermann steering double alfa_ref_left = 0.0; double alfa_ref_right = 0.0; if (alfaref!=0.0) { // div/0 d1 = d / tan (alfaref); alfa_ref_left = atan2( d, d1 - 0.105); alfa_ref_right = atan2( d, d1 + 0.105); if (alfaref<0.0) { alfa_ref_left = alfa_ref_left - PI; alfa_ref_right = alfa_ref_right - PI; }

I am wondering what (d1 -/+ 0.105) do represent? Could you please explain? Thank you very much!

iluetkeb commented 7 years ago

I didn't write the code, but usually with Ackermann steering, the two wheels are not actually using the same angle, but slightly offset to each other. This may be that.