SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Functions
scl_util Namespace Reference

Functions

void printRobotLinkTree (const SRigidBody &link, int depth)
 
int initMultiTaskCtrlDsFromParsedTasks (const std::vector< scl::STaskBase * > &arg_taskvec, const std::vector< scl::SNonControlTaskBase * > &arg_taskvec_nc, scl::SControllerMultiTask &ret_ctrl)
 
bool initDynRobotFromParsedRobot (sutil::CMappedTree< std::string, scl::SRigidBodyDyn > &arg_rbd_tree, const sutil::CMappedTree< std::string, scl::SRigidBody > &arg_rb_tree)
 
sBool isMuscleCompatWithRobot (const std::string &arg_msys, const std::string &arg_robot)
 
bool readEigenVecFromFile (Eigen::VectorXd &arg_vec, const std::string &arg_file)
 
bool readEigenVecFromFile (Eigen::VectorXd &arg_vec, const int len, const std::string &arg_file)
 
bool writeEigenVecToFile (const Eigen::VectorXd &arg_vec, const std::string &arg_file)
 
bool readEigenMatFromFile (Eigen::MatrixXd &arg_mat, const std::string &arg_file)
 
bool readEigenMatFromFile (Eigen::MatrixXd &arg_mat, unsigned long arg_rows, unsigned long arg_cols, const std::string &arg_file)
 
bool writeEigenMatToFile (const Eigen::MatrixXd &arg_mat, const std::string &arg_file)
 
bool readEigenVecFromFile (Eigen::VectorXd &arg_vec, const long len, const std::string &arg_file)
 
unsigned int countNumbersInString (const char *ss)
 
bool isStringInVector (const std::string &arg_str, const std::vector< std::string > &arg_vec)
 
bool getCurrentDir (std::string &arg_cwd)
 

Detailed Description

A random collection of string manipulation, os-specific etc. functions.

NOTE TODO : Feel free to add other useful functions...

Function Documentation

bool scl_util::initDynRobotFromParsedRobot ( sutil::CMappedTree< std::string, scl::SRigidBodyDyn > &  arg_rbd_tree,
const sutil::CMappedTree< std::string, scl::SRigidBody > &  arg_rb_tree 
)

Initializes a dynamic tree given a static tree for a robot.

int scl_util::initMultiTaskCtrlDsFromParsedTasks ( const std::vector< scl::STaskBase * > &  arg_taskvec,
const std::vector< scl::SNonControlTaskBase * > &  arg_taskvec_nc,
scl::SControllerMultiTask ret_ctrl 
)

Checks whether dynamic type information is available. If so, it parses tasks into the control data structure

scl::sBool scl_util::isMuscleCompatWithRobot ( const std::string &  arg_msys,
const std::string &  arg_robot 
)

Checks if a muscle system is compatible with a given robot. Looks for both in the database

void scl_util::printRobotLinkTree ( const scl::SRigidBody link,
scl::sInt  depth 
)

Prints a robot link tree with a passed link as its root.

bool scl_util::readEigenMatFromFile ( Eigen::MatrixXd &  arg_mat,
const std::string &  arg_file 
)

Reads an eigen matrix of doubles from a file

The file should have a vector in each line: x11 x12 ... x21 x22 ...

Parameters
arg_mat: The data is loaded in to this matrix
arg_file: The filename
Returns

Count the width of a single line.

bool scl_util::readEigenMatFromFile ( Eigen::MatrixXd &  arg_mat,
unsigned long  arg_rows,
unsigned long  arg_cols,
const std::string &  arg_file 
)

Reads an eigen matrix of doubles from a file

The file should have a vector in each line: x11 x12 ... x21 x22 ...

Parameters
arg_mat: The data is loaded in to this matrix
arg_rows: The number of rows to read
arg_cols: The number of columns to read
arg_file: The filename
Returns
bool scl_util::readEigenVecFromFile ( Eigen::VectorXd &  arg_vec,
const std::string &  arg_file 
)

Function reads a vector from a file. The file should have a val in each line: x1 x2 x3 ...

bool scl_util::readEigenVecFromFile ( Eigen::VectorXd &  arg_vec,
const long  len,
const std::string &  arg_file 
)

Function reads a vector from a file. The file should have a val in each line: x1 x2 x3 ...

bool scl_util::writeEigenMatToFile ( const Eigen::MatrixXd &  arg_mat,
const std::string &  arg_file 
)

Writes an eigen matrix of doubles to a file

Parameters
arg_vec: The data to be written to disk
arg_file: The filename
Returns
bool scl_util::writeEigenVecToFile ( const Eigen::VectorXd &  arg_vec,
const std::string &  arg_file 
)

Writes an eigen vector of doubles to a file

Parameters
arg_vec: The data to be written to disk
arg_file: The filename
Returns