![]() |
An open-source, flexible 3D physical simulation framework
|
Classes | |
class | Color |
class | Mutex |
class | MutexLocker |
struct | PthreadConditionWrapper |
struct | PthreadMutexWrapper |
struct | PthreadReadWriteLockWrapper |
struct | PthreadThreadWrapper |
class | ReadWriteLock |
class | ReadWriteLocker |
struct | sRotation |
class | TCPBaseSocket |
class | TCPConnection |
class | TCPServer |
class | Thread |
class | WaitCondition |
Typedefs | |
typedef Eigen::Quaternion< double, Eigen::DontAlign > | Quaternion |
typedef Eigen::Matrix< double, 3, 1, Eigen::DontAlign > | Vector |
typedef Eigen::Matrix< double, 3, 3, Eigen::DontAlign > | Tensor |
Functions | |
ApproximationFunction | getApproximationFunctionFromString (std::string s) |
ApproximationFunction2D | getApproximationFunction2DFromString (std::string s) |
double | pipe (double *x, std::vector< double > *c) |
double | polynom2 (double *x, std::vector< double > *c) |
double | polynom3 (double *x, std::vector< double > *c) |
double | polynom4 (double *x, std::vector< double > *c) |
double | polynom5 (double *x, std::vector< double > *c) |
double | gaussian (double *x, std::vector< double > *c) |
double | polynom2D1 (double *x, double *y, std::vector< double > *c) |
double | polynom2D2 (double *x, double *y, std::vector< double > *c) |
double | getYaw (const Quaternion &q) |
double | angleBetween (const Vector &v1, const Vector &v2, Vector *axis=NULL) |
Angle between two vectors. More... | |
Quaternion | eulerToQuaternion (const Vector &euler_v) |
sRotation | quaternionTosRotation (const Quaternion &value) |
Vector | slerp (const Vector &from, const Vector &to, double t) |
Vector | lerp (const Vector &from, const Vector &to, double t) |
void | vectorToSpherical (const Vector &v, double *r, double *theta, double *phi) |
Vector | getProjection (const Vector &v1, const Vector &v2) |
Vector | vectorFromSpherical (double r, double theta, double phi) |
bool | vectorFromConfigItem (ConfigItem *item, Vector *v) |
void | vectorToConfigItem (ConfigItem *item, Vector *v) |
bool | quaternionFromConfigItem (ConfigItem *item, Quaternion *q) |
void | quaternionToConfigItem (ConfigItem *item, Quaternion *q) |
void | inertiaTensorToConfigItem (ConfigItem *item, double *inertia) |
double | random_number (double min, double max, int digits) |
double | random_normal_number (double mean, double std, double low, double high) |
double | beta_distribution (double *x, std::vector< double > *c) |
double | gamma_distribution (double *x, std::vector< double > *c) |
bool | isNormalized (const Vector &vec) |
Vector | scaleVectorToLength (const Vector &vec, const double &length) |
Quaternion | angleAxisToQuaternion (double angle, const Vector &axis) |
Quaternion | eulerToQuaternion (const sRotation &rot) |
double | distanceSquaredBetween (const Vector &v1, const Vector &v2) |
double | distanceBetween (const Vector &v1, const Vector &v2) |
template<typename T > | |
Quaternion | quaternionFromMembers (T q) |
template<typename T > | |
Quaternion | quaternionFromXYZWArray (T q) |
template<typename T > | |
Quaternion | quaternionFromWXYZArray (T q) |
bool | matchPattern (const std::string &pattern, const std::string &str) |
basic pattern matching function More... | |
std::string | trim (const std::string &str) |
remove leading and trailing whitespaces More... | |
void | handleFilenamePrefix (std::string *file, const std::string &prefix) |
std::string | pathJoin (const std::string &path1, const std::string &path2) |
void | removeFilenamePrefix (std::string *file) |
given a filepath "bla/da/fnord/foobar.baz" this will remove everything before and including the last slash "/" resulting in "foobar.baz". More... | |
void | removeFilenameSuffix (std::string *file) |
given a filename "foobar.baz" this will remove the extension (including the dot ".") resulting in "foobar". More... | |
std::string | getFilenameSuffix (const std::string &file) |
given a filename "foobar.baz" this will return ".baz" More... | |
std::string | getCurrentWorkingDir () |
std::string | getPathOfFile (const std::string &filename) |
unsigned int | createDirectory (const std::string &dir, int mode=0755) |
creates a directory at the given path. More... | |
std::vector< std::string > | explodeString (const char c, const std::string &s) |
std::string | replaceString (const std::string &source, const std::string &s1, const std::string &s2) |
std::string | toupper (const std::string &s) |
std::string | tolower (const std::string &s) |
double | radToDeg (const double &r) |
converts an angle given in radians to degrees. More... | |
float | radToDeg (const float &r) |
double | degToRad (const double &d) |
converts an angle given in degrees to radians. More... | |
float | degToRad (const float &d) |
template<typename T > | |
std::string | numToStr (T Number) |
long long | getTime () |
long long | getTimeDiff (long long start) |
returns the time difference between now and a given reference. More... | |
void | msleep (unsigned int milliseconds) |
sleeps for at least the specified time. More... | |
bool | pathExists (const std::string &path) |
check whether a file or directory exists. More... | |
void | ZERO_ROTATION (sRotation &a) |
unsigned short | ntoh (const unsigned short &val) |
unsigned long | ntoh (const unsigned long &val) |
unsigned short | hton (const unsigned short &val) |
unsigned long | hton (const unsigned long &val) |
bool | isBigEndian () |
Variables | |
static const int | EULER_AXIS_1 = 2 |
static const int | EULER_AXIS_2 = 0 |
static const int | EULER_AXIS_3 = 1 |
const double | SQRT2PI = 2.5066282746310002 |
const double | EPSILON = Eigen::NumTraits<double>::epsilon() |
const int | INVALID_SOCKET = -1 |
const double | defaultTimeout = -1. |
typedef Eigen::Quaternion<double, Eigen::DontAlign> mars::utils::Quaternion |
Definition at line 56 of file Quaternion.h.
typedef Eigen::Matrix<double, 3, 3, Eigen::DontAlign> mars::utils::Tensor |
typedef Eigen::Matrix<double, 3, 1, Eigen::DontAlign> mars::utils::Vector |
Enumerator | |
---|---|
FUNCTION_PIPE | |
FUNCTION_POLYNOM2 | |
FUNCTION_POLYNOM3 | |
FUNCTION_POLYNOM4 | |
FUNCTION_POLYNOM5 | |
FUNCTION_GAUSSIAN | |
FUNCTION_UNKNOWN |
Definition at line 35 of file mathUtils.h.
Enumerator | |
---|---|
FUNCTION_UNKNOWN2D | |
FUNCTION_POLYNOM2D1 | |
FUNCTION_POLYNOM2D2 |
Definition at line 47 of file mathUtils.h.
Enumerator | |
---|---|
READWRITELOCK_MODE_READ | |
READWRITELOCK_MODE_WRITE |
Definition at line 27 of file ReadWriteLocker.h.
Enumerator | |
---|---|
WAITCOND_NO_ERROR | |
WAITCOND_TIMEOUT | |
WAITCOND_UNSPECIFIED | |
WAITCOND_INTERNAL_ERROR | |
WAITCOND_UNKNOWN |
Definition at line 31 of file WaitCondition.h.
|
inline |
Definition at line 88 of file mathUtils.h.
Angle between two vectors.
[in] | v | Vector to which we want to know the angle |
[out] | axis | If axis != NULL the axis of rotation will be stored here. |
this
and v in radian. Definition at line 107 of file mathUtils.cpp.
double mars::utils::beta_distribution | ( | double * | x, |
std::vector< double > * | c | ||
) |
unsigned int mars::utils::createDirectory | ( | const std::string & | dir, |
int | mode = 0755 |
||
) |
|
inline |
Definition at line 103 of file mathUtils.h.
Definition at line 101 of file mathUtils.h.
|
inline |
Definition at line 93 of file mathUtils.h.
Quaternion mars::utils::eulerToQuaternion | ( | const Vector & | euler_v | ) |
Definition at line 133 of file mathUtils.cpp.
std::vector< std::string > mars::utils::explodeString | ( | const char | c, |
const std::string & | s | ||
) |
double mars::utils::gamma_distribution | ( | double * | x, |
std::vector< double > * | c | ||
) |
double mars::utils::gaussian | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 74 of file mathUtils.cpp.
ApproximationFunction2D mars::utils::getApproximationFunction2DFromString | ( | std::string | s | ) |
Definition at line 43 of file mathUtils.cpp.
ApproximationFunction mars::utils::getApproximationFunctionFromString | ( | std::string | s | ) |
Definition at line 33 of file mathUtils.cpp.
std::string mars::utils::getFilenameSuffix | ( | const std::string & | file | ) |
std::string mars::utils::getPathOfFile | ( | const std::string & | filename | ) |
Definition at line 253 of file mathUtils.cpp.
|
inline |
|
inline |
double mars::utils::getYaw | ( | const Quaternion & | q | ) |
Definition at line 102 of file mathUtils.cpp.
void mars::utils::handleFilenamePrefix | ( | std::string * | file, |
const std::string & | prefix | ||
) |
unsigned short mars::utils::hton | ( | const unsigned short & | val | ) |
Definition at line 64 of file Socket.cpp.
unsigned long mars::utils::hton | ( | const unsigned long & | val | ) |
Definition at line 66 of file Socket.cpp.
void mars::utils::inertiaTensorToConfigItem | ( | ConfigItem * | item, |
double * | inertia | ||
) |
Definition at line 295 of file mathUtils.cpp.
bool mars::utils::isBigEndian | ( | ) |
Definition at line 69 of file Socket.cpp.
|
inline |
Definition at line 72 of file mathUtils.h.
Definition at line 235 of file mathUtils.cpp.
bool mars::utils::matchPattern | ( | const std::string & | pattern, |
const std::string & | str | ||
) |
basic pattern matching function
pattern | The pattern that should be found in str. |
str | The string in which to search for the pattern. |
true
if pattern is found in str. false
otherwiseThe pattern may contain the wildcard "*" (asterisk) to mean zero or more of any character. Other wildcards are currently not supported. Examples:
|
inline |
unsigned short mars::utils::ntoh | ( | const unsigned short & | val | ) |
Definition at line 60 of file Socket.cpp.
unsigned long mars::utils::ntoh | ( | const unsigned long & | val | ) |
Definition at line 62 of file Socket.cpp.
std::string mars::utils::numToStr | ( | T | Number | ) |
|
inline |
std::string mars::utils::pathJoin | ( | const std::string & | path1, |
const std::string & | path2 | ||
) |
double mars::utils::pipe | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 50 of file mathUtils.cpp.
double mars::utils::polynom2 | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 54 of file mathUtils.cpp.
double mars::utils::polynom2D1 | ( | double * | x, |
double * | y, | ||
std::vector< double > * | c | ||
) |
Definition at line 87 of file mathUtils.cpp.
double mars::utils::polynom2D2 | ( | double * | x, |
double * | y, | ||
std::vector< double > * | c | ||
) |
Definition at line 92 of file mathUtils.cpp.
double mars::utils::polynom3 | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 58 of file mathUtils.cpp.
double mars::utils::polynom4 | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 62 of file mathUtils.cpp.
double mars::utils::polynom5 | ( | double * | x, |
std::vector< double > * | c | ||
) |
Definition at line 67 of file mathUtils.cpp.
bool mars::utils::quaternionFromConfigItem | ( | ConfigItem * | item, |
Quaternion * | q | ||
) |
Definition at line 280 of file mathUtils.cpp.
Quaternion mars::utils::quaternionFromMembers | ( | T | q | ) |
Definition at line 119 of file mathUtils.h.
Quaternion mars::utils::quaternionFromWXYZArray | ( | T | q | ) |
Definition at line 129 of file mathUtils.h.
Quaternion mars::utils::quaternionFromXYZWArray | ( | T | q | ) |
Definition at line 124 of file mathUtils.h.
void mars::utils::quaternionToConfigItem | ( | ConfigItem * | item, |
Quaternion * | q | ||
) |
Definition at line 288 of file mathUtils.cpp.
sRotation mars::utils::quaternionTosRotation | ( | const Quaternion & | value | ) |
Definition at line 163 of file mathUtils.cpp.
|
inline |
double mars::utils::random_normal_number | ( | double | mean, |
double | std, | ||
double | low, | ||
double | high | ||
) |
Definition at line 313 of file mathUtils.cpp.
double mars::utils::random_number | ( | double | min, |
double | max, | ||
int | digits | ||
) |
Definition at line 307 of file mathUtils.cpp.
void mars::utils::removeFilenamePrefix | ( | std::string * | file | ) |
void mars::utils::removeFilenameSuffix | ( | std::string * | file | ) |
std::string mars::utils::replaceString | ( | const std::string & | source, |
const std::string & | s1, | ||
const std::string & | s2 | ||
) |
Definition at line 75 of file mathUtils.h.
Definition at line 195 of file mathUtils.cpp.
std::string mars::utils::trim | ( | const std::string & | str | ) |
bool mars::utils::vectorFromConfigItem | ( | ConfigItem * | item, |
Vector * | v | ||
) |
Definition at line 267 of file mathUtils.cpp.
Vector mars::utils::vectorFromSpherical | ( | double | r, |
double | theta, | ||
double | phi | ||
) |
Definition at line 261 of file mathUtils.cpp.
void mars::utils::vectorToConfigItem | ( | ConfigItem * | item, |
Vector * | v | ||
) |
Definition at line 274 of file mathUtils.cpp.
void mars::utils::vectorToSpherical | ( | const Vector & | v, |
double * | r, | ||
double * | theta, | ||
double * | phi | ||
) |
Definition at line 242 of file mathUtils.cpp.
|
inline |
Definition at line 52 of file Quaternion.h.
const double mars::utils::EPSILON = Eigen::NumTraits<double>::epsilon() |
Definition at line 70 of file mathUtils.h.
|
static |
Definition at line 98 of file mathUtils.cpp.
|
static |
Definition at line 99 of file mathUtils.cpp.
|
static |
Definition at line 100 of file mathUtils.cpp.
const double mars::utils::SQRT2PI = 2.5066282746310002 |
Definition at line 57 of file mathUtils.h.