KDL  1.3.0
Public Member Functions | Private Attributes | Friends | List of all members
KDL::Segment Class Reference

This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body inertia) with a joint and with "handles", root and tip to connect to other segments. More...

#include <src/segment.hpp>

Collaboration diagram for KDL::Segment:
Collaboration graph
[legend]

Public Member Functions

 Segment (const std::string &name, const Joint &joint=Joint(Joint::None), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
 Constructor of the segment. More...
 
 Segment (const Joint &joint=Joint(Joint::None), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
 Constructor of the segment. More...
 
 Segment (const Segment &in)
 
Segment & operator= (const Segment &arg)
 
virtual ~Segment ()
 
Frame pose (const double &q) const
 Request the pose of the segment, given the joint position q. More...
 
Twist twist (const double &q, const double &qdot) const
 Request the 6D-velocity of the tip of the segment, given the joint position q and the joint velocity qdot. More...
 
const std::string & getName () const
 Request the name of the segment. More...
 
const Joint & getJoint () const
 Request the joint of the segment. More...
 
const RigidBodyInertia & getInertia () const
 Request the inertia of the segment. More...
 
void setInertia (const RigidBodyInertia &Iin)
 Request the inertia of the segment. More...
 
Frame getFrameToTip () const
 Request the pose from the joint end to the tip of the segment. More...
 

Private Attributes

std::string name
 
Joint joint
 
RigidBodyInertia I
 
Frame f_tip
 

Friends

class Chain
 

Detailed Description

This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body inertia) with a joint and with "handles", root and tip to connect to other segments.

A simple segment is described by the following properties :

Constructor & Destructor Documentation

KDL::Segment::Segment ( const std::string &  name,
const Joint &  joint = Joint(Joint::None),
const Frame &  f_tip = Frame::Identity(),
const RigidBodyInertia &  I = RigidBodyInertia::Zero() 
)
explicit

Constructor of the segment.

Parameters
namename of the segment
jointjoint of the segment, default: Joint(Joint::None)
f_tipframe from the end of the joint to the tip of the segment, default: Frame::Identity()
Mrigid body inertia of the segment, default: Inertia::Zero()
KDL::Segment::Segment ( const Joint &  joint = Joint(Joint::None),
const Frame &  f_tip = Frame::Identity(),
const RigidBodyInertia &  I = RigidBodyInertia::Zero() 
)
explicit

Constructor of the segment.

Parameters
jointjoint of the segment, default: Joint(Joint::None)
f_tipframe from the end of the joint to the tip of the segment, default: Frame::Identity()
Mrigid body inertia of the segment, default: Inertia::Zero()
KDL::Segment::Segment ( const Segment &  in)
KDL::Segment::~Segment ( )
virtual

Member Function Documentation

Frame KDL::Segment::getFrameToTip ( ) const
inline

Request the pose from the joint end to the tip of the segment.

Returns
the original parent end - segment end pose.

References f_tip, and KDL::Joint::pose().

Referenced by KDL::operator<<().

const RigidBodyInertia& KDL::Segment::getInertia ( ) const
inline

Request the inertia of the segment.

Returns
const reference to the inertia of the segment

References I.

Referenced by KDL::ChainIdSolver_RNE::CartToJnt(), KDL::ChainIdSolver_Vereshchagin::initial_upwards_sweep(), and KDL::ChainDynParam::JntToMass().

const Joint& KDL::Segment::getJoint ( ) const
inline
const std::string& KDL::Segment::getName ( ) const
inline

Request the name of the segment.

Returns
const reference to the name of the segment

References name.

Referenced by KDL::Tree::addChain(), KDL::Tree::addSegment(), and KDL::operator<<().

Segment & KDL::Segment::operator= ( const Segment &  arg)

References f_tip, I, joint, and name.

Frame KDL::Segment::pose ( const double &  q) const
void KDL::Segment::setInertia ( const RigidBodyInertia &  Iin)
inline

Request the inertia of the segment.

Returns
const reference to the inertia of the segment
Twist KDL::Segment::twist ( const double &  q,
const double &  qdot 
) const

Request the 6D-velocity of the tip of the segment, given the joint position q and the joint velocity qdot.

Parameters
q1D position of the joint
qdot1D velocity of the joint
Returns
6D-velocity of the tip of the segment, expressed in the base-frame of the segment(root) and with the tip of the segment as reference point.

References f_tip, joint, KDL::Frame::M, KDL::Frame::p, KDL::Joint::pose(), KDL::Twist::RefPoint(), and KDL::Joint::twist().

Referenced by KDL::ChainIdSolver_RNE::CartToJnt(), KDL::ChainIkSolverPos_LMA::compute_jacobian(), KDL::ChainIdSolver_Vereshchagin::initial_upwards_sweep(), KDL::ChainFkSolverVel_recursive::JntToCart(), KDL::ChainJntToJacSolver::JntToJac(), and KDL::ChainDynParam::JntToMass().

Friends And Related Function Documentation

friend class Chain
friend

Member Data Documentation

Frame KDL::Segment::f_tip
private

Referenced by getFrameToTip(), operator=(), pose(), and twist().

RigidBodyInertia KDL::Segment::I
private

Referenced by getInertia(), and operator=().

Joint KDL::Segment::joint
private

Referenced by getJoint(), operator=(), pose(), and twist().

std::string KDL::Segment::name
private

Referenced by getName(), and operator=().


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