Libbarrett  1.2.4
Functions
src/cdlbt/calgrav.c File Reference
#include <syslog.h>
#include <libconfig.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_blas.h>
#include <barrett/cdlbt/kinematics.h>
#include <barrett/cdlbt/calgrav.h>
#include <barrett/cdlbt/gsl.h>

Functions

int bt_calgrav_create (struct bt_calgrav **gravptr, config_setting_t *gravconfig, size_t dof)
int bt_calgrav_destroy (struct bt_calgrav *grav)
int bt_calgrav_eval (struct bt_calgrav *grav, struct bt_kinematics *kin, gsl_vector *jtorque)
int bt_calgrav_update (struct bt_calgrav *grav, double val)

Detailed Description

Implementation of bt_calgrav, a calibrated gravity compensation module.

Author:
Christopher Dellin
Date:
2008-2009

Function Documentation

int bt_calgrav_create ( struct bt_calgrav **  gravptr,
config_setting_t *  gravconfig,
size_t  dof 
)

Create a bt_calgrav object from a given configuration.

This function creates a new calgrav object, reading the mu vectors from the configuration given by gravconfig. It is also necessary to pass a previously-created bt_kinematics object for kinematics information.

Parameters:
[out]gravptrThe bt_calgrav object on success, or 0 on failure
[in]gravconfigCalgrav configuration, from libconfig
[in]dofDegrees of freedom
Return values:
0Success
int bt_calgrav_destroy ( struct bt_calgrav grav)

Destroy a bt_calgrav object.

This function destroys a bt_calgrav object created by bt_calgrav_create().

Parameters:
[in]gravbt_calgrav object to destroy
Return values:
0Success
int bt_calgrav_eval ( struct bt_calgrav grav,
struct bt_kinematics kin,
gsl_vector *  jtorque 
)

Evaluate first-moment gravity compensation torques.

This function is used in a control loop to calculate the gravity compensation torques of the robot, given a particular configuration (calculated in the kinematics object). The torques are stored into the jtorque vector.

Parameters:
[in]gravbt_calgrav object
[in]kinPreviously-created bt_kinematics object describing robot
[out]jtorqueComputed joint torque vector
Return values:
0Success
int bt_calgrav_update ( struct bt_calgrav grav,
double  val 
)

Updates the world gravity.

This function updates the world component of the gravity with the requested value

Parameters:
[in]gravbt_calgrav object
[in]valnew gravity value to be updated
Return values:
0Success
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines