Git Product home page Git Product logo

ugvcontrol's Introduction

UGVControl

Dynamics

We model the UGV as a unicycle with the dynamics

$$ \begin{bmatrix} \dot{x}\\ \dot{y}\\ \dot{\theta} \end{bmatrix} = \begin{bmatrix} v\cos\theta\\ v\sin\theta\\ \omega \end{bmatrix}. $$

where $x\in\mathbb{R}$ and $y\in\mathbb{R}$ represents the position of the UGV in the world frame, $\theta\in\mathbb{R}$ is the heading of the UGV, $v\in\mathbb{R}$ is the linear velocity, and $\omega\in\mathbb{R}$ is the angular velocity.

Control Algorithm

The control algorithm is a simple proportional controller with

$$v = K_v|\Delta p|,\quad \omega = K_\omega\Delta\theta.$$

The positional error $\Delta p$ is computed as

$$ \Delta p = \begin{bmatrix} \Delta x\\ \Delta y \end{bmatrix} = \begin{bmatrix} x_\mathrm{des} - x\\ y_\mathrm{des} - y \end{bmatrix}. $$

To compute the heading error $\Delta\theta$, we first compute the desired heading $\theta_\mathrm{des}$ as

$$\theta_\mathrm{des} = \mathrm{atan2}(\Delta y, \Delta x).$$

Then, we have the relationship between the body orientation $R_\mathcal{B} \in \mathrm{SO}(3)$, the orientation error represented as a rotation matrix $R_\epsilon \in \mathrm{SO}(3)$, and the desired heading $R_\mathrm{des} \in \mathrm{SO}(3)$ as

$$R_\mathcal{B}R_\epsilon = R_\mathrm{des}.$$

Then, we get the orientation error as

$$R_\epsilon = R_\mathcal{B}^\top R_\mathrm{des} = \begin{bmatrix} \cos\Delta\theta & -\sin\Delta\theta & 0\\ \sin\Delta\theta & \cos\Delta\theta & 0\\ 0 & 0 & 1 \end{bmatrix}.$$

Note that when tuning $K_v$ and $K_\omega$, we must ensure that $K_v << K_\omega$ to ensure stability, see here for a nice explanation of why this helps.

ugvcontrol's People

Contributors

bolundai0216 avatar rooholla-khorrambakht avatar harshit0803 avatar

Watchers

 avatar

Forkers

harshit0803

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.