KDL 1.5.1
Loading...
Searching...
No Matches
KDL::Segment Class Reference

#include <src/segment.hpp>

Collaboration diagram for KDL::Segment:

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.
 
 Segment (const Joint &joint=Joint(Joint::Fixed), const Frame &f_tip=Frame::Identity(), const RigidBodyInertia &I=RigidBodyInertia::Zero())
 Constructor of the segment.
 
 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.
 
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.
 
const std::string & getName () const
 Request the name of the segment.
 
const Joint & getJoint () const
 Request the joint of the segment.
 
const RigidBodyInertia & getInertia () const
 Request the inertia of the segment.
 
void setInertia (const RigidBodyInertia &Iin)
 Request the inertia of the segment.
 
Frame getFrameToTip () const
 Request the pose from the joint end to the tip of the segment.
 
void setFrameToTip (const Frame &f_tip_new)
 Set the pose from the joint end to the tip of the segment.
 

Private Attributes

std::string name
 
Joint joint
 
RigidBodyInertia I
 
Frame f_tip
 

Friends

class Chain
 

Detailed Description

 \brief 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 :

  • Joint
  • Rigid Body Inertia: of the rigid body part of the Segment
  • Offset from the end of the joint to the tip of the segment: the joint is located at the root of the segment.

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

References f_tip, I, joint, name, and pose().

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

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

References f_tip, I, joint, name, and pose().

◆ Segment() [3/3]

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

References f_tip, I, joint, name, and Segment().

◆ ~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, and joint.

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::ChainHdSolver_Vereshchagin::initial_upwards_sweep(), 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, name, and Segment().

◆ pose()

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

Request the pose of the segment, given the joint position q.

Parameters
q1D position of the joint
Returns
pose from the root to the tip of the segment

References f_tip, and joint.

Referenced by KDL::ChainIkSolverPos_LMA::compute_fwdpos(), KDL::Tree::getChain(), KDL::ChainHdSolver_Vereshchagin::initial_upwards_sweep(), KDL::TreeIdSolver_RNE::rne_step(), Segment(), and Segment().

◆ 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, and joint.

◆ 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, and joint.

Referenced by KDL::ChainIkSolverPos_LMA::compute_jacobian(), KDL::ChainHdSolver_Vereshchagin::initial_upwards_sweep(), and KDL::TreeIdSolver_RNE::rne_step().

Friends And Related Symbol Documentation

◆ Chain

friend class Chain
friend

References Chain.

Referenced by Chain.

Member Data Documentation

◆ f_tip

Frame KDL::Segment::f_tip
private

◆ I

RigidBodyInertia KDL::Segment::I
private

◆ joint

Joint KDL::Segment::joint
private

◆ name

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

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