Aikido
aikido::robot::util Namespace Reference

Classes

struct  CRRTPlannerParameters
 
struct  VectorFieldPlannerParameters
 

Functions

trajectory::TrajectoryPtr planToConfiguration (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const statespace::StateSpace::State *goalState, const constraint::TestablePtr &collisionTestable, common::RNG *rng, double timelimit)
 Plan the robot to a specific configuration. More...
 
trajectory::TrajectoryPtr planToConfigurations (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const std::vector< statespace::StateSpace::State * > &goalStates, const constraint::TestablePtr &collisionTestable, common::RNG *rng, double timelimit)
 Plan the robot to a set of configurations. More...
 
trajectory::TrajectoryPtr planToTSR (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const dart::dynamics::BodyNodePtr &bodyNode, const constraint::dart::TSRPtr &tsr, const constraint::TestablePtr &collisionTestable, common::RNG *rng, double timelimit, std::size_t maxNumTrials, const distance::ConstConfigurationRankerPtr &ranker=nullptr)
 Plan the configuration of the metakeleton such that the specified bodynode is set to a sample in TSR. More...
 
trajectory::InterpolatedPtr planToTSRwithTrajectoryConstraint (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const dart::dynamics::BodyNodePtr &bodyNode, const constraint::dart::TSRPtr &goalTsr, const constraint::dart::TSRPtr &constraintTsr, const constraint::TestablePtr &collisionTestable, double timelimit, const CRRTPlannerParameters &crrtParameters=CRRTPlannerParameters())
 Returns a Trajectory that moves the configuration of the metakeleton such that the specified bodynode is set to a sample in a goal TSR and the trajectory is constrained to a constraint TSR Uses CRRTPlanner. More...
 
trajectory::TrajectoryPtr planToEndEffectorOffset (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const dart::dynamics::BodyNodePtr &body, const Eigen::Vector3d &direction, const constraint::TestablePtr &collisionTestable, double distance, double timelimit, double positionTolerance=1e-3, double angularTolerance=1e-3, const VectorFieldPlannerParameters &vfParameters=VectorFieldPlannerParameters(), const CRRTPlannerParameters &crrtParameters=CRRTPlannerParameters())
 Plan to a desired end-effector offset with fixed orientation. More...
 
trajectory::InterpolatedPtr planToEndEffectorOffsetByCRRT (const statespace::dart::MetaSkeletonStateSpacePtr &space, const dart::dynamics::MetaSkeletonPtr &metaSkeleton, const dart::dynamics::BodyNodePtr &bodyNode, const constraint::TestablePtr &collisionTestable, const Eigen::Vector3d &direction, double distance, double timelimit, double positionTolerance=1e-3, double angularTolerance=1e-3, const CRRTPlannerParameters &crrtParameters=CRRTPlannerParameters())
 Plan to a desired end-effector offset with fixed orientation using CRRT. More...
 
std::unordered_map< std::string, const Eigen::VectorXd > parseYAMLToNamedConfigurations (const YAML::Node &node)
 Parses YAML node for named configurtaions. More...
 
bool getGoalAndConstraintTSRForEndEffectorOffset (const dart::dynamics::BodyNodePtr &bodyNode, const Eigen::Vector3d &direction, double distance, const constraint::dart::TSRPtr &goal, const constraint::dart::TSRPtr &constraint, double positionTolerance=1e-3, double angularTolerance=1e-3)
 Gets Goal and Constraint TSR for end-effector. More...
 
Eigen::Isometry3d getLookAtIsometry (const Eigen::Vector3d &positionFrom, const Eigen::Vector3d &positionTo)
 Get a pose at a point looking at another point. More...
 
const dart::dynamics::BodyNode * getBodyNodeOrThrow (const dart::dynamics::MetaSkeleton &skeleton, const std::string &bodyNodeName)
 Get a specific BodyNode of a MetaSkeleton or throw an execption if it doesn't exist. More...
 
dart::dynamics::BodyNode * getBodyNodeOrThrow (dart::dynamics::MetaSkeleton &skeleton, const std::string &bodyNodeName)
 Get a specific BodyNode of a MetaSkeleton or throw an execption if it doesn't exist. More...
 

Function Documentation

◆ getBodyNodeOrThrow() [1/2]

const dart::dynamics::BodyNode* aikido::robot::util::getBodyNodeOrThrow ( const dart::dynamics::MetaSkeleton &  skeleton,
const std::string &  bodyNodeName 
)

Get a specific BodyNode of a MetaSkeleton or throw an execption if it doesn't exist.

Parameters
[in]skeletonMetaSkeleton that should contain the BodyNode
[in]bodyNodeNameName of the BodyNode we are looking for
Returns
The BodyNode

◆ getBodyNodeOrThrow() [2/2]

dart::dynamics::BodyNode* aikido::robot::util::getBodyNodeOrThrow ( dart::dynamics::MetaSkeleton &  skeleton,
const std::string &  bodyNodeName 
)

Get a specific BodyNode of a MetaSkeleton or throw an execption if it doesn't exist.

Parameters
[in]skeletonMetaSkeleton that should contain the BodyNode
[in]bodyNodeNameName of the BodyNode we are looking for
Returns
The BodyNode

◆ getGoalAndConstraintTSRForEndEffectorOffset()

bool aikido::robot::util::getGoalAndConstraintTSRForEndEffectorOffset ( const dart::dynamics::BodyNodePtr &  bodyNode,
const Eigen::Vector3d &  direction,
double  distance,
const constraint::dart::TSRPtr goal,
const constraint::dart::TSRPtr constraint,
double  positionTolerance = 1e-3,
double  angularTolerance = 1e-3 
)

Gets Goal and Constraint TSR for end-effector.

Parameters
[in]bodyNodeEnd-effector body node
[in]directionEnd-effector direction
[in]distanceOffset to move
[out]goalGoal TSR
[out]constraintConstraint TSR
[in]positionToleranceTolerance in position, used in TSR
[in]angularToleranceTolerance in angle, used in TSR
Returns
True if all outputs are successfully made.

◆ getLookAtIsometry()

Eigen::Isometry3d aikido::robot::util::getLookAtIsometry ( const Eigen::Vector3d &  positionFrom,
const Eigen::Vector3d &  positionTo 
)

Get a pose at a point looking at another point.

Parameters
[in]positionFromPosition to look from
[in]positionToPosition to look to
Returns
Pose at positionFrom, looking at positionTo.

◆ parseYAMLToNamedConfigurations()

std::unordered_map<std::string, const Eigen::VectorXd> aikido::robot::util::parseYAMLToNamedConfigurations ( const YAML::Node &  node)

Parses YAML node for named configurtaions.

Parameters
[in]nodeYAML node containing named configurations
Returns
Unordered map of (name, configuration) pairs.

◆ planToConfiguration()

trajectory::TrajectoryPtr aikido::robot::util::planToConfiguration ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const statespace::StateSpace::State goalState,
const constraint::TestablePtr collisionTestable,
common::RNG rng,
double  timelimit 
)

Plan the robot to a specific configuration.

Restores the robot to its initial configuration after planning.

Parameters
[in]spaceThe StateSpace for the metaskeleton
[in]metaSkeletonMetaSkeleton to plan with.
[in]goalStateGoal state
[in]collisionTestableTestable constraint to check for collision.
[in]rngRandom number generator
[in]timelimitMax time to spend per planning to each IK

◆ planToConfigurations()

trajectory::TrajectoryPtr aikido::robot::util::planToConfigurations ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const std::vector< statespace::StateSpace::State * > &  goalStates,
const constraint::TestablePtr collisionTestable,
common::RNG rng,
double  timelimit 
)

Plan the robot to a set of configurations.

Restores the robot to its initial configuration after planning.

Parameters
[in]spaceThe StateSpace for the metaskeleton
[in]metaSkeletonMetaSkeleton to plan with.
[in]goalStatesGoal states
[in]collisionTestableTestable constraint to check for collision.
[in]rngRandom number generator
[in]timelimitMax time to spend per planning to each IK

◆ planToEndEffectorOffset()

trajectory::TrajectoryPtr aikido::robot::util::planToEndEffectorOffset ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const dart::dynamics::BodyNodePtr &  body,
const Eigen::Vector3d &  direction,
const constraint::TestablePtr collisionTestable,
double  distance,
double  timelimit,
double  positionTolerance = 1e-3,
double  angularTolerance = 1e-3,
const VectorFieldPlannerParameters vfParameters = VectorFieldPlannerParameters(),
const CRRTPlannerParameters crrtParameters = CRRTPlannerParameters() 
)

Plan to a desired end-effector offset with fixed orientation.

Parameters
[in]spaceStateSpace for the metaskeleton
[in]metaSkeletonMetaskeleton to plan with
[in]bodyBodynode for the end-effector
[in]directionDirection unit vector in the world frame
[in]collisionTestableCollision constraint to check. Self-collision is checked by default.
[in]distanceDistance distance to move, in meters
[in]timelimitTimelimit for planning
[in]positionToleranceTolerance in position
[in]angularToleranceTolerance in angle
[in]vfParametersVectorFieldPlanenr parameters
[in]crrtParametersCRRTPlanner parameters
Returns
Output trajectory

◆ planToEndEffectorOffsetByCRRT()

trajectory::InterpolatedPtr aikido::robot::util::planToEndEffectorOffsetByCRRT ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const dart::dynamics::BodyNodePtr &  bodyNode,
const constraint::TestablePtr collisionTestable,
const Eigen::Vector3d &  direction,
double  distance,
double  timelimit,
double  positionTolerance = 1e-3,
double  angularTolerance = 1e-3,
const CRRTPlannerParameters crrtParameters = CRRTPlannerParameters() 
)

Plan to a desired end-effector offset with fixed orientation using CRRT.

Parameters
[in]spaceStateSpace for the metaskeleton
[in]metaSkeletonMetaskeleton to plan with
[in]bodyNodeBodynode for the end-effector
[in]directionDirection unit vector in the world frame
[in]collisionTestableCollision constraint to check. Self-collision is checked by default.
[in]distanceDistance distance to move, in meters
[in]timelimitTimelimit for planning
[in]positionToleranceTolerance in position
[in]angularToleranceTolerance in angle
[in]crrtParametersCRRTPlanner parameters
Returns
Output trajectory

◆ planToTSR()

trajectory::TrajectoryPtr aikido::robot::util::planToTSR ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const dart::dynamics::BodyNodePtr &  bodyNode,
const constraint::dart::TSRPtr tsr,
const constraint::TestablePtr collisionTestable,
common::RNG rng,
double  timelimit,
std::size_t  maxNumTrials,
const distance::ConstConfigurationRankerPtr ranker = nullptr 
)

Plan the configuration of the metakeleton such that the specified bodynode is set to a sample in TSR.

Parameters
[in]spaceThe StateSpace for the metaskeleton.
[in]metaSkeletonMetaSkeleton to plan with.
[in]bodyNodeBodynode whose frame for which TSR is constructed.
[in]tsrTSR to plan to.
[in]collisionTestableTestable constraint to check for collision.
[in]rngRandom number generator
[in]timelimitMax time (seconds) to spend per planning to each IK
[in]maxNumTrialsNumber of retries before failure.
[in]rankerRanker to rank the sampled configurations. If nullptr, NominalConfigurationRanker is used with the current metaSkeleton pose.
Returns
Trajectory to a sample in TSR, or nullptr if planning fails.

◆ planToTSRwithTrajectoryConstraint()

trajectory::InterpolatedPtr aikido::robot::util::planToTSRwithTrajectoryConstraint ( const statespace::dart::MetaSkeletonStateSpacePtr space,
const dart::dynamics::MetaSkeletonPtr &  metaSkeleton,
const dart::dynamics::BodyNodePtr &  bodyNode,
const constraint::dart::TSRPtr goalTsr,
const constraint::dart::TSRPtr constraintTsr,
const constraint::TestablePtr collisionTestable,
double  timelimit,
const CRRTPlannerParameters crrtParameters = CRRTPlannerParameters() 
)

Returns a Trajectory that moves the configuration of the metakeleton such that the specified bodynode is set to a sample in a goal TSR and the trajectory is constrained to a constraint TSR Uses CRRTPlanner.

Parameters
[in]spaceThe StateSpace for the metaskeleton
[in]metaSkeletonMetaSkeleton to plan with.
[in]bodyNodeBodynode whose frame is meant for TSR
[in]goalTsrThe goal TSR to move to
[in]constraintTsrThe constraint TSR for the trajectory
[in]collisionTestableTestable constraint to check for collision.
[in]timelimitTimelimit for planning
[in]crrtParametersParameters to use in planning.
Returns
Trajectory to a sample in TSR, or nullptr if planning fails.