Robowflex  v0.1
Making MoveIt Easy
robowflex::darts::TSRConstraint Class Reference

An OMPL constraint for TSRs. Under the hood, creates a TSRSet that is used for all computation. Make sure that the robot state space has all groups setup before creation of this constraint. More...

#include <tsr.h>

+ Inheritance diagram for robowflex::darts::TSRConstraint:

Public Member Functions

 TSRConstraint (const StateSpacePtr &space, const TSRPtr &tsr)
 Constructor for a single TSR. More...
 
 TSRConstraint (const StateSpacePtr &space, const std::vector< TSRPtr > &tsrs)
 Constructor for multiple TSRs. More...
 
 TSRConstraint (const StateSpacePtr &space, const TSRSetPtr &tsr)
 Constructor for a TSRSet. More...
 
TSRSetPtr getSet ()
 Get TSR set for this constraint. More...
 
void function (const Eigen::Ref< const Eigen::VectorXd > &x, Eigen::Ref< Eigen::VectorXd > out) const override
 
void jacobian (const Eigen::Ref< const Eigen::VectorXd > &x, Eigen::Ref< Eigen::MatrixXd > out) const override
 
bool project (Eigen::Ref< Eigen::VectorXd > x) const override
 

Public Attributes

struct {
   bool   use_gradient {false}
 
options
 Public options. More...
 

Protected Attributes

StateSpacePtr space_
 Robot state space. More...
 
TSRSetPtr tsr_
 Set of TSR constraints. More...
 

Detailed Description

An OMPL constraint for TSRs. Under the hood, creates a TSRSet that is used for all computation. Make sure that the robot state space has all groups setup before creation of this constraint.

Definition at line 1016 of file tsr.h.

Constructor & Destructor Documentation

◆ TSRConstraint() [1/3]

TSRConstraint::TSRConstraint ( const StateSpacePtr space,
const TSRPtr tsr 
)

Constructor for a single TSR.

Parameters
[in]spaceRobot state space.
[in]tsrTSR to use in constraint.

TSRConstraint

Definition at line 1352 of file tsr.cpp.

1353  : TSRConstraint(space, std::make_shared<TSRSet>(space->getWorld(), tsr))
1354 {
1355 }
TSRConstraint(const StateSpacePtr &space, const TSRPtr &tsr)
Constructor for a single TSR.
Definition: tsr.cpp:1352

◆ TSRConstraint() [2/3]

TSRConstraint::TSRConstraint ( const StateSpacePtr space,
const std::vector< TSRPtr > &  tsrs 
)

Constructor for multiple TSRs.

Parameters
[in]spaceRobot state space.
[in]tsrsTSRs to use in constraint.

Definition at line 1357 of file tsr.cpp.

1358  : TSRConstraint(space, std::make_shared<TSRSet>(space->getWorld(), tsrs))
1359 {
1360 }

◆ TSRConstraint() [3/3]

TSRConstraint::TSRConstraint ( const StateSpacePtr space,
const TSRSetPtr tsr 
)

Constructor for a TSRSet.

Parameters
[in]spaceRobot state space.
[in]tsrTSRs to use in constraint.

Definition at line 1362 of file tsr.cpp.

1363  : ompl::base::Constraint(space->getDimension(), tsr->getDimension(), tsr->getTolerance())
1364  , space_(space)
1365  , tsr_(tsr)
1366 {
1367  tsr_->useWorldIndices(space->getIndices());
1368  tsr_->setWorldIndices(space->getIndices());
1369  tsr_->setWorld(space->getWorld());
1370 
1371  tsr_->setWorldLowerLimits(space->getLowerBound());
1372  tsr_->setWorldUpperLimits(space->getUpperBound());
1373  tsr_->initialize();
1374 }
TSRSetPtr tsr_
Set of TSR constraints.
Definition: tsr.h:1059
StateSpacePtr space_
Robot state space.
Definition: tsr.h:1058

Member Function Documentation

◆ function()

void TSRConstraint::function ( const Eigen::Ref< const Eigen::VectorXd > &  x,
Eigen::Ref< Eigen::VectorXd >  out 
) const
override

Definition at line 1376 of file tsr.cpp.

1378 {
1379  tsr_->getErrorWorldState(x, out);
1380 }

◆ getSet()

TSRSetPtr TSRConstraint::getSet ( )

Get TSR set for this constraint.

Returns
The constraint's TSR set.

Definition at line 1402 of file tsr.cpp.

1403 {
1404  return tsr_;
1405 }

◆ jacobian()

void TSRConstraint::jacobian ( const Eigen::Ref< const Eigen::VectorXd > &  x,
Eigen::Ref< Eigen::MatrixXd >  out 
) const
override

Definition at line 1382 of file tsr.cpp.

1384 {
1385  tsr_->getJacobianWorldState(x, out);
1386 }

◆ project()

bool TSRConstraint::project ( Eigen::Ref< Eigen::VectorXd >  x) const
override

Definition at line 1388 of file tsr.cpp.

1389 {
1390  space_->setWorldState(space_->getWorld(), x);
1391 
1392  bool r = false;
1393  if (tsr_->numTSRs() == 1 or not options.use_gradient)
1394  r = tsr_->solveWorldState(x);
1395 
1396  else if (options.use_gradient)
1397  r = tsr_->solveGradientWorldState(x);
1398 
1399  return r;
1400 }
struct robowflex::darts::TSRConstraint::@7 options
Public options.

Member Data Documentation

◆ 

struct { ... } robowflex::darts::TSRConstraint::options

Public options.

◆ space_

StateSpacePtr robowflex::darts::TSRConstraint::space_
protected

Robot state space.

Definition at line 1058 of file tsr.h.

◆ tsr_

TSRSetPtr robowflex::darts::TSRConstraint::tsr_
protected

Set of TSR constraints.

Definition at line 1059 of file tsr.h.

◆ use_gradient

bool robowflex::darts::TSRConstraint::use_gradient {false}

Definition at line 1054 of file tsr.h.


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