JetRacer AI Kit Tutorial I: Basic Motion

From Waveshare Wiki
Revision as of 09:46, 7 November 2022 by Eng52 (talk | contribs) (Created page with "==Basic motion== *Enter <font style="background-color:#EEEEEE" color=#B94A48><nowiki>http://<jetbot_ip_address>:8888</nowiki></font> in the browser address bar to connect to t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Basic motion

  • Enter http://<jetbot_ip_address>:8888 in the browser address bar to connect to the car, open /jetracer/notebooks/ on the left side. Open the basic_motion.ipynb file.
  • Files with lpynb suffix are lpython Notebook files, including comment text and python programs. You can run a single-segment program by clicking Run->Run Select Cells or clicking the Run shortcut icon ▶.

[Note] There are detailed program notes in the text. Read the notes carefully to understand the program functions.

JetRacer AI Kit Manual 3-1.jpg.png
  • When running the statement car.steering = 0, the car steering will turn. 0 means forward, 1 means the wheel goes to the far left, -1 means the wheel goes to the far right. Change the wheel to different directions to different values, the value range is [-1,1]
JetRacer AI Kit Manual 3-2.png
  • After running this program, the steering gain car.steering_gain and the steering initial displacement car.steering_offset will be output.
  • The steering gain car.steering_gain can represent the maximum angle the wheel can turn.
  • The initial steering displacement car.steering_offset can represent the initial offset of the wheels. When car.steering = 0, when the car does not run in a straight line, you can adjust the length of the steering rod or modify the value of the initial steering displacement to make the car go straight.
JetRacer AI Kit Manual 3-3.png
  • car.throttle is the throttle size, the range is [-1,1], 0 means stop, 1 means forward at maximum speed, -1 means backward at maximum speed, after modifying the secondary value and running the program, the rear wheel will turn.
  • car.throttle_gain is the throttle gain, which can indicate the maximum speed at which the car can move. When car.throttle_gain = 1 and car.throttle = 1, the car can run to the maximum speed.
  • Summary: This section mainly learns how to control the movement of the car. The car is divided into two parts to control, one part is steering steering to control the car turning, and the other part is the throttle to control the speed of the rear wheels.
  • The steering gain car.steering_gain controls the maximum rotation range of the wheel, and the initial steering displacement car.steering_offset can compensate for the steering error caused by mechanical assembly.
  • The throttle gain car.throttle_gain controls the maximum speed range of the rear wheels.