DonkeyCar for Jetson Nano-Calibrate DonkeyCar
Guides of DonkeyCar
- Setup Jetson Nano
- Setup Linux PC
- WEB Control
- Calibrate DonkeyCar
- Data Collection
- Train Data
- JetRacer AI Kit WIKI
Calibrate the DonkeyCar
In order to accurately control the DonkeyCar steering needs. It needs to be calibrated in both hardware and software.
First of all, it needs to be assembled correctly to ensure the correct steering control of the servo in the hardware, when assembling, the length of the long tie rod is determined first, and the length of the long tie rod is adjusted just so that the two front wheels are facing forward at the same time.
After determining the length of the long tie rod and then adjusting the length of the short tie rod, adjust the length of the short tie rod so that the rudder turns to the middle position when the two front wheels are facing forward at the same time. At this point, the rudder should be 90 degrees.
- Open the terminal and run the following commands to calibrate the metal gear servo.
cd ~/mycar donkey calibrate --channel 0 --bus=1
- Input 360, at this time, you should see the rotation of many servos. If there is no rotation, input 400 or 300 and try it.
- Slowly adjust from the initial value, so that the servo turns to the middle position, and click the current value a few times. For example 330. This value +/- 100 will give roughly the left and right values 230 and 430.
- Enter these two values to see if the servo can turn to the corresponding position. If it cannot be turned to the corresponding position, it may be that the initial angle of the servo is not 90 degrees during assembly. Loosen the screw of the servo and turn the servo to 90 degrees (for example, input the position of 360), and then install the servo. Find the following section in the config.py file and change the values of STEERING_LEFT_PWM and STEERING_RIGHT_PWM to the actual calibrated values.
In addition, when adjusting the value need to pay attention to avoid setting the steering value as too small or too large, the steering range as too large, and the maximum steering is about the following chart.
If you set the steering range as too large as shown below it may affect the steering accuracy, or steering too large to cause the DonkeyCar resistance to be too large and stuck immobile.
Also need to see if the DonkeyCar setting in the config.py file is the same as below, if not change it to the same value.