Introduction: Car No.05 Fifth Stage (Half Chocolate Version)

Car No.05 is the project aiming to make a programmed automatic driving car.

Plain-vanilla version uses tachometers data, and controls steering servos, and drives as programmed.

Strawberry version uses the combination of tachometers and azimuth data, which is obtained from gyro censer.

Chocolate version is further to Strawberry version adding the car own position adjusting system using webcam.

The car own position adjusting system is activated after the car comes back adjacent to the starting point.

Adjusting car own position system requires backward driving.

Since the speed controller Tamiya TEU-104BK does not function well for the change from forward to backward, I cannot complete full Chocolate version with this Car No.05.

I give up developing the full Chocolate version with Car No.05, and I will make it in Car No.06 using much well-functioning motor controller.

I introduce how to calculate the car own position and direction using webcam in this half Chocolate version.

Step 1: Explanation of the Car Own Position Adjusting System

Both Plain-vanilla and Strawberry versions of automatic driving control system cause out of position of car. The car own position adjusting system is adjusting such out of position.

The flow of system is as follows. (Also refer to the attached Excel Worksheets.)


- Color plastic tape shall be adhered on the floor.

Based on color plastic tape, the car position shall be calculated and adjusted.

(I used green tape and I made white tape adhere below the green tape to make the contrast more clearly.)

A: tape left end point

B: tape right end point

- Get tape end points coordinates (Acam, B’cam) on video captured screen.

- Convert Acam & B’cam points into actual coordinates (A_, B’_).

(My calculation can be used practically, but incorrect.)

- Calculate Car position and direction in Driving Control coordinate.

P: Car position

phi0: Car direction

- Car shall be moved to the tape and crossed at right angles on the tape.

Calculate R and TR.

R: point on the tape line where Car crosses at right angles

TR: Relevant turning radius

- Refer to the relationship table between steering servo value and turning radius, get the relevant steval.

Also, calculate the relevant tachometer count.

- After Car moved to R point, Car shall be moved laterally(combination of backward driving x 2 and forward driving) to A’ point.

Calculate the number of lateral movement cycles.

- Then move.

Lateral movement is simulated utilizing Excel Simulation Program 2 introduced in Fourth Stage.

Step 2: Measurement

Make a measuring tape adhere on the floor and set R/C car as webcam position 0.

Run the attached Processing code and measure the actual coordinates together with webcam coordinates.

Processing code

Make the conversion formula from webcam coordinates on video captured screen into actual coordinates.

Step 3: Processing Code

In accordance with the Flow mentioned in Step 1 and also measurement result in Step 2, write Processing code as per attached.

Processing code

Run the Processing code.


Then, add this chocolate code to CARNO05_STRAWBERRY.pde and make CARNO05_CHOCOLATE.pde

Processing code

Step 4: Trial Run (but Upto R Point Only)



It seems very hard to make Car stop at a certain point with this applied motor, and I had better apply the other type of motor such as geared motor.

But, I am confident that full Chocolate version makes car repeated trajectory driving possible.

Problems yet solved:(Yo Dareka Oshietekure!)

My conversion from webcam video captured screen point to actual coordinate is incorrect.
Does anyone know how to convert precisely.