Parasol Planning Library (PPL)
Cfg Class Reference

#include <Cfg.h>

Collaboration diagram for Cfg:
Collaboration graph
[legend]

Public Member Functions

Construction
 Cfg ()
 
 Cfg (Robot *const _robot)
 
 Cfg (const mathtool::Vector3d &_v, Robot *const _robot=nullptr)
 
 Cfg (const Cfg &_other)
 
 Cfg (Cfg &&_other)
 
virtual ~Cfg ()
 
Assignment
Cfgoperator= (const Cfg &_cfg)
 
Cfgoperator= (Cfg &&_cfg)
 
Cfgoperator+= (const Cfg &_cfg)
 
Cfgoperator-= (const Cfg &_cfg)
 
Cfgoperator*= (const Cfg &_cfg)
 
Cfgoperator/= (const Cfg &_cfg)
 
Cfgoperator*= (const double _d)
 
Cfgoperator/= (const double _d)
 
Arithmetic
Cfg operator- () const
 Find the negative of the configuration. More...
 
Cfg operator+ (const Cfg &_cfg) const
 
Cfg operator- (const Cfg &_cfg) const
 
Cfg operator* (const Cfg &_cfg) const
 
Cfg operator/ (const Cfg &_cfg) const
 
Cfg operator* (const double _d) const
 
Cfg operator/ (const double _d) const
 
Equality
bool operator== (const Cfg &_cfg) const
 
bool operator!= (const Cfg &_cfg) const
 
bool WithinResolution (const Cfg &_cfg, const double _posRes, const double _oriRes) const
 
Comparison
bool operator< (const Cfg &_cfg) const
 
Robot Info
RobotGetRobot () const noexcept
 
void SetRobot (Robot *const _r) noexcept
 
MultiBodyGetMultiBody () const noexcept
 
size_t DOF () const noexcept
 
size_t PosDOF () const noexcept
 
size_t OriDOF () const noexcept
 
size_t JointDOF () const noexcept
 
bool IsNonholonomic () const noexcept
 Is the robot nonholonomic? More...
 
DOF Accessors
double & operator[] (const size_t _dof) noexcept
 
double operator[] (const size_t _dof) const noexcept
 
const std::vector< double > & GetData () const noexcept
 
double & Velocity (const size_t _dof) noexcept
 
double Velocity (const size_t _dof) const noexcept
 
const std::vector< double > & GetVelocity () const noexcept
 
virtual void SetData (const std::vector< double > &_data)
 
virtual void SetData (std::vector< double > &&_data)
 
void SetJointData (const std::vector< double > &_data)
 
Point3d GetPoint () const noexcept
 Get the robot's reference point. More...
 
virtual std::vector< double > GetPosition () const
 Get a vector of the robot's positional DOFs. More...
 
virtual std::vector< double > GetRotation () const
 Get a vector of the robot's rotational DOFs. More...
 
virtual std::vector< double > GetJoints () const
 Get a vector of the robot's joint DOFs. More...
 
virtual std::vector< double > GetNonJoints () const
 Get a vector of the robot's non-joint DOFs. More...
 
virtual std::vector< double > GetOrientation () const
 Get a vector of the robot's orientational DOFs. More...
 
virtual double Magnitude () const
 Get the magnitude of the robot's DOF vector. More...
 
virtual double PositionMagnitude () const
 Get the magnitude of the robot's positional DOF vector. More...
 
virtual double OrientationMagnitude () const
 Get the magnitude of the robot's orientational DOF vector. More...
 
mathtool::Vector3d GetLinearPosition () const
 Get the position in R^3. More...
 
mathtool::Vector3d GetAngularPosition () const
 Get the euler vector rotation. More...
 
mathtool::EulerAngle GetEulerAngle () const
 Get the euler angle rotation. More...
 
mathtool::Vector3d GetLinearVelocity () const
 Get the position velocity in R^3. More...
 
mathtool::Vector3d GetAngularVelocity () const
 Get the rotation velocity in R^3. More...
 
mathtool::Transformation GetBaseTransformation () const
 Get the world transformation of the robot's base. More...
 
void SetLinearPosition (const mathtool::Vector3d &)
 Sets the robot's linear position. More...
 
void SetAngularPosition (const mathtool::Vector3d &)
 Sets the robot's angular position. More...
 
void SetEulerAngle (const mathtool::EulerAngle &)
 Sets the robot's euler angle. More...
 
void SetLinearVelocity (const mathtool::Vector3d &)
 Sets the robot's linear velocity. More...
 
void SetAngularVelocity (const mathtool::Vector3d &)
 Sets the robot's angular velocity. More...
 
void SetBaseTransformation (const mathtool::Transformation &)
 Sets the robot's base tranformation. More...
 
void TransformCfg (const mathtool::Transformation &)
 Transforms the cfg about a new frame of reference. More...
 
Labels and Stats

Each Cfg has a set of labels and stats. Label are boolean attributes, while stats are real-valued.

bool GetLabel (const std::string &_label) const
 Get the robot's label for the given string identifier. More...
 
bool IsLabel (const std::string &_label) const noexcept
 Does the robot have a given string label? More...
 
void SetLabel (const std::string &_label, const bool _value) noexcept
 Set the robot's string label given the string identifier. More...
 
double GetStat (const std::string &_stat) const
 Get a statistic given a string identifier. More...
 
bool IsStat (const std::string &_stat) const noexcept
 Does the robot have a statistic given a string identifier? More...
 
void SetStat (const std::string &_stat, const double _value=0) noexcept
 Set a statistic given a string identifier. More...
 
void IncrementStat (const std::string &_stat, const double _value=1) noexcept
 Increment a statistic given a string identifier. More...
 
Generation Methods
void Zero () noexcept
 Set all DOFs to zero. More...
 
bool InBounds (const Boundary *const _b) const noexcept
 
bool InBounds (const Environment *const _env) const noexcept
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void GetRandomCfg (const Boundary *const _b)
 
virtual void GetRandomCfg (Environment *_env)
 
virtual void GetRandomVelocity ()
 Randomly sample the velocity for this configuration. More...
 
template<typename DistanceMetricPointer >
void GetRandomRay (const double _length, DistanceMetricPointer _dm, const bool _norm=true)
 
virtual void ConfigureRobot () const
 Configure the robot with the DOF values of this configuration. More...
 
virtual void IncrementTowardsGoal (const Cfg &_goal, const Cfg &_increment)
 
virtual void FindIncrement (const Cfg &_start, const Cfg &_goal, const int _nTicks)
 
virtual void FindIncrement (const Cfg &_start, const Cfg &_goal, int *_nTicks, const double _positionRes, const double _orientationRes)
 
virtual void WeightedSum (const Cfg &_c1, const Cfg &_c2, const double _weight=.5)
 
virtual void GetPositionOrientationFrom2Cfg (const Cfg &_pos, const Cfg &_ori)
 
C-Space Directions
std::vector< double > DirectionInLocalFrame (const Cfg &_target) const
 
Helpers
void EnableNormalization () const
 Enable the normalization of orientation DOFs. More...
 
void DisableNormalization () const
 Disable the normalization of orientation DOFs. More...
 
virtual void NormalizeOrientation (const int _index=-1) noexcept
 
void EnforceVelocityLimits () noexcept
 Ensure that this Cfg respects the robot's velocity limits. More...
 

Data Fields

Internal State with poor encapsulation

@TODO Fix encapsulation issues. @TODO Witness should not be a shared_ptr.

CDInfo m_clearanceInfo
 
std::shared_ptr< Cfgm_witnessCfg
 

Protected Attributes

Internal State
std::vector< double > m_dofs
 The DOF values. More...
 
std::vector< double > m_vel
 The velocities, if any. More...
 
Robotm_robot {nullptr}
 The robot this cfg refers to. More...
 
std::map< std::string, bool > m_labelMap
 A map of labels for this cfg. More...
 
std::map< std::string, double > m_statMap
 A map of stats for this cfg. More...
 
double(* m_normalizer )(const double &)
 The function to use for normalizing orientation DOFs. More...
 

I/O

static RobotinputRobot = nullptr
 
virtual void Read (std::istream &_is)
 
virtual void Write (std::ostream &_os) const
 
std::string PrettyPrint (const size_t _precision=4) const
 
std::string ToString () const
 

Detailed Description

A point in configuration space.

Each instance holds an array of values representing all the degrees of freedom of a robot. Translational DOFs represent the position of a reference point on the robot relative to the world origin. Angular and joint DOFs are normalized to the range [-1, 1), so this object can only reliably represent points in @cspace and not directions.

Constructor & Destructor Documentation

◆ Cfg() [1/5]

Cfg::Cfg ( )
explicit

Construct a configuration for Cfg::inputRobot.

This constructor is provided for two cases: allocating storage for Cfgs without knowing the robot in advance, and reading in roadmaps. The robot pointer will be Cfg::inputRobot, which can be thought of as a variable default for the Cfg(Robot* const) constructor.

◆ Cfg() [2/5]

Cfg::Cfg ( Robot *const  _robot)
explicit

Construct a configuration for a given robot.

Parameters
_robotThe robot this represents.

◆ Cfg() [3/5]

Cfg::Cfg ( const mathtool::Vector3d &  _v,
Robot *const  _robot = nullptr 
)
explicit

Construct a configuration for a given robot at a specified point in workspace.

Parameters
_vThe workspace location of the robot's reference point.
_robotThe robot to represent.

◆ Cfg() [4/5]

Cfg::Cfg ( const Cfg _other)

Construct a copy of a configuration.

Parameters
_otherThe configuration to copy.

◆ Cfg() [5/5]

Cfg::Cfg ( Cfg &&  _other)

Construct a copy of a configuration.

Parameters
_otherThe configuration to copy.

◆ ~Cfg()

Cfg::~Cfg ( )
virtualdefault

Member Function Documentation

◆ ConfigureRobot()

void Cfg::ConfigureRobot ( ) const
virtual

Configure the robot with the DOF values of this configuration.

◆ DirectionInLocalFrame()

std::vector< double > Cfg::DirectionInLocalFrame ( const Cfg _target) const

Find a c-space direction to another configuration in the local (base body) frame of this Cfg. The rotational component will be in Euler Vector representation since Euler Angles do not really live in the local or global frame.

Parameters
_targetThe target configuration.
Returns
The c-space direction from this to _target in the local frame of this, using Euler Vector representation for the orientation. @WARNING This function is still wrong, it does not handle the rotational components correctly.

◆ DisableNormalization()

void Cfg::DisableNormalization ( ) const

Disable the normalization of orientation DOFs.

◆ DOF()

size_t Cfg::DOF ( ) const
noexcept

Get the robot's DOF count.

Returns
The robot's DOF count.
Warning
For composite C-Space this returns a total DOF count.

◆ EnableNormalization()

void Cfg::EnableNormalization ( ) const

Enable the normalization of orientation DOFs.

◆ EnforceVelocityLimits()

void Cfg::EnforceVelocityLimits ( )
noexcept

Ensure that this Cfg respects the robot's velocity limits.

◆ FindIncrement() [1/2]

void Cfg::FindIncrement ( const Cfg _start,
const Cfg _goal,
const int  _nTicks 
)
virtual

Find the c-space increment that moves from a start to a goal in a fixed number of steps.

Parameters
_startThe start configuration.
_goalThe goal configuration.
_nTicksThe number of steps to take.

◆ FindIncrement() [2/2]

void Cfg::FindIncrement ( const Cfg _start,
const Cfg _goal,
int *  _nTicks,
const double  _positionRes,
const double  _orientationRes 
)
virtual

Find the c-space increment and number of steps needed to move from a start to a goal, taking steps no larger than the designated resolutions.

Parameters
_startThe start configuration.
_goalThe goal configuration.
_nTicksThe number of steps to take (computed by this method).
_positionResThe position resolution to use.
_orientationResThe orientation resolution to use.

◆ GetAngularPosition()

Vector3d Cfg::GetAngularPosition ( ) const

Get the euler vector rotation.

◆ GetAngularVelocity()

Vector3d Cfg::GetAngularVelocity ( ) const

Get the rotation velocity in R^3.

◆ GetBaseTransformation()

Transformation Cfg::GetBaseTransformation ( ) const

Get the world transformation of the robot's base.

◆ GetData()

const std::vector< double > & Cfg::GetData ( ) const
noexcept

Get the data for all DOFs.

Returns
A vector of all DOFs.

◆ GetEulerAngle()

EulerAngle Cfg::GetEulerAngle ( ) const

Get the euler angle rotation.

◆ GetJoints()

vector< double > Cfg::GetJoints ( ) const
virtual

Get a vector of the robot's joint DOFs.

◆ GetLabel()

bool Cfg::GetLabel ( const std::string &  _label) const

Get the robot's label for the given string identifier.

◆ GetLinearPosition()

Vector3d Cfg::GetLinearPosition ( ) const

Get the position in R^3.

◆ GetLinearVelocity()

Vector3d Cfg::GetLinearVelocity ( ) const

Get the position velocity in R^3.

◆ GetMultiBody()

MultiBody * Cfg::GetMultiBody ( ) const
noexcept

Get the robot's multibody.

Returns
The robot's multibody.

◆ GetNonJoints()

vector< double > Cfg::GetNonJoints ( ) const
virtual

Get a vector of the robot's non-joint DOFs.

◆ GetOrientation()

vector< double > Cfg::GetOrientation ( ) const
virtual

Get a vector of the robot's orientational DOFs.

◆ GetPoint()

Point3d Cfg::GetPoint ( ) const
noexcept

Get the robot's reference point.

◆ GetPosition()

vector< double > Cfg::GetPosition ( ) const
virtual

Get a vector of the robot's positional DOFs.

◆ GetPositionOrientationFrom2Cfg()

void Cfg::GetPositionOrientationFrom2Cfg ( const Cfg _pos,
const Cfg _ori 
)
virtual

Extract the position and orientation for this configuration from two other configurations.

Parameters
_posCopy the position from this configuration.
_oriCopy the orientation from this configuration.

◆ GetRandomCfg() [1/2]

void Cfg::GetRandomCfg ( const Boundary *const  _b)
virtual

Create a configuration where workspace robot's EVERY VERTEX is guaranteed to lie within the specified boundary. If a cfg can't be found, the program will abort. The function will try a predefined number of times.

Parameters
_bThe given boundary.

◆ GetRandomCfg() [2/2]

void Cfg::GetRandomCfg ( Environment _env)
virtual

Create a configuration within the given environment.

Parameters
_envThe given environment.

◆ GetRandomRay()

template<class DistanceMetricPointer >
void Cfg::GetRandomRay ( const double  _length,
DistanceMetricPointer  _dm,
const bool  _norm = true 
)

Generate a random configuration with a set length.

Parameters
_lengthThe desired length.
_dmThe distance metric for checking length.
_normNormalize the orientation DOFs?

◆ GetRandomVelocity()

void Cfg::GetRandomVelocity ( )
virtual

Randomly sample the velocity for this configuration.

◆ GetRobot()

Robot * Cfg::GetRobot ( ) const
noexcept

Get the robot corresponding to this configuration.

Returns
The corresponding robot.

◆ GetRotation()

vector< double > Cfg::GetRotation ( ) const
virtual

Get a vector of the robot's rotational DOFs.

◆ GetStat()

double Cfg::GetStat ( const std::string &  _stat) const

Get a statistic given a string identifier.

◆ GetVelocity()

const std::vector< double > & Cfg::GetVelocity ( ) const
noexcept

Get the velocity data for all DOFs.

Returns
A vector of all DOF velocity data.

◆ InBounds() [1/2]

bool Cfg::InBounds ( const Boundary *const  _b) const
noexcept

Test if a configuration lies within a boundary and also within the robot's c-space limits.

Parameters
_boundaryThe boundary to check.
Returns
True if the configuration places the robot inside both the boundary and its DOF limits.

◆ InBounds() [2/2]

bool Cfg::InBounds ( const Environment *const  _env) const
noexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ IncrementStat()

void Cfg::IncrementStat ( const std::string &  _stat,
const double  _value = 1 
)
noexcept

Increment a statistic given a string identifier.

◆ IncrementTowardsGoal()

void Cfg::IncrementTowardsGoal ( const Cfg _goal,
const Cfg _increment 
)
virtual

Move this configuration towards a goal by adding a fixed increment.

Parameters
_goalThe desired goal configuration.
_incrementThe fixed increment to add to this, moving towards goal.

◆ IsLabel()

bool Cfg::IsLabel ( const std::string &  _label) const
noexcept

Does the robot have a given string label?

◆ IsNonholonomic()

bool Cfg::IsNonholonomic ( ) const
noexcept

Is the robot nonholonomic?

◆ IsStat()

bool Cfg::IsStat ( const std::string &  _stat) const
noexcept

Does the robot have a statistic given a string identifier?

◆ JointDOF()

size_t Cfg::JointDOF ( ) const
noexcept

Get the robot's joint DOF count.

Returns
The robot's joint DOF count.
Warning
For composite C-Space this function return "per body" counts.

◆ Magnitude()

double Cfg::Magnitude ( ) const
virtual

Get the magnitude of the robot's DOF vector.

◆ NormalizeOrientation()

void Cfg::NormalizeOrientation ( const int  _index = -1)
virtualnoexcept

Normalize an orientation DOF to the range [-1, 1).

Parameters
_indexThe index of the DOF to normalize. If it is -1, all orientation DOFs will be normalized.

◆ operator!=()

bool Cfg::operator!= ( const Cfg _cfg) const

Check if the current and given configurations are unequal.

Parameters
_cfgThe given configuration.
Returns
True is unequal, false otherwise.

◆ operator*() [1/2]

Cfg Cfg::operator* ( const Cfg _cfg) const

Find the product of the current and a given configuration, by each degree of freedom.

Parameters
_cfgThe configuration used to multiply the current.
Returns
The product of the configurations.

◆ operator*() [2/2]

Cfg Cfg::operator* ( const double  _d) const

Find the configuration obtained by multiplying the current by a scalar.

Parameters
_dThe scalar used to multiply the current.
Returns
The multiplied configuration.

◆ operator*=() [1/2]

Cfg & Cfg::operator*= ( const Cfg _cfg)

Multiply the current configuration by a given configuration, by each degree of freedom

Parameters
_cfgThe configuration to multiply the current.

◆ operator*=() [2/2]

Cfg & Cfg::operator*= ( const double  _d)

Multiply the current configuration by a scalar.

Parameters
_dThe scalar used to multiply the current.

◆ operator+()

Cfg Cfg::operator+ ( const Cfg _cfg) const

Find the sum of the current and a given configuration, by each degree of freedom.

Parameters
_cfgThe configuration to be added.
Returns
The sum of the configurations.

◆ operator+=()

Cfg & Cfg::operator+= ( const Cfg _cfg)

Add a given configuration to the current, by each degree of freedom.

Parameters
_cfgThe configuration to be added.

◆ operator-() [1/2]

Cfg Cfg::operator- ( ) const

Find the negative of the configuration.

◆ operator-() [2/2]

Cfg Cfg::operator- ( const Cfg _cfg) const

Find the difference of the current and a given configuration, by each degree of freedom.

Parameters
_cfgThe configuration to be subtracted.
Returns
The difference of the configurations.

◆ operator-=()

Cfg & Cfg::operator-= ( const Cfg _cfg)

Subtract a given configuration from the current, by each degree of freedom.

Parameters
_cfgThe configuration to be subtracted.

@TODO For optimal runtime, comment out this condition. Assembly planning needs this case handled differently to make sure we get all dofs.

◆ operator/() [1/2]

Cfg Cfg::operator/ ( const Cfg _cfg) const

Find the quotient of the current and a given configuration, by each degree of freedom.

Parameters
_cfgThe configuration used to divide the current.
Returns
The quotient of the configurations.

◆ operator/() [2/2]

Cfg Cfg::operator/ ( const double  _d) const

Find the configuration obtained by dividing the current by a scalar.

Parameters
_dThe scalar used to divide the current.
Returns
The divided configuration.

◆ operator/=() [1/2]

Cfg & Cfg::operator/= ( const Cfg _cfg)

Divide the current configuration by a given configuration, by each degree of freedom.

Parameters
_cfgThe configuration to divide the current.

◆ operator/=() [2/2]

Cfg & Cfg::operator/= ( const double  _d)

Divide the current configuration by a scalar.

Parameters
_dThe scalar used to divide the current.

◆ operator<()

bool Cfg::operator< ( const Cfg _cfg) const

Check if the current configuration is less that the given.

Parameters
_cfgThe given configuration.
Returns
True if less than the given, false otherwise.
Todo:
The function currently seems to check each dof in order, returning T/F immediately unless exactly equal; is this intended?

◆ operator=() [1/2]

Cfg & Cfg::operator= ( Cfg &&  _cfg)

Set a configuration equal to another.

Parameters
_cfgThe configuration to be set to.

◆ operator=() [2/2]

Cfg & Cfg::operator= ( const Cfg _cfg)

Set a configuration equal to another.

Parameters
_cfgThe configuration to be set to.

◆ operator==()

bool Cfg::operator== ( const Cfg _cfg) const

Check if the current and given configurations are equal.

Parameters
_cfgThe given configuration.
Returns
True is equal, false otherwise.

◆ operator[]() [1/2]

double Cfg::operator[] ( const size_t  _dof) const
noexcept

◆ operator[]() [2/2]

double & Cfg::operator[] ( const size_t  _dof)
noexcept

Access the data for a given DOF.

Parameters
_dofThe index of the desired DOF.
Returns
The desired DOF.

◆ OriDOF()

size_t Cfg::OriDOF ( ) const
noexcept

Get the robot's orientational DOF count.

Returns
The robot's orientational DOF count.
Warning
For composite C-Space this function return "per body" counts.

◆ OrientationMagnitude()

double Cfg::OrientationMagnitude ( ) const
virtual

Get the magnitude of the robot's orientational DOF vector.

◆ PosDOF()

size_t Cfg::PosDOF ( ) const
noexcept

Get the robot's positional DOF count.

Returns
The robot's positional DOF count.
Warning
For composite C-Space this function return "per body" counts.

◆ PositionMagnitude()

double Cfg::PositionMagnitude ( ) const
virtual

Get the magnitude of the robot's positional DOF vector.

◆ PrettyPrint()

std::string Cfg::PrettyPrint ( const size_t  _precision = 4) const

Print the Cfg's dofs and velocities with limited precision for terminal debugging.

Parameters
_precisionThe display precision.
Returns
A string of [dof1, dof2, ..., dofn] for holonomic robots, or {[dof1, ..., dofn], <vel1, ..., veln>} for nonholonomic robots.

◆ Read()

void Cfg::Read ( std::istream &  _is)
virtual

Read a configuration from an input stream.

Parameters
_isThe input stream to read from.

◆ SetAngularPosition()

void Cfg::SetAngularPosition ( const mathtool::Vector3d &  )

Sets the robot's angular position.

◆ SetAngularVelocity()

void Cfg::SetAngularVelocity ( const mathtool::Vector3d &  )

Sets the robot's angular velocity.

◆ SetBaseTransformation()

void Cfg::SetBaseTransformation ( const mathtool::Transformation &  )

Sets the robot's base tranformation.

◆ SetData() [1/2]

void Cfg::SetData ( const std::vector< double > &  _data)
virtual

Set the DOF data.

Parameters
_dataThe vector of new DOF data.

◆ SetData() [2/2]

void Cfg::SetData ( std::vector< double > &&  _data)
virtual

◆ SetEulerAngle()

void Cfg::SetEulerAngle ( const mathtool::EulerAngle &  )

Sets the robot's euler angle.

◆ SetJointData()

void Cfg::SetJointData ( const std::vector< double > &  _data)

Set the joint DOF data. Other DOFs will remain unchanged.

Parameters
_dataThe vector of new DOF joint data.

◆ SetLabel()

void Cfg::SetLabel ( const std::string &  _label,
const bool  _value 
)
noexcept

Set the robot's string label given the string identifier.

◆ SetLinearPosition()

void Cfg::SetLinearPosition ( const mathtool::Vector3d &  )

Sets the robot's linear position.

◆ SetLinearVelocity()

void Cfg::SetLinearVelocity ( const mathtool::Vector3d &  )

Sets the robot's linear velocity.

◆ SetRobot()

void Cfg::SetRobot ( Robot *const  _r)
noexcept

Set the robot corresponding to this configuration.

Parameters
_rThe desired new robot.

◆ SetStat()

void Cfg::SetStat ( const std::string &  _stat,
const double  _value = 0 
)
noexcept

Set a statistic given a string identifier.

◆ ToString()

std::string Cfg::ToString ( ) const

◆ TransformCfg()

void Cfg::TransformCfg ( const mathtool::Transformation &  )

Transforms the cfg about a new frame of reference.

◆ Velocity() [1/2]

double Cfg::Velocity ( const size_t  _dof) const
noexcept

◆ Velocity() [2/2]

double & Cfg::Velocity ( const size_t  _dof)
noexcept

Access the velocity data for a given DOF.

Parameters
_dofThe index of the desired DOF.
Returns
The desired DOF's velocity data.

◆ WeightedSum()

void Cfg::WeightedSum ( const Cfg _c1,
const Cfg _c2,
const double  _weight = .5 
)
virtual

Create a configuration from the weighted sum of two other cfgs.

Parameters
_c1The first configuration.
_c2The second configuration.
_weightThe weight for the second configuration. The first will have (1 - _weight).

◆ WithinResolution()

bool Cfg::WithinResolution ( const Cfg _cfg,
const double  _posRes,
const double  _oriRes 
) const

Check if the current and given configurations are equal. within a given set of resolutions.

Parameters
_cfgThe given configuration.
_posResThe resolution for positional degrees of freedom.
_oriResThe resolution for orientational degrees of freedom.
Returns
True if both are within the given resolutions, false otherwise.

@TODO comment this out if speed is important, the assembly planning stuff needs to have composite bodies analyzed differently for now though.

◆ Write()

void Cfg::Write ( std::ostream &  _os) const
virtual

Write a configuration to an output stream.

Parameters
_osThe output stream to write to.

◆ Zero()

void Cfg::Zero ( )
noexcept

Set all DOFs to zero.

Field Documentation

◆ inputRobot

Robot * Cfg::inputRobot = nullptr
static

@TODO This is needed because we use stapl's graph reading function, which does not allow us to set the robot pointers on construction. Devise a better scheme for doing this that does not involve static data.

◆ m_clearanceInfo

CDInfo Cfg::m_clearanceInfo

◆ m_dofs

std::vector<double> Cfg::m_dofs
protected

The DOF values.

◆ m_labelMap

std::map<std::string, bool> Cfg::m_labelMap
protected

A map of labels for this cfg.

◆ m_normalizer

double(* Cfg::m_normalizer) (const double &)
inlinemutableprotected

The function to use for normalizing orientation DOFs.

◆ m_robot

Robot* Cfg::m_robot {nullptr}
protected

The robot this cfg refers to.

◆ m_statMap

std::map<std::string, double> Cfg::m_statMap
protected

A map of stats for this cfg.

◆ m_vel

std::vector<double> Cfg::m_vel
protected

The velocities, if any.

◆ m_witnessCfg

std::shared_ptr<Cfg> Cfg::m_witnessCfg

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