SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
scl::CActuatorMuscle Class Reference

#include <CActuatorMuscle.hpp>

Collaboration diagram for scl::CActuatorMuscle:
Collaboration graph
[legend]

Public Member Functions

virtual sBool computeJacobian (const Eigen::VectorXd &arg_q, Eigen::VectorXd &ret_J)
 
std::string getName () const
 
virtual sBool init (const std::string &arg_name, const SRobotParsed *arg_robot, const SActuatorSetMuscleParsed *arg_msys, const sutil::CMappedList< std::string, SRigidBodyDyn > &arg_rbdtree, CDynamicsBase *arg_dynamics)
 
virtual sBool hasBeenInit ()
 
 CActuatorMuscle ()
 
virtual ~CActuatorMuscle ()
 

Protected Attributes

SActuatorMuscle data_
 
const SRobotParsedrobot_
 
const SActuatorSetMuscleParsedmsys_
 
const SMuscleParsedmuscle_
 
CDynamicsBasedynamics_
 

Detailed Description

Models a muscle as a linear actuator with zero force generation delay and a stiff tendon, which eliminates slack.

Muscles may be connected to one or more limbs through multiple via-points.

The muscle length is determined by the distance between via-points that cross one or more generalized coordinates. Since the other via-points are fixed to a surface, they don't contribute to the overall length. This allows a simpler formulation of the muscle length gradient (Jacobian) matrix. Computing the model pair-wise between gc crossing via-points reduces the worst case complexity to O(n*2*k), where k are the gcs spanned by successive via-points.

NOTE : This doesn't accommodate muscle via points that slide across surfaces. While those are more biologically realistic, they involve solving a shortest path formulation over a curved surface (the Brachistochrone problem). The sliding point might be better for large motions across complex joint complexes.

Constructor & Destructor Documentation

scl::CActuatorMuscle::CActuatorMuscle ( )

Default constructor. Sets stuff to NULL.

virtual scl::CActuatorMuscle::~CActuatorMuscle ( )
inlinevirtual

Default destructor. Does nothing

Member Function Documentation

sBool scl::CActuatorMuscle::computeJacobian ( const Eigen::VectorXd &  arg_q,
Eigen::VectorXd &  ret_J 
)
virtual

Computes the contribution of a single muscle to the entire Jacobian.

Positive muscle force => Muscle contraction Negative muscle force => Muscle pushes (usually an error)

Note for modeling biological musculoskeletal systems: Formulation is on a gc-by-gc basis. Ie. The muscle is considered piece- wise linear and each piece's contribution is measured independently. This is an approximation, but more detailed continuous models are hard to validate experimentally. Moreover, given the variability introduced by canonical musculoskeletal scaling, the errors introduced by piece- wise length gradients are probably within the envelope of experimental error. This demands biological investigation on a subject-by-subject basis.

To analytically compute the Jacobian, we use the following method:

δl = J . δq || l = muscle len. q = gen coord. J = row in Jm δli = J(i) . δq(i) || δli = change across muscle's i'th spanned gc li = |x_fixed + x_pre_gc - (x_fixed+xpost_gc)| || Part of muscle doesn't move. || = L2 norm δli/δq(i) = δ(|x_pre_gc - xpost_gc|)/δq(i) || Gradient wrt. q(i) = Gradient of path length between two attachment points (p0 and p1) = δ/δq ( |p0 - p1| ) = δ/δq ( sqrt( (p0-p1)' * (p0-p1) ) ) = 1/(2 * sqrt( (p0-p1)' * (p0-p1) ) ) * δ/δq ( (p0-p1)' * (p0-p1) ) = 1/(2 * sqrt( (p0-p1)' * (p0-p1) ) ) * 2* (p0-p1)' δ/δq (p0-p1) = 1/sqrt( (p0-p1)' * (p0-p1) ) * (p0-p1)' ( δ/δq (p0) - δ/δq (p1) ) = 1/d.norm() * d' ( δ/δq (p0) - δ/δq (p1) ); where d = p0 - p1

J_muscle_i (row-vector) = Sum_over_attachment_point_pairs_di [ |d|^-1 * d' (J_p0 - J_p1) ]

NOTE TODO : This can be greatly improved by computing Jacobians wrt. the parent link instead of wrt. the root node. Massive performance hit. NOTE TODO : Need to dig into the dynamics engine implementation and enable Jacobians wrt. some arbit link, and Jacobians with local xyz offset wrt node.

Some actuator sets don't directly actuate the generalized coordinates and require a Jacobian to compute their contribution to the generalized forces.

Each actuator instance must implement this.

Parameters
arg_qThe generalized coordinates
ret_JThe Jacobian for this muscle del.length = J * del.q

NOTE : The Jacobian is a row vector with non-zero entries only at the spanned generalized coordinates

sBool scl::CActuatorMuscle::hasBeenInit ( )
inlinevirtual

Has this actuator been initialized

sBool scl::CActuatorMuscle::init ( const std::string &  arg_name,
const SRobotParsed arg_robot,
const SActuatorSetMuscleParsed arg_msys,
const sutil::CMappedList< std::string, SRigidBodyDyn > &  arg_rbdtree,
CDynamicsBase arg_dynamics 
)
virtual

Initializes the actuator. This involves determining whether the muscle matches the robot etc. It also sets up the Jacobians to be computed etc.

Member Data Documentation

SActuatorMuscle scl::CActuatorMuscle::data_
protected

The data struct for the muscle actuator

CDynamicsBase* scl::CActuatorMuscle::dynamics_
protected

Dynamics specification (to compute robot Jacobians)

const SActuatorSetMuscleParsed* scl::CActuatorMuscle::msys_
protected

The parsed muscle specification

const SMuscleParsed* scl::CActuatorMuscle::muscle_
protected

The muscle in the system

const SRobotParsed* scl::CActuatorMuscle::robot_
protected

The parent robot to which this actuator is attached


The documentation for this class was generated from the following files: