Libbarrett  1.2.4
include/barrett/cdlbt/kinematics.h
Go to the documentation of this file.
00001 
00103 #ifndef BARRETT_CDLBT_KINEMATICS_H_
00104 #define BARRETT_CDLBT_KINEMATICS_H_
00105 #ifdef __cplusplus
00106 extern "C" {
00107 #endif
00108 
00109 #include <libconfig.h>
00110 #include <gsl/gsl_vector.h>
00111 #include <gsl/gsl_matrix.h>
00112 
00113 
00118 struct bt_kinematics_link
00119 {
00122    struct bt_kinematics_link * next; 
00123    struct bt_kinematics_link * prev; 
00128    double alpha;
00129    double theta;
00130    double a;
00131    double d;
00136    double cos_alpha;
00137    double sin_alpha;
00142    gsl_matrix * trans_to_prev; 
00143    gsl_matrix * trans_to_world; 
00148    gsl_matrix * rot_to_prev; 
00149    gsl_vector * prev_axis_z; 
00150    gsl_vector * prev_origin_pos; 
00155    gsl_matrix * rot_to_world; 
00156    gsl_vector * axis_z; 
00157    gsl_vector * origin_pos; 
00159 };
00160 
00161 
00165 struct bt_kinematics
00166 {
00167    int dof;
00168    int nlinks;
00169    struct bt_kinematics_link ** link_array;
00170    
00171    struct bt_kinematics_link * base;
00172    struct bt_kinematics_link ** link; /* Moving links array */
00173    struct bt_kinematics_link * toolplate;
00174    struct bt_kinematics_link * tool;
00175    
00176    /* Toolplate Jacobian */
00177    gsl_matrix * tool_jacobian;
00178    gsl_matrix * tool_jacobian_linear; /* matrix view */
00179    gsl_matrix * tool_jacobian_angular; /* matrix view */
00180    gsl_vector * tool_velocity;
00181    gsl_vector * tool_velocity_angular;
00182    
00183    /* Temp vector */
00184    gsl_vector * temp_v3;
00185 };
00186 
00187 
00201 int bt_kinematics_create(struct bt_kinematics ** kinptr,
00202                          config_setting_t * kinconfig, int ndofs);
00203 
00204 
00213 int bt_kinematics_destroy(struct bt_kinematics * kin);
00214 
00215 
00227 int bt_kinematics_eval(struct bt_kinematics * kin, const gsl_vector * jposition,
00228                        const gsl_vector * jvelocity);
00229 
00230 
00245 int bt_kinematics_eval_jacobian(struct bt_kinematics * kin, int jlimit,
00246                                 gsl_vector * point, gsl_matrix * jac);
00247 
00248 #ifdef __cplusplus
00249 }
00250 #endif
00251 #endif /* BARRETT_CDLBT_KINEMATICS_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines