![](/media/cache/group/Diana_su_nero.jpg.50x50_q85.jpg)
test_IPKF
Dependencies: mbed
Diff: header/kinematic.h
- Revision:
- 0:fb6e494a7656
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/header/kinematic.h Wed Apr 20 10:03:58 2016 +0000 @@ -0,0 +1,129 @@ +/********************************************//** + * @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 + +