# Making a car controller

This topic is 3300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I am trying to simulate the behavior of car. I do not need to take the wheels into account physically (I might turn them or not graphically). I'm currently pretty stuck while trying to change direction of the car. What I basically try to do, it take the velocity vector facing front of the car, and using trigonometry, split it to the X and Y values of the the velocity, so the car moves in the right direction. But I must be doing something wrong, since my car goes wild. Is there a good reference to help me understand what im doing wrong, what I should be doing, or does anybody know what's wrong?

##### Share on other sites
Quote:
 What I basically try to do, it take the velocity vector facing front of the car, and using trigonometry, split it to the X and Y values of the the velocity, so the car moves in the right direction.
Perhaps you could post the code (be sure to use [ source ] tags to preserve formatting).

##### Share on other sites
Sounds like a simple 2d "unicycle" model might do the trick...

Here's a continuous-time model

dx/dt = vx
dy/dt = vy
dvx/dt = -ω vy + a vx
dvy/dt = ω vx + a vy

where (x, y, vx, vy) is the car's state (position and velocity), and u=(a, ω) is the control input signal, giving at any time the forward acceleration and turning speed.

1. 1
2. 2
Rutin
20
3. 3
4. 4
5. 5
khawk
14

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013643
×