Libbarrett
1.2.4
|
#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) |
Implementation of bt_calgrav, a calibrated gravity compensation module.
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.
[out] | gravptr | The bt_calgrav object on success, or 0 on failure |
[in] | gravconfig | Calgrav configuration, from libconfig |
[in] | dof | Degrees of freedom |
0 | Success |
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().
[in] | grav | bt_calgrav object to destroy |
0 | Success |
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.
[in] | grav | bt_calgrav object |
[in] | kin | Previously-created bt_kinematics object describing robot |
[out] | jtorque | Computed joint torque vector |
0 | Success |
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
[in] | grav | bt_calgrav object |
[in] | val | new gravity value to be updated |
0 | Success |