Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZED tracking coordinate-based kart control #8

Open
arya1106 opened this issue Feb 3, 2024 · 4 comments
Open

ZED tracking coordinate-based kart control #8

arya1106 opened this issue Feb 3, 2024 · 4 comments
Assignees

Comments

@arya1106
Copy link
Contributor

arya1106 commented Feb 3, 2024

Use the information provided by #6 and a series of target points to plan and follow a given path. Output control values of:

  • Braking
  • Steering
  • Throttle
@arya1106
Copy link
Contributor Author

arya1106 commented Feb 4, 2024

Discord Channel

@Jaron-Hunt Jaron-Hunt self-assigned this Mar 6, 2024
@arya1106
Copy link
Contributor Author

arya1106 commented Mar 7, 2024

Planning to use LQR implementation with forward kinematics from here. Another example implementation. Simulation code here.

@arya1106
Copy link
Contributor Author

arya1106 commented Mar 7, 2024

Symbol definitions:

$x$ – x-coordinate relative to world frame
$\dot{x}$ – x-coordinate change
$y$ – y-coordinate relative to world frame
$\dot{y}$ – y-coordinate change
$\theta$ – yaw in degrees relative to world frae
$\dot{\theta}$ – change in yaw
$\phi$ – current steering angle of car
$\dot{\phi}$ – current steering angle of car
$t_0$ – current time
$t_1$ – time we are trying to predict
$dt$ – discrete time step
$\beta$ – Brake (0-255)
$\tau$ – Throttle (0-255)
$\pi$ – Steering Angle (0-255)
$u_1$ - velocity of kart
$u_2$ - turning rate of kart

Image

What we get from the kart:

$x, y, \theta$ – Coordinates from #6
$\phi$ - Control memory

Forward kinematics

State vector

$$\begin{bmatrix} x \\\ y \\\ \phi \\\ \theta \end{bmatrix}$$

Inputs:

  • $u_1$
  • $u_2$

Software (us) Controls (inputs):

  • $\beta$
  • $\tau$
  • $\pi$

Conversions:

$u_1$ = $c_1\beta + c_2\tau$
$u_2$ = $\frac{\pi - \phi}{dt}$

$c_1$ and $c_2$ to be found experimentally.

Differential State Matrix

$$\begin{bmatrix} \dot{x} \\\ \dot{y} \\\ \dot{\phi} \\\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} u_1\cos\theta \\\ u_1\sin\theta \\\ u_2 \\\ u_1\cdot\frac{1}{L}\cdot\tan\phi \end{bmatrix}$$

State prediction

$$\begin{bmatrix} x_t \\\ y_t \\\ \phi_t \\\ \theta_t \end{bmatrix} + \begin{bmatrix} \dot{x} \\\ \dot{y} \\\ \dot{\phi} \\\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} x_{t+1} \\\ y_{t+1} \\\ \phi_{t+1} \\\ \theta_{t+1} \end{bmatrix}$$

@arya1106
Copy link
Contributor Author

arya1106 commented Mar 7, 2024

Just found this....

Worth a try to implement ourselves for the challenge, but we can use the reference here if we struggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants