KDL  1.5.1
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::Fixed), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
 Constructor of the segment. More...
 
 Segment (const Joint &joint=Joint(Joint::Fixed), 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...
 
void setFrameToTip (const Frame &f_tip_new)
 Set 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

◆ Segment() [1/3]

KDL::Segment::Segment ( const std::string &  name,
const Joint &  joint = Joint(Joint::Fixed),
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::Fixed)
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()

◆ Segment() [2/3]

KDL::Segment::Segment ( const Joint &  joint = Joint(Joint::Fixed),
const Frame &  f_tip = Frame::Identity(),
const RigidBodyInertia &  I = RigidBodyInertia::Zero() 
)
explicit

Constructor of the segment.

Parameters
jointjoint of the segment, default: Joint(Joint::Fixed)
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()

◆ Segment() [3/3]

KDL::Segment::Segment ( const Segment &  in)

◆ ~Segment()

KDL::Segment::~Segment ( )
virtual

Member Function Documentation

◆ getFrameToTip()

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, joint, and KDL::Joint::pose().

Referenced by KDL::operator<<().

◆ getInertia()

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::ChainHdSolver_Vereshchagin::initial_upwards_sweep(), KDL::ChainDynParam::JntToMass(), and KDL::TreeIdSolver_RNE::rne_step().

◆ getJoint()

const Joint& KDL::Segment::getJoint ( ) const
inline

◆ getName()

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<<().

◆ operator=()

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

References f_tip, I, joint, and name.

◆ pose()

Frame KDL::Segment::pose ( const double &  q) const

◆ setFrameToTip()

void KDL::Segment::setFrameToTip ( const Frame &  f_tip_new)

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

Parameters
f_tip_newpose from the joint end to the tip of the segment

References f_tip, KDL::Frame::Inverse(), joint, and KDL::Joint::pose().

◆ setInertia()

void KDL::Segment::setInertia ( const RigidBodyInertia &  Iin)
inline

Request the inertia of the segment.

Returns
const reference to the inertia of the segment

◆ twist()

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::ChainHdSolver_Vereshchagin::initial_upwards_sweep(), KDL::ChainFkSolverVel_recursive::JntToCart(), KDL::ChainJntToJacSolver::JntToJac(), KDL::ChainDynParam::JntToMass(), and KDL::TreeIdSolver_RNE::rne_step().

Friends And Related Function Documentation

◆ Chain

friend class Chain
friend

Member Data Documentation

◆ f_tip

Frame KDL::Segment::f_tip
private

◆ I

RigidBodyInertia KDL::Segment::I
private

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

◆ joint

Joint KDL::Segment::joint
private

◆ name

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

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


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