test_IPKF

Dependencies:   mbed

Committer:
LudovicoDani
Date:
Wed Apr 20 10:03:58 2016 +0000
Revision:
0:fb6e494a7656
IPKF_Test_nucleo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
LudovicoDani 0:fb6e494a7656 1 /********************************************//**
LudovicoDani 0:fb6e494a7656 2 * @brief
LudovicoDani 0:fb6e494a7656 3 * @file kinematic.h
LudovicoDani 0:fb6e494a7656 4 * @author Daniele Ludovico, Fiorella Sibona
LudovicoDani 0:fb6e494a7656 5 * @date 12/04/2016
LudovicoDani 0:fb6e494a7656 6 * @brief File containing the function to compute the
LudovicoDani 0:fb6e494a7656 7 * kinematic function of a robotic arm.
LudovicoDani 0:fb6e494a7656 8 *
LudovicoDani 0:fb6e494a7656 9 */
LudovicoDani 0:fb6e494a7656 10
LudovicoDani 0:fb6e494a7656 11 #ifndef KINEMATIC_H_INCLUDED
LudovicoDani 0:fb6e494a7656 12 #define KINEMATIC_H_INCLUDED
LudovicoDani 0:fb6e494a7656 13
LudovicoDani 0:fb6e494a7656 14 #ifdef __cplusplus
LudovicoDani 0:fb6e494a7656 15 extern "C" {
LudovicoDani 0:fb6e494a7656 16 #endif
LudovicoDani 0:fb6e494a7656 17
LudovicoDani 0:fb6e494a7656 18 #include <math.h>
LudovicoDani 0:fb6e494a7656 19 #include "matrix.h"
LudovicoDani 0:fb6e494a7656 20 #include "params.h"
LudovicoDani 0:fb6e494a7656 21
LudovicoDani 0:fb6e494a7656 22
LudovicoDani 0:fb6e494a7656 23 /********************************************//**
LudovicoDani 0:fb6e494a7656 24 * @brief struct DHP
LudovicoDani 0:fb6e494a7656 25 * denavit hartenberg parameter
LudovicoDani 0:fb6e494a7656 26 ***********************************************/
LudovicoDani 0:fb6e494a7656 27 typedef struct s_DHP{
LudovicoDani 0:fb6e494a7656 28 float d;
LudovicoDani 0:fb6e494a7656 29 float theta;
LudovicoDani 0:fb6e494a7656 30 float a;
LudovicoDani 0:fb6e494a7656 31 float alpha;
LudovicoDani 0:fb6e494a7656 32 } DHP;
LudovicoDani 0:fb6e494a7656 33
LudovicoDani 0:fb6e494a7656 34
LudovicoDani 0:fb6e494a7656 35 /********************************************//**
LudovicoDani 0:fb6e494a7656 36 * \brief this function allows to update
LudovicoDani 0:fb6e494a7656 37 * the current dh parameter with the
LudovicoDani 0:fb6e494a7656 38 * actual joints angle
LudovicoDani 0:fb6e494a7656 39 *
LudovicoDani 0:fb6e494a7656 40 * \param pointer to the DH parameter to
LudovicoDani 0:fb6e494a7656 41 * update
LudovicoDani 0:fb6e494a7656 42 * \param pointer to the new joint angle,
LudovicoDani 0:fb6e494a7656 43 * value which update the DHP
LudovicoDani 0:fb6e494a7656 44 *
LudovicoDani 0:fb6e494a7656 45 * \return void
LudovicoDani 0:fb6e494a7656 46 *
LudovicoDani 0:fb6e494a7656 47 ***********************************************/
LudovicoDani 0:fb6e494a7656 48
LudovicoDani 0:fb6e494a7656 49 void DHP_update(DHP* dhp, matrix* joints);
LudovicoDani 0:fb6e494a7656 50
LudovicoDani 0:fb6e494a7656 51 /********************************************//**
LudovicoDani 0:fb6e494a7656 52 * \brief this function allows to compute
LudovicoDani 0:fb6e494a7656 53 * the homogeneouse trasformation matrix
LudovicoDani 0:fb6e494a7656 54 * starting from DH parameters
LudovicoDani 0:fb6e494a7656 55 *
LudovicoDani 0:fb6e494a7656 56 * \param pointer to the actual DH parameter
LudovicoDani 0:fb6e494a7656 57 * \param pointer to the trasformation matrix
LudovicoDani 0:fb6e494a7656 58 * to compute
LudovicoDani 0:fb6e494a7656 59 *
LudovicoDani 0:fb6e494a7656 60 * \return void
LudovicoDani 0:fb6e494a7656 61 *
LudovicoDani 0:fb6e494a7656 62 ***********************************************/
LudovicoDani 0:fb6e494a7656 63
LudovicoDani 0:fb6e494a7656 64 void DH_Transf(DHP* dhp, matrix* T);
LudovicoDani 0:fb6e494a7656 65
LudovicoDani 0:fb6e494a7656 66 /********************************************//**
LudovicoDani 0:fb6e494a7656 67 * \brief Function which performs the direct
LudovicoDani 0:fb6e494a7656 68 * position kinematic function. Given the
LudovicoDani 0:fb6e494a7656 69 * joints values the TCP pose is computed
LudovicoDani 0:fb6e494a7656 70 *
LudovicoDani 0:fb6e494a7656 71 * \param pointer to the structure containing
LudovicoDani 0:fb6e494a7656 72 * the actual joints values
LudovicoDani 0:fb6e494a7656 73 * \param pointer to the pose structure where
LudovicoDani 0:fb6e494a7656 74 * the result will be stored
LudovicoDani 0:fb6e494a7656 75 *
LudovicoDani 0:fb6e494a7656 76 * \return void
LudovicoDani 0:fb6e494a7656 77 ************************************************/
LudovicoDani 0:fb6e494a7656 78
LudovicoDani 0:fb6e494a7656 79 void DPKF (matrix* joint, matrix* p);
LudovicoDani 0:fb6e494a7656 80
LudovicoDani 0:fb6e494a7656 81 /********************************************//**
LudovicoDani 0:fb6e494a7656 82 * \brief Function which returns the
LudovicoDani 0:fb6e494a7656 83 * geometric Jacobian given the joints values
LudovicoDani 0:fb6e494a7656 84 *
LudovicoDani 0:fb6e494a7656 85 * \param pointer to the structure containing
LudovicoDani 0:fb6e494a7656 86 * the joints values
LudovicoDani 0:fb6e494a7656 87 * \param Jg is the address where the
LudovicoDani 0:fb6e494a7656 88 * geometric Jacobian will be stored
LudovicoDani 0:fb6e494a7656 89 * \param T_TCP is the matrix in which the
LudovicoDani 0:fb6e494a7656 90 * homogeneous transformation from 0 to TCP
LudovicoDani 0:fb6e494a7656 91 * is stored once computed
LudovicoDani 0:fb6e494a7656 92 *
LudovicoDani 0:fb6e494a7656 93 * \return void
LudovicoDani 0:fb6e494a7656 94 ***********************************************/
LudovicoDani 0:fb6e494a7656 95 void JacobianG(matrix* joint, matrix* Jg, matrix* T_TCP);
LudovicoDani 0:fb6e494a7656 96
LudovicoDani 0:fb6e494a7656 97 /********************************************//**
LudovicoDani 0:fb6e494a7656 98 * \brief Function which returns the Analytical Jacobian given the joints values
LudovicoDani 0:fb6e494a7656 99 *
LudovicoDani 0:fb6e494a7656 100 * \param joint is the address to the structure containing the joints values
LudovicoDani 0:fb6e494a7656 101 * \param Ja is the address where the Analytical Jacobian will be stored
LudovicoDani 0:fb6e494a7656 102 *
LudovicoDani 0:fb6e494a7656 103 * \return void
LudovicoDani 0:fb6e494a7656 104 *
LudovicoDani 0:fb6e494a7656 105 ***********************************************/
LudovicoDani 0:fb6e494a7656 106 void JacobianA(matrix* joint, matrix * Ja);
LudovicoDani 0:fb6e494a7656 107
LudovicoDani 0:fb6e494a7656 108 /********************************************//**
LudovicoDani 0:fb6e494a7656 109 * \brief Computes the inverse kinematics (returns the joints values for a desired pose).
LudovicoDani 0:fb6e494a7656 110 *
LudovicoDani 0:fb6e494a7656 111 * \param p is the pointer to the desired pose
LudovicoDani 0:fb6e494a7656 112 * \param joint is where the result will be saved
LudovicoDani 0:fb6e494a7656 113 *
LudovicoDani 0:fb6e494a7656 114 * \return 0 if the inverse kinematics is computed
LudovicoDani 0:fb6e494a7656 115 * correctly
LudovicoDani 0:fb6e494a7656 116 * \return 1 if the point to reach is not in the
LudovicoDani 0:fb6e494a7656 117 * task space
LudovicoDani 0:fb6e494a7656 118 ***********************************************/
LudovicoDani 0:fb6e494a7656 119 int IPKF (matrix* p, matrix* joint);
LudovicoDani 0:fb6e494a7656 120
LudovicoDani 0:fb6e494a7656 121 void Print_DHP(DHP* dhp);
LudovicoDani 0:fb6e494a7656 122
LudovicoDani 0:fb6e494a7656 123 #ifdef __cplusplus
LudovicoDani 0:fb6e494a7656 124 }
LudovicoDani 0:fb6e494a7656 125 #endif
LudovicoDani 0:fb6e494a7656 126
LudovicoDani 0:fb6e494a7656 127 #endif // KINEMATIC_H_INCLUDED
LudovicoDani 0:fb6e494a7656 128
LudovicoDani 0:fb6e494a7656 129