Welcome to ROSMASTER A1 PRO repository
4.A1Pro Front Wheel Servo Calibration
A1Pro Front Wheel Servo Calibration
A1Pro Front Wheel Servo Calibration0. Overview and Background1. Pre-Calibration Preparation2. Start Calibration Program3. Detailed Calibration Operation Steps (Core Three Steps)Step 1: Adjust Front Wheel Neutral Position (Factory can proceed to Step 2 first)Step 2: Low-Speed Straight-Line Verification (Dynamic Verification and Heading Detection)Step 3: Save Result to Chassis Flash4. Common Problem TroubleshootingQ1: When starting the program, a popup shows error "Cannot connect to Rosmaster (/dev/myserial)"?Q2: Why does the car stop after moving slightly when I click "Start 1 Meter Straight-Line Verification"?Q3: What if I messed it up and want to restore it?
0. Overview and Background
Important
Why do you need to calibrate the front wheel servo?
ROSMASTER A1 Pro uses an Ackerman front wheel servo steering structure. During factory assembly, due to the tiny mechanical tolerance between the servo output shaft spline teeth, steering linkage, and chassis mechanical structure, the default servo angle of the chassis may not be able to make the front wheels achieve absolute parallel forward.
If there is a deviation in the front wheel center position, the car will "deviate" when running straight line commands, which directly affects mapping accuracy (such as odometry drift) and the trajectory tracking effect of autonomous navigation. This calibration program provides visual adjustment, low-speed straight-line dynamic verification, and Flash permanent storage, allowing you to precisely correct the front wheel center position.
1. Pre-Calibration Preparation
Release serial port resources (critical):
The calibration program needs to read and write the chassis servo angle through the underlying serial port
/dev/myserial.If the joystick control program has been auto-started on boot, you must first close it, otherwise the program will pop up an error "Cannot connect to Rosmaster (/dev/myserial)".
Joystick shutdown command:
pkill -f "rosmaster/joy.py"
Test site preparation:
Prepare a flat ground with no obstacles, length at least 1.5 meters (tile, wooden floor, or flat rubber mat ground is fine).
When initially observing adjustment, you can slightly lift the front wheels off the ground; for straight-line verification, all four wheels need to be on the ground.
Remote desktop connection:
This calibration program is a Tkinter graphical interface, please log in to the car through VNC Viewer remote desktop (or connect the car to HDMI display) and run it in the desktop terminal.
2. Start Calibration Program
Open a terminal in the VNC remote desktop and enter the following startup command:
xxxxxxxxxxpython3 ~/Rosmaster/rosmaster/calibrate_akm_angle.pyAfter successful startup, the following graphical calibration interface will pop up:

3. Detailed Calibration Operation Steps (Core Three Steps)
The calibration process is divided into three clear stages: Adjust center angle → 1-meter straight-line dynamic verification → Permanent Flash save.
Step 1: Adjust Front Wheel Neutral Position (Factory can proceed to Step 2 first)
Read current saved angle:
When the interface starts, it automatically reads the currently persistently saved center angle from the chassis Flash (valid range:
60° ~ 120°, factory default usually between90° ~ 100°), and displays it in the upper right corner.
Adjust target angle:
Slider coarse adjustment: Drag the horizontal slider to adjust the angle within the range
60° ~ 120°.Single-degree fine adjustment: Click
−1°or+1°buttons to adjust by 1-degree steps.Direct input: Directly type the target integer angle in the text box, press keyboard
Enterto confirm.
Observe front wheel swing:
After each adjustment, click 【Temporary Apply】, the chassis servo will immediately drive the front wheels to rotate to the corresponding position and return to steering zero position.
Visually observe if the front wheels are already in a completely parallel forward straight line state with the vehicle body longitudinal beam.
Step 2: Low-Speed Straight-Line Verification (Dynamic Verification and Heading Detection)
Tip
Static visual observation often has viewing angle errors. This program provides a low-speed closed-loop driving 1 meter actual measurement verification mechanism, combined with chassis wheel speed odometry and IMU heading feedback, to intuitively verify if the car truly drives in a straight line!
Place the car steadily on the ground at the starting line, keeping the vehicle body aligned with the front reference line (leave at least 1.5 meters of space in front).
Click the 【Start 1 Meter Straight-Line Verification】 button:
The interface will pop up a safety prompt, click "Confirm" and the car will smoothly move forward at a safe low speed of 0.12 m/s for about 1 meter.
The interface progress bar will update in real-time (0% ~ 100%), and display the traveled distance and wheel speed feedback.
Safety control: During the test, you can click the 【Stop Immediately】 button or press keyboard
Escto emergency brake at any time.
Observe driving trajectory and yaw results:
After the car completes 1 meter, it will automatically brake smoothly and pop up a prompt showing the traveled distance and IMU heading angle change (for example:
Straight-line distance verification complete: 1.00 m, heading change -0.3°).Drift adjustment tips:
If the car deviates to the left during driving: The current center angle is too small/left-biased, click
+1°to appropriately increase the center angle and retest;If the car deviates to the right during driving: The current center angle is too large/right-biased, click
−1°to appropriately decrease the center angle and retest;Repeatedly fine-tune and verify until the car almost does not deviate left or right after traveling 1 meter and maintains perfect straight-line driving.



Step 3: Save Result to Chassis Flash
Button unlock rule:
Only when the car has completed the full 1-meter straight-line verification, the 【Verification Passed and Permanently Save】 button in the lower right corner will be unlocked and become clickable, effectively preventing accidental modification of configuration without actual testing.
Confirm write to Flash:
Click the 【Verification Passed and Permanently Save】 button;
Click "Yes" in the pop-up secondary confirmation dialog, the system will permanently write the current tested best angle into the control board's Flash memory.
After the save prompt is displayed, the parameter will not be lost after power off, whether for boot auto-start, keyboard control, mapping navigation, or following cases, the front wheels will automatically use this angle as the accurate center reference!
Exit program:
After saving is complete, directly click the close button in the upper right corner of the window to exit.
(Note: If the user closes the window without clicking Permanent Save, the program will automatically restore the servo to the previously saved permanent angle, preventing residual untested temporary configuration).


4. Common Problem Troubleshooting
Q1: When starting the program, a popup shows error "Cannot connect to Rosmaster (/dev/myserial)"?
Reason: The chassis serial port
/dev/myserialis exclusively occupied by another background program (usually the joystick control programjoy.pythat auto-starts on boot, or a ROS2 chassis driver node running in the background).Solution: Execute the following command in the terminal to forcefully terminate the process occupying the serial port, then re-run the calibration program:
xxxxxxxxxxpkill -f "rosmaster/joy.py"killall -9 python3
Q2: Why does the car stop after moving slightly when I click "Start 1 Meter Straight-Line Verification"?
Reason: The program has built-in timeout and speed feedback safety protection. If the chassis does not detect valid encoder feedback or is blocked by external force, it will automatically safety stop.
Solution: Ensure the battery is sufficiently charged, the car's power switch is on, and there are no wires or other debris jamming the wheels.
Q3: What if I messed it up and want to restore it?
Click the 【Restore Saved Angle】 button at the bottom of the interface, the program will re-read the last successfully saved permanent angle from the chassis Flash and restore the front wheel posture.