calc_plate1_frame.cpp File Reference

Function to calculate the homogenous transformation matrix for base link of collar. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <vector>
#include "lowerleg_struct.h"
#include "lowerleg_func.h"
#include "postprocess.h"
Include dependency graph for calc_plate1_frame.cpp:
This graph shows which files directly or indirectly include this file:

Defines

#define MAX_OPTI_PER_LINK   8
 Maximum number of optical sensors per link is 8 (since there aren't as many attachment points)

Functions

int calc_link_frame_opti (tibia &tib, string linkname, int fr_num, gsl_matrix *M)
 Calculate transformation matrix relating base link frame to global frame using optical marker data.
int calc_trans_mat (double Ploc[], double Pglob[], gsl_matrix *H)
 Given coordinates of 3 points in 2 frames, calculate transformation matrix relating them.
int DHtoFix (vector< double > &firstlink, gsl_matrix *DHF)
 calc first link matrix.
int DH_hayati (double beta, double alpha, double a, double theta, gsl_matrix *DHayati)
 Calculate transformation matrix using Hayati representation of DH parameters.
int calc_transf_matrix (gsl_matrix *Matlink, int linknumber, vector< vector< double > > &Hprev, vector< vector< double > > &Pvals, vector< vector< double > > &qvals, vector< double > &firstlink)
 Calculate overall transformation matrix, from first link (left-most) to the current link (specified by link number).
int gsl_pt_quat_matrix (vector< double > &Pvals, vector< double > &qvals, gsl_matrix *MatOP)
int get_link_number (collar &col, string linkname)
 Get the link number. ie plate number from the leftmost plate.

Detailed Description

Function to calculate the homogenous transformation matrix for base link of collar.


Define Documentation

#define MAX_OPTI_PER_LINK   8

Maximum number of optical sensors per link is 8 (since there aren't as many attachment points)

Referenced by calc_link_frame_opti().


Function Documentation

int calc_link_frame_opti ( tibia tib,
string  linkname,
int  fr_num,
gsl_matrix *  M 
)

Calculate transformation matrix relating base link frame to global frame using optical marker data.

This function reads data from the config file and 3d tracking data obtained from optical markers to calculate the 4x4 transformation matrix that relates the link fixed frame to the global frame. The function takes in the structure tibia, which contains config data and the measured data, and the name of the link which is to be considered the base.

Since the OptiTrack system records data at a frame rate of 100Hz and stores it referencing the frame number, the frame number is also taken in as input.

Parameters:
[in]tibThe tibia structure holding all info
[in]linknameThe name of the link that is to be treated as the base link
[in]fr_numThe frame number for which the measured data is taken for calculations
[out]MThe 4x4 transformation matrix such that Ploc = M*pglob where, plocal are the coordinates of a point in the link frame, and pglob are the coordinates of the point in global frame.

number of sensors on the plate linkname

References calc_trans_mat(), sensor::LINK_label, MAX_OPTI_PER_LINK, sensor::mdata, tibia::opti_count, tibia::optical, sensor::xa, sensor::ya, and sensor::za.

Here is the call graph for this function:

int calc_trans_mat ( double  Ploc[],
double  Pglob[],
gsl_matrix *  H 
)

Given coordinates of 3 points in 2 frames, calculate transformation matrix relating them.

Parameters:
[in]Ploc9x1 array with coordinates of 3 points in local frame, concatanated together.
[in]Pglob9x1 array with coordinates of 3 points in global frame, concatanated together.
[out]H4x4 transformation matrix such that plocal = H*pglobal, where plocal and pglobal are the co-ordinates expressed as homogenous 4x1 vectors

References gramSchmidt().

Referenced by calc_link_frame_opti(), and calc_mario_frame_opti().

Here is the call graph for this function:

Here is the caller graph for this function:

int calc_transf_matrix ( gsl_matrix *  Matlink,
int  linknumber,
vector< vector< double > > &  Hprev,
vector< vector< double > > &  Pvals,
vector< vector< double > > &  qvals,
vector< double > &  firstlink 
)

Calculate overall transformation matrix, from first link (left-most) to the current link (specified by link number).

Calculate the matrix to transform local co-ordinates in link/plate frame i (from left) to co-ordinates expressed in the left-most frame of the collar.

References DH_hayati(), DHtoFix(), and gsl_pt_quat_matrix().

Referenced by calc_pts_in_collar_base_frame().

Here is the call graph for this function:

Here is the caller graph for this function:

int DH_hayati ( double  beta,
double  alpha,
double  a,
double  theta,
gsl_matrix *  DHayati 
)

Calculate transformation matrix using Hayati representation of DH parameters.

References gsl_hom_matrix(), rotX(), rotY(), and rotZ().

Referenced by calc_transf_matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

int DHtoFix ( vector< double > &  firstlink,
gsl_matrix *  DHF 
)

calc first link matrix.

References gsl_hom_matrix(), rotX(), and rotZ().

Referenced by calc_collar_angles(), and calc_transf_matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

int get_link_number ( collar col,
string  linkname 
)

Get the link number. ie plate number from the leftmost plate.

References NB_LINKS_MAX, collar::shape_left, and collar::shape_right.

Referenced by calc_pts_in_collar_base_frame().

Here is the caller graph for this function:

int gsl_pt_quat_matrix ( vector< double > &  Pvals,
vector< double > &  qvals,
gsl_matrix *  MatOP 
)

References gsl_hom_matrix(), and gsl_rodrigues_to_rot().

Referenced by calc_transf_matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Typedefs Defines