61 explicit Cfg(
const mathtool::Vector3d& _v,
Robot*
const _robot =
nullptr);
168 const double _oriRes)
const;
200 size_t DOF() const noexcept;
205 size_t PosDOF() const noexcept;
210 size_t OriDOF() const noexcept;
227 double& operator[](const
size_t _dof) noexcept;
228 double operator[](const
size_t _dof) const noexcept;
232 const std::vector<
double>&
GetData() const noexcept;
237 double&
Velocity(const
size_t _dof) noexcept;
238 double Velocity(const
size_t _dof) const noexcept;
242 const std::vector<
double>&
GetVelocity() const noexcept;
246 virtual
void SetData(const std::vector<
double>& _data);
247 virtual
void SetData(std::vector<
double>&& _data);
261 virtual std::vector<
double>
GetJoints() const;
310 bool GetLabel(const std::
string& _label) const;
312 bool IsLabel(const std::
string& _label) const noexcept;
314 void SetLabel(const std::
string& _label, const
bool _value) noexcept;
317 double GetStat(const std::
string& _stat) const;
319 bool IsStat(const std::
string& _stat) const noexcept;
321 void SetStat(const std::
string& _stat, const
double _value = 0) noexcept;
323 void IncrementStat(const std::
string& _stat, const
double _value = 1)
331 void Zero() noexcept;
359 template <typename DistanceMetricPointer>
360 void GetRandomRay(const
double _length, DistanceMetricPointer _dm,
361 const
bool _norm = true);
388 const
double _positionRes, const
double _orientationRes);
396 const
double _weight = .5);
433 virtual
void Read(std::istream& _is);
437 virtual
void Write(std::ostream& _os) const;
444 std::
string PrettyPrint(const
size_t _precision = 4) const;
499 template <
class DistanceMetricPo
inter>
502 GetRandomRay(
const double _length, DistanceMetricPointer _dm,
const bool _norm) {
504 for(
size_t i = 0; i <
DOF(); ++i)
508 _dm->ScaleCfg(_length, *
this);
517 std::ostream&
operator<<(std::ostream& _os,
const Cfg& _cfg);
std::ostream & operator<<(std::ostream &_os, const Cfg &_cfg)
Definition: Cfg.cpp:1280
std::istream & operator>>(std::istream &_is, Cfg &_cfg)
Definition: Cfg.cpp:1273
double Normalize(const double &_a)
Normalize a value into the range [-1,1).
Definition: MPUtils.cpp:58
double GRand(bool _reset)
Definition: MPUtils.cpp:13
DofType
Types of movement that are supported.
Definition: MultiBody.h:24
Definition: Boundary.h:30
MultiBody * GetMultiBody() const noexcept
Definition: Cfg.cpp:431
void EnforceVelocityLimits() noexcept
Ensure that this Cfg respects the robot's velocity limits.
Definition: Cfg.cpp:1318
virtual void ConfigureRobot() const
Configure the robot with the DOF values of this configuration.
Definition: Cfg.cpp:989
virtual void GetPositionOrientationFrom2Cfg(const Cfg &_pos, const Cfg &_ori)
Definition: Cfg.cpp:1083
double & Velocity(const size_t _dof) noexcept
Definition: Cfg.cpp:496
virtual std::vector< double > GetNonJoints() const
Get a vector of the robot's non-joint DOFs.
Definition: Cfg.cpp:616
virtual std::vector< double > GetRotation() const
Get a vector of the robot's rotational DOFs.
Definition: Cfg.cpp:582
std::string ToString() const
Definition: Cfg.cpp:1263
mathtool::Vector3d GetAngularPosition() const
Get the euler vector rotation.
Definition: Cfg.cpp:669
std::vector< double > DirectionInLocalFrame(const Cfg &_target) const
Definition: Cfg.cpp:1096
void SetJointData(const std::vector< double > &_data)
Definition: Cfg.cpp:545
size_t OriDOF() const noexcept
Definition: Cfg.cpp:452
Robot * m_robot
The robot this cfg refers to.
Definition: Cfg.h:484
Cfg operator-() const
Find the negative of the configuration.
Definition: Cfg.cpp:261
bool IsNonholonomic() const noexcept
Is the robot nonholonomic?
Definition: Cfg.cpp:466
double(* m_normalizer)(const double &)
The function to use for normalizing orientation DOFs.
Definition: Cfg.h:490
virtual std::vector< double > GetPosition() const
Get a vector of the robot's positional DOFs.
Definition: Cfg.cpp:571
virtual void Read(std::istream &_is)
Definition: Cfg.cpp:1157
void SetStat(const std::string &_stat, const double _value=0) noexcept
Set a statistic given a string identifier.
Definition: Cfg.cpp:860
bool IsStat(const std::string &_stat) const noexcept
Does the robot have a statistic given a string identifier?
Definition: Cfg.cpp:853
mathtool::Vector3d GetAngularVelocity() const
Get the rotation velocity in R^3.
Definition: Cfg.cpp:709
void SetRobot(Robot *const _r) noexcept
Definition: Cfg.cpp:424
virtual std::vector< double > GetJoints() const
Get a vector of the robot's joint DOFs.
Definition: Cfg.cpp:604
void SetLinearPosition(const mathtool::Vector3d &)
Sets the robot's linear position.
Definition: Cfg.cpp:734
virtual void WeightedSum(const Cfg &_c1, const Cfg &_c2, const double _weight=.5)
Definition: Cfg.cpp:1068
virtual void GetRandomVelocity()
Randomly sample the velocity for this configuration.
Definition: Cfg.cpp:977
mathtool::Vector3d GetLinearPosition() const
Get the position in R^3.
Definition: Cfg.cpp:659
virtual void Write(std::ostream &_os) const
Definition: Cfg.cpp:1214
virtual void FindIncrement(const Cfg &_start, const Cfg &_goal, const int _nTicks)
Definition: Cfg.cpp:1029
void TransformCfg(const mathtool::Transformation &)
Transforms the cfg about a new frame of reference.
Definition: Cfg.cpp:812
bool IsLabel(const std::string &_label) const noexcept
Does the robot have a given string label?
Definition: Cfg.cpp:830
const std::vector< double > & GetData() const noexcept
Definition: Cfg.cpp:489
void SetLabel(const std::string &_label, const bool _value) noexcept
Set the robot's string label given the string identifier.
Definition: Cfg.cpp:837
Robot * GetRobot() const noexcept
Definition: Cfg.cpp:417
bool InBounds(const Boundary *const _b) const noexcept
Definition: Cfg.cpp:887
Point3d GetPoint() const noexcept
Get the robot's reference point.
Definition: Cfg.cpp:561
std::vector< double > m_vel
The velocities, if any.
Definition: Cfg.h:483
size_t PosDOF() const noexcept
Definition: Cfg.cpp:445
mathtool::Transformation GetBaseTransformation() const
Get the world transformation of the robot's base.
Definition: Cfg.cpp:727
size_t DOF() const noexcept
Definition: Cfg.cpp:438
bool WithinResolution(const Cfg &_cfg, const double _posRes, const double _oriRes) const
Definition: Cfg.cpp:368
virtual void IncrementTowardsGoal(const Cfg &_goal, const Cfg &_increment)
Definition: Cfg.cpp:996
Cfg(const mathtool::Vector3d &_v, Robot *const _robot=nullptr)
virtual double Magnitude() const
Get the magnitude of the robot's DOF vector.
Definition: Cfg.cpp:627
virtual double PositionMagnitude() const
Get the magnitude of the robot's positional DOF vector.
Definition: Cfg.cpp:637
double GetStat(const std::string &_stat) const
Get a statistic given a string identifier.
Definition: Cfg.cpp:844
mathtool::EulerAngle GetEulerAngle() const
Get the euler angle rotation.
Definition: Cfg.cpp:678
Cfg operator*(const Cfg &_cfg) const
Definition: Cfg.cpp:285
void Zero() noexcept
Set all DOFs to zero.
Definition: Cfg.cpp:875
void SetLinearVelocity(const mathtool::Vector3d &)
Sets the robot's linear velocity.
Definition: Cfg.cpp:770
virtual std::vector< double > GetOrientation() const
Get a vector of the robot's orientational DOFs.
Definition: Cfg.cpp:593
Cfg & operator=(const Cfg &_cfg)
Definition: Cfg.cpp:73
Cfg & operator-=(const Cfg &_cfg)
Definition: Cfg.cpp:132
std::map< std::string, bool > m_labelMap
A map of labels for this cfg.
Definition: Cfg.h:486
static Robot * inputRobot
Definition: Cfg.h:429
mathtool::Vector3d GetLinearVelocity() const
Get the position velocity in R^3.
Definition: Cfg.cpp:696
bool operator<(const Cfg &_cfg) const
Definition: Cfg.cpp:346
void IncrementStat(const std::string &_stat, const double _value=1) noexcept
Increment a statistic given a string identifier.
Definition: Cfg.cpp:867
void SetAngularPosition(const mathtool::Vector3d &)
Sets the robot's angular position.
Definition: Cfg.cpp:742
virtual double OrientationMagnitude() const
Get the magnitude of the robot's orientational DOF vector.
Definition: Cfg.cpp:648
size_t JointDOF() const noexcept
Definition: Cfg.cpp:459
Cfg operator+(const Cfg &_cfg) const
Definition: Cfg.cpp:269
const std::vector< double > & GetVelocity() const noexcept
Definition: Cfg.cpp:510
void SetBaseTransformation(const mathtool::Transformation &)
Sets the robot's base tranformation.
Definition: Cfg.cpp:802
std::shared_ptr< Cfg > m_witnessCfg
Definition: Cfg.h:455
bool operator==(const Cfg &_cfg) const
Definition: Cfg.cpp:318
Cfg & operator+=(const Cfg &_cfg)
Definition: Cfg.cpp:109
std::map< std::string, double > m_statMap
A map of stats for this cfg.
Definition: Cfg.h:487
virtual void GetRandomCfg(const Boundary *const _b)
Definition: Cfg.cpp:902
void SetAngularVelocity(const mathtool::Vector3d &)
Sets the robot's angular velocity.
Definition: Cfg.cpp:781
std::vector< double > m_dofs
The DOF values.
Definition: Cfg.h:482
bool GetLabel(const std::string &_label) const
Get the robot's label for the given string identifier.
Definition: Cfg.cpp:823
void EnableNormalization() const
Enable the normalization of orientation DOFs.
Definition: Cfg.cpp:1289
Cfg operator/(const Cfg &_cfg) const
Definition: Cfg.cpp:293
bool operator!=(const Cfg &_cfg) const
Definition: Cfg.cpp:338
virtual void SetData(const std::vector< double > &_data)
Definition: Cfg.cpp:517
CDInfo m_clearanceInfo
Definition: Cfg.h:454
void GetRandomRay(const double _length, DistanceMetricPointer _dm, const bool _norm=true)
Definition: Cfg.h:502
void SetEulerAngle(const mathtool::EulerAngle &)
Sets the robot's euler angle.
Definition: Cfg.cpp:752
std::string PrettyPrint(const size_t _precision=4) const
Definition: Cfg.cpp:1238
Cfg & operator*=(const Cfg &_cfg)
Definition: Cfg.cpp:168
Cfg & operator/=(const Cfg &_cfg)
Definition: Cfg.cpp:191
void DisableNormalization() const
Disable the normalization of orientation DOFs.
Definition: Cfg.cpp:1296
virtual void NormalizeOrientation(const int _index=-1) noexcept
Definition: Cfg.cpp:1303
Cfg()
Definition: Cfg.cpp:19
Definition: Environment.h:137
Definition: MultiBody.h:65