#include <mc_rbdyn/RobotFrame.h>
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 Robot & | robot () const noexcept |
Robot & | robot () 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 |
RobotFrame & | X_p_f (sva::PTransformd pt) noexcept |
bool | hasForceSensor () const noexcept |
const ForceSensor & | forceSensor () 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::RobotFrame & | tvm_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 | |
Robot & | robot_ |
unsigned int | bodyMbcIdx_ |
const ForceSensor * | sensor_ = 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 |
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.
mc_rbdyn::RobotFrame::RobotFrame | ( | NewRobotFrameToken | , |
const std::string & | name, | ||
Robot & | robot, | ||
const std::string & | body | ||
) |
Constructor
Creates a frame attached to the given body
name | Name of the new frame |
robot | Robot to which the frame is attached |
body | Parent body of the frame |
If | body does not belong to robot |
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
name | Name of the new frame |
frame | Parent frame |
X_p_f | Transform from parent to the new frame |
baked | If true, attach the newly created frame to the parent body of the provided frame rather than the frame itself |
|
noexcept |
The body this frame is attached to
|
inlinenoexcept |
Returns this frame body index in robot's mbc
Eigen::Vector2d mc_rbdyn::RobotFrame::cop | ( | double | min_pressure = 0.5 | ) | const |
Compute the CoP in frame coordinates from gravity free measurements
min_pressure | Minimum pressure in N (default: 0.5N) |
if | hasForceSensor() is false |
Eigen::Vector3d mc_rbdyn::RobotFrame::copW | ( | double | min_pressure = 0.5 | ) | const |
Compute the CoP in inertial frame from gravity free measurements
min_pressure | Minimum pressure in N (default: 0.5N) |
if | hasForceSensor() is false |
const ForceSensor& mc_rbdyn::RobotFrame::forceSensor | ( | ) | const |
Returns the force sensor attached to the frame (const)
if | hasForceSensor() is false |
|
inlinenoexcept |
True if the frame has a force sensor (direct or indirect) attached
|
finalprotected |
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
name | Name of the new frame |
X_p_f | Transformation from this frame to the newly created frame |
baked | Attach the newly created frame to the parent body of this frame rather than the frame |
|
finalnoexcept |
Computes the frame position
|
protectednoexcept |
Search for a force sensor inside Robot again
|
inlinenoexcept |
The robot to which this frame belongs (const)
|
inlinenoexcept |
The robot to which this frame belongs
|
inline |
Access the associated TVM frame
FIXME Make sure this reinterpret_cast is formally OK, otherwise abandon the inline
|
finalnoexcept |
Computes the frame velocity
sva::ForceVecd mc_rbdyn::RobotFrame::wrench | ( | ) | const |
Returns the force sensor gravity-free wrench in this frame
if | hasForceSensor() is false |
|
noexcept |
Compute the transformation from the body to this frame
|
inlinenoexcept |
Returns the transformation from the parent's frame/body to the frame
|
inlinenoexcept |
Set the transformation from the parent's frame/body to this frame
|
friend |
|
protected |
Parent's body index in the robot's configuration
|
protected |
Force sensor attached (directly or indirectly) to this frame, nullptr if none