test_IPKF

Dependencies:   mbed

header/kinematic.h

Committer:
LudovicoDani
Date:
2016-04-20
Revision:
0:fb6e494a7656

File content as of revision 0:fb6e494a7656:

/********************************************//**
 * @brief
 * @file kinematic.h
 * @author Daniele Ludovico, Fiorella Sibona
 * @date 12/04/2016
 * @brief File containing the function to compute the
 * kinematic function of a robotic arm.
 *
 */

#ifndef KINEMATIC_H_INCLUDED
#define KINEMATIC_H_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

#include <math.h>
#include "matrix.h"
#include "params.h"


/********************************************//**
 * @brief struct DHP
 * denavit hartenberg parameter
 ***********************************************/
typedef struct s_DHP{
float d;
float theta;
float a;
float alpha;
} DHP;


/********************************************//**
 * \brief this function allows to update
 * the current dh parameter with the
 * actual joints angle
 *
 * \param pointer to the DH parameter to
 * update
 * \param pointer to the new joint angle,
 * value which update the DHP
 *
 * \return void
 *
 ***********************************************/

void DHP_update(DHP* dhp, matrix* joints);

/********************************************//**
 * \brief this function allows to compute
 * the homogeneouse trasformation matrix
 * starting from DH parameters
 *
 * \param pointer to the actual DH parameter
 * \param pointer to the trasformation matrix
 * to compute
 *
 * \return void
 *
 ***********************************************/

void DH_Transf(DHP* dhp, matrix* T);

/********************************************//**
 * \brief Function which performs the direct
 * position kinematic function. Given the
 * joints values the TCP pose is computed
 *
 * \param pointer to the structure containing
 * the actual joints values
 * \param pointer to the pose structure where
 * the result will be stored
 *
 * \return void
 ************************************************/

void DPKF (matrix* joint, matrix* p);

/********************************************//**
 * \brief Function which returns the
 * geometric Jacobian given the joints values
 *
 * \param pointer to the structure containing
 * the joints values
 * \param Jg is the address where the
 * geometric Jacobian will be stored
 * \param T_TCP is the matrix in which the
 * homogeneous transformation from 0 to TCP
 * is stored once computed
 *
 * \return void
 ***********************************************/
void JacobianG(matrix* joint, matrix* Jg, matrix* T_TCP);

/********************************************//**
 * \brief Function which returns the Analytical Jacobian given the joints values
 *
 * \param joint is the address to the structure containing the joints values
 * \param Ja is the address where the Analytical Jacobian will be stored
 *
 * \return void
 *
 ***********************************************/
void JacobianA(matrix* joint, matrix * Ja);

/********************************************//**
 * \brief Computes the inverse kinematics (returns the joints values for a desired pose).
 *
 * \param p is the pointer to the desired pose
 * \param joint is where the result will be saved
 *
 * \return 0 if the inverse kinematics is computed 
 * correctly
 * \return 1 if the point to reach is not in the 
 * task space
 ***********************************************/
int IPKF (matrix* p, matrix* joint);

void Print_DHP(DHP* dhp);

#ifdef __cplusplus
}
#endif

#endif // KINEMATIC_H_INCLUDED