49 #error Must use C++ for the type Robot 59 static const char header_utils_rcsid[] =
"$Id: utils.h,v 1.10 2006/05/16 16:11:15 gourdeau Exp $";
62 #ifdef _MSC_VER // Microsoft 63 #pragma warning (disable:4786) 79 using namespace NEWMAT;
83 #define M_PI 3.14159265358979 93 inline double deg2rad(
const double angle_deg){
return angle_deg*
M_PI/180; }
94 inline double rad2deg(
const double angle_rad){
return angle_rad*180/
M_PI; }
114 bool & exit,
bool & init),
119 int & nok,
int & nbad,
130 if ( fabs(x) < epsilon)
ReturnMatrix x_prod_matrix(const ColumnVector &x)
Cross product matrix.
ReturnMatrix rotx(const Real alpha)
Rotation around x axis.
static const char header_utils_rcsid[]
RCS/CVS version.
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...
ReturnMatrix roty(const Real beta)
Rotation around x axis.
ReturnMatrix rotz(const Real gamma)
Rotation around z axis.
ReturnMatrix eulzxz(const ColumnVector &a)
Euler ZXZ rotation.
ReturnMatrix sign(const Matrix &x)
Sign of a matrix.
ReturnMatrix irpy(const Matrix &R)
Obtain Roll, Pitch and Yaw from a rotation matrix.
bool isZero(const double x)
ReturnMatrix irotk(const Matrix &R)
Obtain axis from a rotation matrix.
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.
ReturnMatrix rotd(const Real theta, const ColumnVector &k1, const ColumnVector &k2)
Rotation around an arbitrary line.
void Runge_Kutta4_Real_time(ReturnMatrix(*xdot)(Real time, const Matrix &xin), const Matrix &xo, Real to, Real tf, int nsteps)
ReturnMatrix trans(const ColumnVector &a)
Translation.
The usual rectangular matrix.
FloatVector FloatVector * a
FloatVector FloatVector FloatVector * alpha
ReturnMatrix xdot(Real t, const Matrix &x)
ReturnMatrix ieulzxz(const Matrix &R)
Obtain Roll, Pitch and Yaw from a rotation matrix.
double rad2deg(const double angle_rad)
Real threebythreeident[]
Used to initialize a matrix.
ReturnMatrix pinv(const Matrix &M)
Matrix pseudo inverse using SVD.
ReturnMatrix rotk(const Real theta, const ColumnVector &k)
Rotation around arbitrary axis.
double deg2rad(const double angle_deg)
ReturnMatrix Integ_Trap(const ColumnVector &present, ColumnVector &past, const Real dt)
Trapezoidal integration.
Real fourbyfourident[]
Used to initialize a matrix.