3 #ifndef ROBOWFLEX_DART_TSR_ 
    4 #define ROBOWFLEX_DART_TSR_ 
   10 #include <ompl/base/Constraint.h> 
   12 #include <dart/dynamics/SimpleFrame.hpp> 
   13 #include <dart/dynamics/InverseKinematics.hpp> 
  126                               const Eigen::Ref<const Eigen::Vector3d> &position,
 
  127                               const Eigen::Quaterniond &rotation);
 
  167                 void setPosition(
const Eigen::Ref<const Eigen::Vector3d> &position);
 
  174                 void setPosition(
double x, 
double y, 
double z);
 
  179                 void setRotation(
const Eigen::Quaterniond &orientation);
 
  187                 void setRotation(
double w, 
double x, 
double y, 
double z);
 
  194                 void setRotation(
double x, 
double y, 
double z);
 
  205                 void setPose(
const Eigen::Ref<const Eigen::Vector3d> &position,
 
  206                              const Eigen::Quaterniond &rotation);
 
  217                 void setPose(
double xp, 
double yp, 
double zp, 
double wr, 
double xr, 
double yr, 
double zr);
 
  222                 void setPoseFromWorld(
const WorldPtr &world);
 
  232                 void setXPosTolerance(
double bound);
 
  237                 void setYPosTolerance(
double bound);
 
  242                 void setZPosTolerance(
double bound);
 
  248                 void setXPosTolerance(
double lower, 
double upper);
 
  254                 void setYPosTolerance(
double lower, 
double upper);
 
  260                 void setZPosTolerance(
double lower, 
double upper);
 
  264                 void setNoXPosTolerance();
 
  268                 void setNoYPosTolerance();
 
  272                 void setNoZPosTolerance();
 
  276                 void setNoPosTolerance();
 
  286                 void setXRotTolerance(
double bound);
 
  291                 void setYRotTolerance(
double bound);
 
  296                 void setZRotTolerance(
double bound);
 
  302                 void setXRotTolerance(
double lower, 
double upper);
 
  308                 void setYRotTolerance(
double lower, 
double upper);
 
  314                 void setZRotTolerance(
double lower, 
double upper);
 
  318                 void setNoXRotTolerance();
 
  322                 void setNoYRotTolerance();
 
  326                 void setNoZRotTolerance();
 
  330                 void setNoRotTolerance();
 
  340                 Eigen::Vector3d getPosition() 
const;
 
  345                 Eigen::Quaterniond getRotation() 
const;
 
  350                 Eigen::Vector3d getEulerRotation() 
const;
 
  355                 bool isPositionConstrained() 
const;
 
  360                 bool isRotationConstrained() 
const;
 
  365                 bool isRelative() 
const;
 
  397                 bool isPosConstrained(
double lower, 
double upper) 
const;
 
  402                 bool isRotConstrained(
double lower, 
double upper) 
const;
 
  421             void setWorld(
const WorldPtr &world);
 
  487             void toBijection(Eigen::Ref<Eigen::VectorXd> world,
 
  488                              const Eigen::Ref<const Eigen::VectorXd> &state) 
const;
 
  496             void fromBijection(Eigen::Ref<Eigen::VectorXd> state,
 
  497                                const Eigen::Ref<const Eigen::VectorXd> &world) 
const;
 
  551             void getErrorWorldRaw(Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  556             void getErrorWorld(Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  562             void getErrorWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world,
 
  563                                     Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  569             void getError(
const Eigen::Ref<const Eigen::VectorXd> &state,
 
  570                           Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  580             void getJacobianWorld(Eigen::Ref<Eigen::MatrixXd> jacobian) 
const;
 
  586             void getJacobianWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world,
 
  587                                        Eigen::Ref<Eigen::MatrixXd> jacobian) 
const;
 
  593             void getJacobian(
const Eigen::Ref<const Eigen::VectorXd> &state,
 
  594                              Eigen::Ref<Eigen::MatrixXd> jacobian) 
const;
 
  604             double distanceWorld() 
const;
 
  610             double distanceWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world) 
const;
 
  616             double distance(
const Eigen::Ref<const Eigen::VectorXd> &state) 
const;
 
  632             bool solveWorldState(Eigen::Ref<Eigen::VectorXd> world);
 
  639             bool solve(Eigen::Ref<Eigen::VectorXd> state);
 
  644             bool solveGradientWorld();
 
  651             bool solveGradientWorldState(Eigen::Ref<Eigen::VectorXd> world);
 
  658             bool solveGradient(Eigen::Ref<Eigen::VectorXd> state);
 
  668             void setPositionsWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world) 
const;
 
  673             void setPositions(
const Eigen::Ref<const Eigen::VectorXd> &state) 
const;
 
  678             void getPositionsWorldState(Eigen::Ref<Eigen::VectorXd> world) 
const;
 
  683             void getPositions(Eigen::Ref<Eigen::VectorXd> state) 
const;
 
  690             void computeBijection();
 
  703             dart::dynamics::BodyNode *tnd_{
nullptr};                          
 
  705             dart::dynamics::InverseKinematics::TaskSpaceRegion *tsr_{
nullptr};  
 
  747             void setWorld(
const WorldPtr &world);
 
  754             void addTSR(
const TSRPtr &tsr, 
bool intersect = 
true, 
double weight = 1.0);
 
  798             void setWorldUpperLimits(
const Eigen::Ref<const Eigen::VectorXd> &upper);
 
  803             void setWorldLowerLimits(
const Eigen::Ref<const Eigen::VectorXd> &lower);
 
  807             void computeLimits();
 
  817             void getPositionsWorldState(Eigen::Ref<Eigen::VectorXd> world) 
const;
 
  837             double getTolerance() 
const;
 
  842             void setTolerance(
double tolerance);
 
  862             void setStep(
double step);
 
  867             double getStep() 
const;
 
  872             void setLimit(
double limit);
 
  877             double getLimit() 
const;
 
  882             void setDamping(
double damping);
 
  887             double getDamping() 
const;
 
  892             void useDamping(
bool damping);
 
  910             void getErrorWorld(Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  916             void getErrorWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world,
 
  917                                     Eigen::Ref<Eigen::VectorXd> error) 
const;
 
  928             void getJacobianWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world,
 
  929                                        Eigen::Ref<Eigen::MatrixXd> jacobian) 
const;
 
  939             double distanceWorld() 
const;
 
  945             double distanceWorldState(
const Eigen::Ref<const Eigen::VectorXd> &world) 
const;
 
  961             bool solveWorldState(Eigen::Ref<Eigen::VectorXd> world);
 
  968             bool solveGradientWorldState(Eigen::Ref<Eigen::VectorXd> world);
 
  981             void enforceBoundsWorld(Eigen::Ref<Eigen::VectorXd> world) 
const;
 
  990             double damping_{1e-8};  
 
 1042             void function(
const Eigen::Ref<const Eigen::VectorXd> &x,
 
 1043                           Eigen::Ref<Eigen::VectorXd> out) 
const override;
 
 1045             void jacobian(
const Eigen::Ref<const Eigen::VectorXd> &x,
 
 1046                           Eigen::Ref<Eigen::MatrixXd> out) 
const override;
 
 1048             bool project(Eigen::Ref<Eigen::VectorXd> x) 
const override;
 
 1054                 bool use_gradient{
false};
 
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
 
#define ROBOWFLEX_EIGEN
Macro for classes with fixed width Eigen classes.
 
A shared pointer wrapper for robowflex::darts::StateSpace.
 
An OMPL constraint for TSRs. Under the hood, creates a TSRSet that is used for all computation....
 
TSRSetPtr tsr_
Set of TSR constraints.
 
StateSpacePtr space_
Robot state space.
 
A shared pointer wrapper for robowflex::darts::TSR.
 
A shared pointer wrapper for robowflex::darts::TSRSet.
 
Manager for a set of TSR constraints. Attempts to reduce redundancy and combines errors and Jacobians...
 
Eigen::VectorXd upper_
Upper bounds on world configuration.
 
Eigen::VectorXd lower_
Lower bounds on world configuration.
 
WorldPtr world_
World to use.
 
std::vector< double > weights_
Weights on TSRs.
 
std::set< std::size_t > skel_indices_
All skeleton indices used by members of the set.
 
std::vector< TSRPtr > tsrs_
Set of TSRs.
 
The specification of a TSR.
 
std::string structure
Structure target frame is in.
 
std::string frame
Name of target frame.
 
Specification()=default
Default constructor.
 
A Task Space Region (TSR). TSRs are workspace regions that impose a constraints on a robot....
 
std::vector< std::size_t > indices_
Controlled indices.
 
std::vector< std::pair< std::size_t, std::size_t > > world_indices_
World indices.
 
std::vector< std::size_t > bijection_
 
WorldPtr world_
Underlying world.
 
std::size_t skel_index_
Index of controlled skeleton.
 
Specification spec_
TSR specification.
 
A shared pointer wrapper for robowflex::darts::World.
 
static const double DEFAULT_IK_TOLERANCE
 
static const Eigen::Vector3d DEFAULT_IK_TOLERANCES
 
static const std::string ROOT_FRAME
 
Main namespace. Contains all library classes and functions.
 
std::decay< decltype(std::declval< moveit::core::Transforms >().getTransform("")) >::type RobotPose
A pose (point in SE(3)) used in various functions. Defined from what MoveIt! uses.
 
void print(PropagationDistanceField &pdf, int numX, int numY, int numZ)