mc_rbdyn::RobotFrame Struct Reference

#include <mc_rbdyn/RobotFrame.h>

Inheritance diagram for mc_rbdyn::RobotFrame:
Collaboration diagram for mc_rbdyn::RobotFrame:

Classes

struct  NewRobotFrameToken
 

Public Member Functions

 RobotFrame (NewRobotFrameToken, const std::string &name, Robot &robot, const std::string &body)
 
 RobotFrame (NewRobotFrameToken, const std::string &name, RobotFrame &parent, sva::PTransformd X_p_f, bool baked)
 
const Robotrobot () const noexcept
 
Robotrobot () noexcept
 
unsigned int bodyMbcIndex () const noexcept
 
const std::string & body () const noexcept
 
sva::PTransformd position () const noexcept final
 
sva::MotionVecd velocity () const noexcept final
 
const sva::PTransformd & X_p_f () const noexcept
 
sva::PTransformd X_b_f () const noexcept
 
RobotFrameX_p_f (sva::PTransformd pt) noexcept
 
bool hasForceSensor () const noexcept
 
const ForceSensorforceSensor () const
 
sva::ForceVecd wrench () const
 
Eigen::Vector2d cop (double min_pressure=0.5) const
 
Eigen::Vector3d copW (double min_pressure=0.5) const
 
RobotFramePtr makeFrame (const std::string &name, const sva::PTransformd &X_p_f, bool baked=false)
 
mc_tvm::RobotFrametvm_frame () const
 
- Public Member Functions inherited from mc_rtc::shared< RobotFrame, Frame >
 operator std::shared_ptr< RobotFrame > ()
 
 operator std::shared_ptr< const RobotFrame > () const
 

Protected Member Functions

void init_tvm_frame () const final
 
void resetForceSensor () noexcept
 

Protected Attributes

Robotrobot_
 
unsigned int bodyMbcIdx_
 
const ForceSensorsensor_ = nullptr
 

Friends

struct Robot
 

Additional Inherited Members

- Public Types inherited from mc_rtc::shared< RobotFrame, Frame >
using ActualBase = typename std::conditional< std::is_same< Frame, void >::value, std::enable_shared_from_this< RobotFrame >, Frame >::type
 

Detailed Description

A frame that belongs to a Robot instance

The frame quantities are deduced from the robot's state

Every RobotFrame has either an explicit parent RobotFrame or an implicit parent (the robot's body it is attached to). Hence setting its position via the Frame interface only sets relative position and settings its velocity through the same interface never has any effect.

Constructor & Destructor Documentation

◆ RobotFrame() [1/2]

mc_rbdyn::RobotFrame::RobotFrame ( NewRobotFrameToken  ,
const std::string &  name,
Robot robot,
const std::string &  body 
)

Constructor

Creates a frame attached to the given body

Parameters
nameName of the new frame
robotRobot to which the frame is attached
bodyParent body of the frame
Exceptions
Ifbody does not belong to robot

◆ RobotFrame() [2/2]

mc_rbdyn::RobotFrame::RobotFrame ( NewRobotFrameToken  ,
const std::string &  name,
RobotFrame parent,
sva::PTransformd  X_p_f,
bool  baked 
)

Constructor

Creates a frame attached to the given frame

Parameters
nameName of the new frame
frameParent frame
X_p_fTransform from parent to the new frame
bakedIf true, attach the newly created frame to the parent body of the provided frame rather than the frame itself

Member Function Documentation

◆ body()

const std::string& mc_rbdyn::RobotFrame::body ( ) const
noexcept

The body this frame is attached to

◆ bodyMbcIndex()

unsigned int mc_rbdyn::RobotFrame::bodyMbcIndex ( ) const
inlinenoexcept

Returns this frame body index in robot's mbc

◆ cop()

Eigen::Vector2d mc_rbdyn::RobotFrame::cop ( double  min_pressure = 0.5) const

Compute the CoP in frame coordinates from gravity free measurements

Parameters
min_pressureMinimum pressure in N (default: 0.5N)
Returns
Measured CoP in frame coordinates if pressure >= min_pressure, zero otherwise
Exceptions
ifhasForceSensor() is false

◆ copW()

Eigen::Vector3d mc_rbdyn::RobotFrame::copW ( double  min_pressure = 0.5) const

Compute the CoP in inertial frame from gravity free measurements

Parameters
min_pressureMinimum pressure in N (default: 0.5N)
Returns
Measured CoP in inertial frame if pressure >= min_pressure, zero otherwise
Exceptions
ifhasForceSensor() is false

◆ forceSensor()

const ForceSensor& mc_rbdyn::RobotFrame::forceSensor ( ) const

Returns the force sensor attached to the frame (const)

Exceptions
ifhasForceSensor() is false

◆ hasForceSensor()

bool mc_rbdyn::RobotFrame::hasForceSensor ( ) const
inlinenoexcept

True if the frame has a force sensor (direct or indirect) attached

◆ init_tvm_frame()

void mc_rbdyn::RobotFrame::init_tvm_frame ( ) const
finalprotected

◆ makeFrame()

RobotFramePtr mc_rbdyn::RobotFrame::makeFrame ( const std::string &  name,
const sva::PTransformd &  X_p_f,
bool  baked = false 
)

Create a frame whose parent is this frame

Parameters
nameName of the new frame
X_p_fTransformation from this frame to the newly created frame
bakedAttach the newly created frame to the parent body of this frame rather than the frame

◆ position()

sva::PTransformd mc_rbdyn::RobotFrame::position ( ) const
finalnoexcept

Computes the frame position

◆ resetForceSensor()

void mc_rbdyn::RobotFrame::resetForceSensor ( )
protectednoexcept

Search for a force sensor inside Robot again

◆ robot() [1/2]

const Robot& mc_rbdyn::RobotFrame::robot ( ) const
inlinenoexcept

The robot to which this frame belongs (const)

◆ robot() [2/2]

Robot& mc_rbdyn::RobotFrame::robot ( )
inlinenoexcept

The robot to which this frame belongs

◆ tvm_frame()

mc_tvm::RobotFrame& mc_rbdyn::RobotFrame::tvm_frame ( ) const
inline

Access the associated TVM frame

FIXME Make sure this reinterpret_cast is formally OK, otherwise abandon the inline

◆ velocity()

sva::MotionVecd mc_rbdyn::RobotFrame::velocity ( ) const
finalnoexcept

Computes the frame velocity

◆ wrench()

sva::ForceVecd mc_rbdyn::RobotFrame::wrench ( ) const

Returns the force sensor gravity-free wrench in this frame

Exceptions
ifhasForceSensor() is false

◆ X_b_f()

sva::PTransformd mc_rbdyn::RobotFrame::X_b_f ( ) const
noexcept

Compute the transformation from the body to this frame

◆ X_p_f() [1/2]

const sva::PTransformd& mc_rbdyn::RobotFrame::X_p_f ( ) const
inlinenoexcept

Returns the transformation from the parent's frame/body to the frame

◆ X_p_f() [2/2]

RobotFrame& mc_rbdyn::RobotFrame::X_p_f ( sva::PTransformd  pt)
inlinenoexcept

Set the transformation from the parent's frame/body to this frame

Note
This impacts children frame
It is technically possible to change body frames origin this way but it will create a discrepency between the data in MultiBodyConfig and the data in the frame

Friends And Related Function Documentation

◆ Robot

friend struct Robot
friend

Member Data Documentation

◆ bodyMbcIdx_

unsigned int mc_rbdyn::RobotFrame::bodyMbcIdx_
protected

Parent's body index in the robot's configuration

◆ robot_

Robot& mc_rbdyn::RobotFrame::robot_
protected

Robot instance this frame belongs to

◆ sensor_

const ForceSensor* mc_rbdyn::RobotFrame::sensor_ = nullptr
protected

Force sensor attached (directly or indirectly) to this frame, nullptr if none


The documentation for this struct was generated from the following file: