XBotInterface  2.4.1
XBotInterface provides a generic API to model and control a robot.
Classes | Functions
XBot::Utils Namespace Reference

Classes

class  LimitedDeque
 
class  SecondOrderFilter
 SecondOrderFilter implements a canonical continuous-time second order filter with transfer function 1 P(s) = --------------------—, w = natural frequency, eps = damping ratio (s/w)^2 + 2*eps/w*s + 1. More...
 
class  SecondOrderFilterArray
 

Functions

Eigen::Matrix3d skewSymmetricMatrix (const Eigen::Vector3d &v)
 Computes a matrix S such that S(a)b = a x b. More...
 
void computeOrientationError (const Eigen::Matrix3d &ref, const Eigen::Matrix3d &actual, Eigen::Vector3d &error)
 Computes an orientation error between two frames such that an angular velocity K*e (K > 0) brings "actual" towards "ref". More...
 
void FifthOrderTrajectory (const double init_time, const Eigen::VectorXd &_startPosture, const Eigen::VectorXd &_targetPosture, const double _max_vel, const double traj_time, Eigen::VectorXd &ref, Eigen::VectorXd &ref_dot, double &_duration_)
 
void ThirdOrderTrajectory (const double init_time, const double init_pos, const double final_pos, const double max_vel, const double traj_time, double &ref, double &ref_dot, double &duration)
 
std::string exec (const char *cmd)
 exec runs a command inside the shell, and returns the output More...
 
std::string computeAbsolutePath (const std::string &input_path)
 Computes the absolute path corresponging to a given path relative to the $XBOT_ROOT environment variable. More...
 
std::string computeAbsolutePathShell (std::string input_path, std::string wd=".")
 computeAbsolutePathShell expands the provided path by using the system shell before pre-pending the XBOT_ROOT value More...
 
std::string getXBotConfig ()
 getter for the default XBot config file set by the env variable $XBOT_CONFIG More...
 
Eigen::Matrix6d GetAdjointFromRotation (const Eigen::Matrix3d &R)
 
void FifthOrderPlanning (double x0, double dx0, double ddx0, double goal, double start_time, double end_time, double time, double &x, double &dx, double &ddx)
 
bool ReadFile (std::string path_to_file, std::string &file)
 
std::string GetTimeAsString ()
 

Function Documentation

◆ computeAbsolutePath()

std::string XBot::Utils::computeAbsolutePath ( const std::string &  input_path)
inline

Computes the absolute path corresponging to a given path relative to the $XBOT_ROOT environment variable.

◆ computeAbsolutePathShell()

std::string XBot::Utils::computeAbsolutePathShell ( std::string  input_path,
std::string  wd = "." 
)
inline

computeAbsolutePathShell expands the provided path by using the system shell before pre-pending the XBOT_ROOT value

◆ computeOrientationError()

void XBot::Utils::computeOrientationError ( const Eigen::Matrix3d &  ref,
const Eigen::Matrix3d &  actual,
Eigen::Vector3d &  error 
)
inline

Computes an orientation error between two frames such that an angular velocity K*e (K > 0) brings "actual" towards "ref".

Parameters
refReference orientation
actualCurrent orientation
errorThe orientation error between ref and actual
Returns
void

◆ exec()

std::string XBot::Utils::exec ( const char *  cmd)
inline

exec runs a command inside the shell, and returns the output

◆ FifthOrderPlanning()

void XBot::Utils::FifthOrderPlanning ( double  x0,
double  dx0,
double  ddx0,
double  goal,
double  start_time,
double  end_time,
double  time,
double &  x,
double &  dx,
double &  ddx 
)
inline

◆ FifthOrderTrajectory()

void XBot::Utils::FifthOrderTrajectory ( const double  init_time,
const Eigen::VectorXd &  _startPosture,
const Eigen::VectorXd &  _targetPosture,
const double  _max_vel,
const double  traj_time,
Eigen::VectorXd &  ref,
Eigen::VectorXd &  ref_dot,
double &  _duration_ 
)
inline

◆ GetAdjointFromRotation()

Eigen::Matrix6d XBot::Utils::GetAdjointFromRotation ( const Eigen::Matrix3d &  R)
inline

◆ GetTimeAsString()

std::string XBot::Utils::GetTimeAsString ( )
inline

◆ getXBotConfig()

std::string XBot::Utils::getXBotConfig ( )
inline

getter for the default XBot config file set by the env variable $XBOT_CONFIG

◆ ReadFile()

bool XBot::Utils::ReadFile ( std::string  path_to_file,
std::string &  file 
)
inline

◆ skewSymmetricMatrix()

Eigen::Matrix3d XBot::Utils::skewSymmetricMatrix ( const Eigen::Vector3d &  v)
inline

Computes a matrix S such that S(a)b = a x b.

Parameters
vA 3D vector
Returns
The skew symmetric matrix which represents a vector product by v

◆ ThirdOrderTrajectory()

void XBot::Utils::ThirdOrderTrajectory ( const double  init_time,
const double  init_pos,
const double  final_pos,
const double  max_vel,
const double  traj_time,
double &  ref,
double &  ref_dot,
double &  duration 
)
inline