Skip to content

Steering Calibration

AutoModelCar edited this page Apr 18, 2018 · 6 revisions

Wiki

Calibrate​ ​ the​ ​ steering​ ​ angle​ ​ of​ ​ the​ ​ car​ ​ (bicycle​ ​ model)​​ using​ ​ the​ ​ lidar​ ​ scan​ ​ of​ ​ a ​ ​ wall.

Run

Connect to the car via WiFi.

export ROS_HOSTNAME=192.168.43.12
export ROS_IP=192.168.43.12

export ROS_MASTER_URI=http://192.168.43.20:11311

install python-scipy

Place​ ​ the​ ​ car​ ​ to​ ​ the​ ​ wall,​ ​ facing​ ​ the​ ​ wall. Run the script ./calibration.sh

The Script ​ sets​ ​ a ​ ​ steering​ ​ value​ ​ (0°,​ ​ 30°,​ ​ 60°,​ ​ 90°,​ ​ 120°,​ ​ 150°,​ ​ 180°​ ​ servo​ ​ motor​ ​ scale​ ​-altogether​ ​ 7 ​ ​ values)​ ​ and​ ​ drives​ ​ some​ ​ centimeters​ ​ backwards. The​ ​ turning​ ​ radius​ ​ R and angle (gamma) are calculated and be saved in SteerAngleActuator.xml. The XML file will be use in odometry code. Therefore the XML file will be copied to odometry/cfg/ folder.

Test Viedo

Hint: when the car drives, it should not drive more than a quarter of a circle. If it drives more than a quarter of a circle, modify the code and reduce the speed to 100.

Equations

Calculate​ ​ the​ ​ turning​ ​ radius​ ​ R ​ ​ with​ ​ respect​ ​ to​ ​ the​ ​ center​ ​ of​ ​ the​ ​ rear​ ​ axle​ ​ (for​ ​ simplicity assume​ ​ the​ ​ lidar​ ​ is​ ​ on​ ​ the​ ​ rear​ ​ axle​ ​ center).

Steering calibration

   t = (d2-d1)/cos((theta1+theta2)/2)
   phi=(pi-(theta2-theta1))/2
   r= t.sin(phi)/sin(theta2-theta1)

code

1- Calculate the​ ​ angle​ ​ and distance of​ ​ the​ ​ car w.r.t.​ ​ the​ ​ wall​.

2- Drive backward

3- Calculate​ ​ the​ ​ turning​ ​ radius​ ​ R and Gamma

4- Save in XML file

5- Drive forward and stop in front of the car.

6- At the end the XML file is copied into the odometry/cfg/ folder.

Clone this wiki locally