Libbarrett
1.2.4
|
#include <libconfig.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
Go to the source code of this file.
Classes | |
struct | bt_kinematics_link |
struct | bt_kinematics |
Functions | |
int | bt_kinematics_create (struct bt_kinematics **kinptr, config_setting_t *kinconfig, int ndofs) |
int | bt_kinematics_destroy (struct bt_kinematics *kin) |
int | bt_kinematics_eval (struct bt_kinematics *kin, const gsl_vector *jposition, const gsl_vector *jvelocity) |
int | bt_kinematics_eval_jacobian (struct bt_kinematics *kin, int jlimit, gsl_vector *point, gsl_matrix *jac) |
Definition of bt_kinematics, a simple forward kinematics library for single-chain revolute robots.
Copyright 2009-2014 Barrett Technology <support@barrett.com>
This file is part of libbarrett.
This version of libbarrett is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This version of libbarrett is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this version of libbarrett. If not, see <http://www.gnu.org/licenses/>.
Barrett Technology Inc. 73 Chapel Street Newton, MA 02458
bt_kinematics is a module that implements simple forward kinematics for single-chain robot manipulators consisting entirely of revolute joints. Moving links are defined using Denavit-Hartenberg parameters, as defined in Spong, Hutchinson, and Vidyasagar: Robot Modeling and Control, 2006 page 76.
The library uses 4x4 homogeneous transform matrices to represent coordinate transformations from one link's frame to the next.
This is an example diagram of the frames associated with a 3-DOF robot. The joints and links are each labeled 0-2.
Notes about the kinematics module, for now:
The creation function, bt_kinematics_create(), takes a configuration argument. Here is an example configuration, for a 7-DOF WAM:
kinematics: { # For a 7-DOF WAM moving: ( # Note: alpha_pi = alpha / pi { alpha_pi = -0.5; a = 0; d = 0; }, # Base Yaw { alpha_pi = 0.5; a = 0; d = 0; }, # Base Pitch { alpha_pi = -0.5; a = 0.045; d = 0.5500; }, # Twist { alpha_pi = 0.5; a = -0.045; d = 0; }, # Elbow { alpha_pi = -0.5; a = 0; d = 0.3000; }, # Wrist Yaw { alpha_pi = 0.5; a = 0; d = 0; }, # Wrist Pitch { alpha_pi = -0.5; a = 0; d = 0.0609; } # Wrist Twist ); toolplate = { alpha_pi = 0.5; theta_pi = 0; a = 0; d = 0; }; };
int bt_kinematics_create | ( | struct bt_kinematics ** | kinptr, |
config_setting_t * | kinconfig, | ||
int | ndofs | ||
) |
Create a bt_kinematics object from a given configuration.
This function creates a new kinematics object, reading the DH parameters and toolplate information from the configuration given by kinconfig. Currently, the number of moving links (ndofs) is also passed, and the creating fails if the number of moving links read from the configuration file does not match the expected number.
[out] | kinptr | The bt_kinematics object on success, or 0 on failure |
[in] | kinconfig | Kinematics configuration, from libconfig |
[in] | ndofs | Expected number of moving links |
0 | Success |
int bt_kinematics_destroy | ( | struct bt_kinematics * | kin | ) |
Destroy a bt_kinematics object.
This function destroys a bt_kinematics object created by bt_kinematics_create().
[in] | kin | bt_kinematics object to destroy |
0 | Success |
int bt_kinematics_eval | ( | struct bt_kinematics * | kin, |
const gsl_vector * | jposition, | ||
const gsl_vector * | jvelocity | ||
) |
Evaluate all link transforms, including the toolplate jacobian.
This function is used in a control loop to update all link transform matrices (and associated matrix and vector views) given a vector of joint positions and velocities.
[in] | kin | bt_kinematics object |
[in] | jposition | Joint position vector |
[in] | jvelocity | Joint velocity vector |
0 | Success |
int bt_kinematics_eval_jacobian | ( | struct bt_kinematics * | kin, |
int | jlimit, | ||
gsl_vector * | point, | ||
gsl_matrix * | jac | ||
) |
Evalulate the Jacobian matrix at a paticular point on a particular link.
This function evaluates the Jacobian matrix for a given point on a given moving link.
[in] | kin | bt_kinematics object |
[in] | jlimit | The number of the moving link on which the point lies, (ndofs for the toolplate) |
[in] | point | The point at which the Jacobian should be calculate, in world coordinates |
[out] | jac | The Jacobian matrix into which to calculate; it should be an alread-allocated 6-N matrix. |
0 | Success |