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

Functions

int bt_dynamics_create (struct bt_dynamics **dynptr, config_setting_t *dynconfig, int ndofs)
int bt_dynamics_destroy (struct bt_dynamics *dyn)
int bt_dynamics_eval_inverse (struct bt_dynamics *dyn, const struct bt_kinematics *kin, const gsl_vector *jvel, const gsl_vector *jacc, gsl_vector *jtor)
int bt_dynamics_eval_jsim (struct bt_dynamics *dyn, struct bt_kinematics *kin)
Private functions

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


Detailed Description

Implementation of bt_dynamics, a simple dynamics library which uses the Recursive Newton-Euler Algorithm for single-chain revolute robots.

Author:
Christopher Dellin
Date:
2008-2009

Function Documentation

int bt_dynamics_create ( struct bt_dynamics **  dynptr,
config_setting_t *  dynconfig,
int  ndofs 
)

Create a bt_dynamics object from a given configuration.

This function creates a new dynamics object, center-of-mass and inertial information from the configuration given by dynconfig. 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. It is also necessary to pass a previously-created bt_kinematics object for kinematics information.

Parameters:
[out]dynptrThe bt_dynamics object on success, or 0 on failure
[in]dynconfigDynamics configuration, from libconfig
[in]ndofsExpected number of moving links
[in]kinPreviously-created bt_kinematics object describing robot
Return values:
0Success
int bt_dynamics_destroy ( struct bt_dynamics dyn)

Destroy a bt_dynamics object.

This function destroys a bt_dynamics object created by bt_dynamics_create().

Parameters:
[in]dynbt_dynamics object to destroy
Return values:
0Success
int bt_dynamics_eval_inverse ( struct bt_dynamics dyn,
const struct bt_kinematics kin,
const gsl_vector *  jvel,
const gsl_vector *  jacc,
gsl_vector *  jtor 
)

Evaluate inverse dynamics using the RNEA, both forward and backward.

This function is used in a control loop to calculate the inverse dynamics of the robot, given a particular configuration (calculated in the kinematics object), set of joint velocities, and set of desired joint accelerations. The resulting joint torques are stored in jtor.

Note:
Throw a switch in there for gravity on/off?
How to account for base acceleration (even gravity?)
This takes ~ 152us on PC104 right now.
Parameters:
[in]dynbt_dynamics object
[in]jvelPresent joint velocity vector
[in]jaccDesired joint acceleration vector
[out]jtorComputed joint torque vector
Return values:
0Success
int bt_dynamics_eval_jsim ( struct bt_dynamics dyn,
struct bt_kinematics kin 
)

Calculate the Joint-Space Inertia Matrix (JSIM).

The formulation used is the explicit formulation given in Spong, Hutchinson, and Vidyasagar: Robot Modeling and Control, 2006 page 254.

Parameters:
[in]dynbt_dynamics object
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines