/home/laradmin/lar/bases/phua_haptic/src/miscellaneous.cpp File Reference

Miscellaneous functions implementation. More...

#include <miscellaneous.h>
Include dependency graph for miscellaneous.cpp:

Go to the source code of this file.

Functions

void CalculateAverageCartesianSpeed (double diffX, double diffY, double diffZ, long double time_interval, double *return_vector)
 Function acumulate position differences and calculate average speed.
double get_sign (double x)
 Function to determine sign of a given number.
double GetDblFromKeyboard (void)
 Gets a double number from keyboard input.
int GetNbrFromKeyboard (void)
 Gets a number from keyboard input.
char GetStrFromKeyboard (void)
 Gets a character from keyboard input.
void HighLightText (void)
 Make somesort of highlight text.
int isNumeric (const char *s)
 Function to check if string is numeric.
double pc_mean (double *v, int len)
 Function to calculate mean value of an array [Taken from http://rosettacode.org/].
void print_greeting (shared_vars_t *RobotVars)
 Prints to stdout the program greeting.
void print_help (void)
 Prints to stdout the program help tips.
void PrintRedLine (void)
 Printf of an horizontal separator red line.
void ResetTextColors (void)
 Reset color text.
Eigen::Matrix3d rotx (double angle_in_degrees)
 Function to calculate rotation matrix over the X axis.
Eigen::Matrix3d roty (double angle_in_degrees)
 Function to calculate rotation matrix over the Y axis.
Eigen::Matrix3d rotz (double angle_in_degrees)
 Function to calculate rotation matrix over the Z axis.
void ScreenClear (void)
 Sends equivalent shell command "clean" to stdout.
void textcolor (int attr, int fg, int bg)
 FUNCTIONS CREATED BY VITOR SANTOS(vitor@ua.pt) | ALL CREDITS GO TO HIM... :-).

Detailed Description

Miscellaneous functions implementation.

Definition in file miscellaneous.cpp.


Function Documentation

void CalculateAverageCartesianSpeed ( double  diffX,
double  diffY,
double  diffZ,
long double  time_interval,
double *  return_vector 
)

Function acumulate position differences and calculate average speed.

This function stores position diffencial values and calculates mean value over time.

Parameters:
[in] diffX xx axis position differences.
[in] diffY yy axis position differences.
[in] diffZ zz axis position differences.
[in] time_interval time intervals of each given space differences.
[out] return_vector destination return array.
Returns:
none.

Definition at line 121 of file miscellaneous.cpp.

double get_sign ( double  x  ) 

Function to determine sign of a given number.

This function determines the sign of a number and return -1 or 1, for negative or positive respectively.

Parameters:
[in] x number to evaluate.
Returns:
-1 for negative, 1 for positive.

Definition at line 254 of file miscellaneous.cpp.

double GetDblFromKeyboard ( void   ) 

Gets a double number from keyboard input.

This function retrieves a double number from a keyboard input.

Returns:
returns a double number from input.

Definition at line 275 of file miscellaneous.cpp.

int GetNbrFromKeyboard ( void   ) 

Gets a number from keyboard input.

This function retrieves a number from a keyboard input.

Returns:
returns an integer from input.

Definition at line 259 of file miscellaneous.cpp.

char GetStrFromKeyboard ( void   ) 

Gets a character from keyboard input.

This function retrieves a character from a keyboard input.

Returns:
returns a character from input.

Definition at line 267 of file miscellaneous.cpp.

void HighLightText ( void   ) 

Make somesort of highlight text.

Returns:
Nothing

Definition at line 308 of file miscellaneous.cpp.

int isNumeric ( const char *  s  ) 

Function to check if string is numeric.

Returns true (non-zero) if character-string parameter represents a signed or unsigned floating-point number. Otherwise returns false (zero). [Taken from http://rosettacode.org/] | my edit: strtod() warning supression

Parameters:
[in] s a const char array to evaluate.
Returns:
true (non-zero) / otherwise returns false (zero).

Definition at line 244 of file miscellaneous.cpp.

double pc_mean ( double *  v,
int  len 
)

Function to calculate mean value of an array [Taken from http://rosettacode.org/].

Parameters:
[in] v pointer to the array to calculate.
[in] len lenght of array elements to use in the calculation.
Returns:
mean value calculated.

Definition at line 235 of file miscellaneous.cpp.

void print_greeting ( shared_vars_t RobotVars  ) 

Prints to stdout the program greeting.

This function prints to stdout a greeting message.

Parameters:
[in] RobotVars structure defined in types.h with the joint values.

Definition at line 91 of file miscellaneous.cpp.

void print_help ( void   ) 

Prints to stdout the program help tips.

This function prints to stdout a set of program help tips.

Definition at line 37 of file miscellaneous.cpp.

void PrintRedLine ( void   ) 

Printf of an horizontal separator red line.

Returns:
Nothing

Definition at line 294 of file miscellaneous.cpp.

void ResetTextColors ( void   ) 

Reset color text.

Returns:
Nothing

Definition at line 303 of file miscellaneous.cpp.

Eigen::Matrix3d rotx ( double  angle_in_degrees  ) 

Function to calculate rotation matrix over the X axis.

Parameters:
[in] angle_in_degrees angle for rotation.
Returns:
rotation matrix.

Definition at line 157 of file miscellaneous.cpp.

Eigen::Matrix3d roty ( double  angle_in_degrees  ) 

Function to calculate rotation matrix over the Y axis.

Parameters:
[in] angle_in_degrees angle for rotation.
Returns:
rotation matrix.

Definition at line 183 of file miscellaneous.cpp.

Eigen::Matrix3d rotz ( double  angle_in_degrees  ) 

Function to calculate rotation matrix over the Z axis.

Parameters:
[in] angle_in_degrees angle for rotation.
Returns:
rotation matrix.

Definition at line 209 of file miscellaneous.cpp.

void ScreenClear ( void   ) 

Sends equivalent shell command "clean" to stdout.

Returns:
none.

Definition at line 283 of file miscellaneous.cpp.

void textcolor ( int  attr,
int  fg,
int  bg 
)

FUNCTIONS CREATED BY VITOR SANTOS(vitor@ua.pt) | ALL CREDITS GO TO HIM... :-).

Set the color of text that follows

Parameters:
[in] attr Type of attribute (RESET, BRIGHT, BLINK, etc...
[in] fg Color of foreground
[in] bg Color of background
Returns:
Nothing

Definition at line 289 of file miscellaneous.cpp.

 All Classes Files Functions Variables Defines


phua_haptic
Author(s): Pedro Cruz
autogenerated on Wed Jul 23 04:33:53 2014