Defines | Functions | Variables
utils.h File Reference
#include <stdio.h>
#include <limits>
#include "newmatap.h"
#include "newmatio.h"
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GRAVITY   9.81
#define WANT_FSTREAM   /* include.h will get fstream fns */
#define WANT_MATH   /* include.h will get math fns */
#define WANT_STREAM   /* include.h will get stream fns */
#define WANT_STRING   /* include.h will get string fns */

Functions

double deg2rad (const double angle_deg)
ReturnMatrix eulzxz (const ColumnVector &a)
 Euler ZXZ rotation.
ReturnMatrix ieulzxz (const Matrix &R)
 Obtain Roll, Pitch and Yaw from a rotation matrix.
ReturnMatrix Integ_Trap (const ColumnVector &present, ColumnVector &past, const Real dt)
 Trapezoidal integration.
ReturnMatrix irotk (const Matrix &R)
 Obtain axis from a rotation matrix.
ReturnMatrix irpy (const Matrix &R)
 Obtain Roll, Pitch and Yaw from a rotation matrix.
bool isZero (const double x)
void odeint (ReturnMatrix(*xdot)(Real time, const Matrix &xin), Matrix &xo, Real to, Real tf, Real eps, Real h1, Real hmin, int &nok, int &nbad, RowVector &tout, Matrix &xout, Real dtsav)
 Integrate the ordinary differential equation xdot from time to to time tf using an adaptive step size strategy.
ReturnMatrix pinv (const Matrix &M)
 Matrix pseudo inverse using SVD.
double rad2deg (const double angle_rad)
ReturnMatrix rotd (const Real theta, const ColumnVector &k1, const ColumnVector &k2)
 Rotation around an arbitrary line.
ReturnMatrix rotk (const Real theta, const ColumnVector &k)
 Rotation around arbitrary axis.
ReturnMatrix rotx (const Real alpha)
 Rotation around x axis.
ReturnMatrix roty (const Real beta)
 Rotation around x axis.
ReturnMatrix rotz (const Real gamma)
 Rotation around z axis.
ReturnMatrix rpy (const ColumnVector &a)
 Roll Pitch Yaw rotation.
void Runge_Kutta4 (ReturnMatrix(*xdot)(Real time, const Matrix &xin), const Matrix &xo, Real to, Real tf, int nsteps, RowVector &tout, Matrix &xout)
 Fixed step size fourth-order Runge-Kutta integrator.
void Runge_Kutta4_Real_time (ReturnMatrix(*xdot)(Real time, const Matrix &xin), const Matrix &xo, Real to, Real tf, int nsteps)
void Runge_Kutta4_Real_time (ReturnMatrix(*xdot)(Real time, const Matrix &xin, bool &exit, bool &init), const Matrix &xo, Real to, Real tf, int nsteps)
 Fixed step size fourth-order Runge-Kutta integrator.
ReturnMatrix sign (const Matrix &x)
 Sign of a matrix.
short sign (const Real x)
 Sign of real.
ReturnMatrix trans (const ColumnVector &a)
 Translation.
ReturnMatrix x_prod_matrix (const ColumnVector &x)
 Cross product matrix.

Variables

const double epsilon = 0.0000001
Real fourbyfourident []
 Used to initialize a $4\times 4$ matrix.
static const char header_utils_rcsid [] = "$Id: utils.h,v 1.10 2006/05/16 16:11:15 gourdeau Exp $"
 RCS/CVS version.
Real threebythreeident []
 Used to initialize a $3\times 3$ matrix.

Define Documentation

#define GRAVITY   9.81

Definition at line 86 of file utils.h.

#define WANT_FSTREAM   /* include.h will get fstream fns */

Definition at line 69 of file utils.h.

#define WANT_MATH   /* include.h will get math fns */

Definition at line 70 of file utils.h.

#define WANT_STREAM   /* include.h will get stream fns */

Definition at line 68 of file utils.h.

#define WANT_STRING   /* include.h will get string fns */

Definition at line 67 of file utils.h.


Function Documentation

double deg2rad ( const double  angle_deg) [inline]

Definition at line 93 of file utils.h.

ReturnMatrix eulzxz ( const ColumnVector &  a)

Euler ZXZ rotation.

Definition at line 211 of file homogen.cpp.

ReturnMatrix ieulzxz ( const Matrix &  R)

Obtain Roll, Pitch and Yaw from a rotation matrix.

Definition at line 294 of file homogen.cpp.

ReturnMatrix Integ_Trap ( const ColumnVector &  present,
ColumnVector &  past,
const Real  dt 
)

Trapezoidal integration.

Definition at line 165 of file utils.cpp.

ReturnMatrix irotk ( const Matrix &  R)

Obtain axis from a rotation matrix.

Definition at line 253 of file homogen.cpp.

ReturnMatrix irpy ( const Matrix &  R)

Obtain Roll, Pitch and Yaw from a rotation matrix.

Definition at line 271 of file homogen.cpp.

bool isZero ( const double  x) [inline]

Definition at line 128 of file utils.h.

void odeint ( ReturnMatrix(*)(Real time, const Matrix &xin)  xdot,
Matrix &  xo,
Real  to,
Real  tf,
Real  eps,
Real  h1,
Real  hmin,
int &  nok,
int &  nbad,
RowVector &  tout,
Matrix &  xout,
Real  dtsav 
)

Integrate the ordinary differential equation xdot from time to to time tf using an adaptive step size strategy.

adapted from: Numerical Recipes in C, The Art of Scientific Computing, Press, William H. and Flannery, Brian P. and Teukolsky, Saul A. and Vetterling, William T., Cambridge University Press, 1988.

Definition at line 347 of file utils.cpp.

ReturnMatrix pinv ( const Matrix &  M)

Matrix pseudo inverse using SVD.

If $ A = U^{*}QV $ is a singular value decomposition of A, then $ A^{\dagger} = V^{*}Q^{\dagger}U$ where $ X^{*} $ is the conjugate transpose of $ X $ and $ Q^{\dagger} = \left [ \begin{array}{cccc} 1/\sigma_1 & & & \\ & 1/\sigma_2& & \\ & & \ddots & \\ & & & 0 \end{array} \right ]$ where the $1/\sigma_i $ are replaced by 0 when $1/\sigma_i < tol $

Definition at line 99 of file utils.cpp.

double rad2deg ( const double  angle_rad) [inline]

Definition at line 94 of file utils.h.

ReturnMatrix rotd ( const Real  theta,
const ColumnVector &  k1,
const ColumnVector &  k2 
)

Rotation around an arbitrary line.

Definition at line 240 of file homogen.cpp.

ReturnMatrix rotk ( const Real  theta,
const ColumnVector &  k 
)

Rotation around arbitrary axis.

Definition at line 149 of file homogen.cpp.

ReturnMatrix rotx ( const Real  alpha)

Rotation around x axis.

Definition at line 87 of file homogen.cpp.

ReturnMatrix roty ( const Real  beta)

Rotation around x axis.

Definition at line 107 of file homogen.cpp.

ReturnMatrix rotz ( const Real  gamma)

Rotation around z axis.

Definition at line 127 of file homogen.cpp.

ReturnMatrix rpy ( const ColumnVector &  a)

Roll Pitch Yaw rotation.

Definition at line 182 of file homogen.cpp.

void Runge_Kutta4 ( ReturnMatrix(*)(Real time, const Matrix &xin)  xdot,
const Matrix &  xo,
Real  to,
Real  tf,
int  nsteps,
RowVector &  tout,
Matrix &  xout 
)

Fixed step size fourth-order Runge-Kutta integrator.

Definition at line 232 of file utils.cpp.

void Runge_Kutta4_Real_time ( ReturnMatrix(*)(Real time, const Matrix &xin)  xdot,
const Matrix &  xo,
Real  to,
Real  tf,
int  nsteps 
)
void Runge_Kutta4_Real_time ( ReturnMatrix(*)(Real time, const Matrix &xin, bool &exit, bool &init xdot,
const Matrix &  xo,
Real  to,
Real  tf,
int  nsteps 
)

Fixed step size fourth-order Runge-Kutta integrator.

Definition at line 178 of file utils.cpp.

ReturnMatrix sign ( const Matrix &  x)

Sign of a matrix.

Definition at line 406 of file utils.cpp.

short sign ( const Real  x)

Sign of real.

Definition at line 425 of file utils.cpp.

ReturnMatrix trans ( const ColumnVector &  a)

Translation.

Definition at line 68 of file homogen.cpp.

ReturnMatrix x_prod_matrix ( const ColumnVector &  x)

Cross product matrix.

Definition at line 88 of file utils.cpp.


Variable Documentation

const double epsilon = 0.0000001

Definition at line 126 of file utils.h.

Used to initialize a $4\times 4$ matrix.

Definition at line 133 of file robot.cpp.

const char header_utils_rcsid[] = "$Id: utils.h,v 1.10 2006/05/16 16:11:15 gourdeau Exp $" [static]

RCS/CVS version.

Definition at line 60 of file utils.h.

Used to initialize a $3\times 3$ matrix.

Definition at line 136 of file robot.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


kni
Author(s): Neuronics AG (see AUTHORS.txt); ROS wrapper by Martin Günther
autogenerated on Tue May 28 2013 14:52:55