Classes | Public Member Functions | Protected Member Functions | Protected Attributes
constrained_ik::constraints::AvoidObstacles Class Reference

Constraint to avoid obstacles. More...

#include <avoid_obstacles.h>

Inheritance diagram for constrained_ik::constraints::AvoidObstacles:
Inheritance graph
[legend]

List of all members.

Classes

struct  AvoidObstaclesData
 This structure stores constraint data. More...
struct  LinkAvoidance
 Link avoidance data for a single link. More...

Public Member Functions

virtual void addAvoidanceLink (const std::string &link_name)
 Adds an obstacle avoidance link.
virtual Eigen::VectorXd calcError (const AvoidObstaclesData &cdata, const LinkAvoidance &link) const
 Creates vector representing velocity error term corresponding to calcJacobian()
virtual Eigen::MatrixXd calcJacobian (const AvoidObstaclesData &cdata, const LinkAvoidance &link) const
 Creates Jacobian for avoiding a collision with link closest to a collision.
virtual bool checkStatus (const AvoidObstaclesData &cdata, const LinkAvoidance &link) const
 Checks termination criteria There are no termination criteria for this constraint.
constrained_ik::ConstraintResults evalConstraint (const SolverState &state) const override
 see base class for documentation
virtual double getAmplitude (const std::string &link_name) const
 getter for link amplitude
virtual double getAvoidanceDistance (const std::string &link_name) const
 getter for link avoidance distance
virtual std::vector< std::string > getAvoidanceLinkNames () const
 getter for obstacle avoidance links
virtual double getMinDistance (const std::string &link_name) const
 getter for link min_distance_
virtual double getWeight (const std::string &link_name) const
 getter for link weight_
void init (const Constrained_IK *ik) override
 Initialize constraint (overrides Constraint::init) Should be called before using class.
void loadParameters (const XmlRpc::XmlRpcValue &constraint_xml) override
 see base class for documentation
virtual void setAmplitude (const std::string &link_name, const double &amplitude)
 setter for link amplitude
virtual void setAvoidanceDistance (const std::string &link_name, const double &avoidance_distance)
 setter for link avoidance distance
virtual void setAvoidanceLinks (const std::vector< std::string > &link_names)
 setter for obstacle avoidance links
virtual void setMinDistance (const std::string &link_name, const double &min_distance)
 setter for link min_distance_
virtual void setWeight (const std::string &link_name, const double &weight)
 setter for link weight_
virtual void updateDistanceThreshold ()
 This updates the maximum distance threshold.

Protected Member Functions

LinkAvoidancegetLinkData (const std::string link_name)
 Get a links avoidance data.
const LinkAvoidance *const getLinkData (const std::string link_name) const
 Get a links avoidance data.

Protected Attributes

double distance_threshold_
 a distance threshold used to speed up distance queries
std::set< const
robot_model::LinkModel * > 
link_models_
 a set of LinkModel for each link in link_names_
std::vector< std::string > link_names_
 list of links that should avoid obstacles
std::map< std::string,
LinkAvoidance
links_
 map from link name to its avoidance data

Detailed Description

Constraint to avoid obstacles.

Examples:
All examples are located here Avoid Joint Limit Constraint Examples

Definition at line 50 of file avoid_obstacles.h.


Member Function Documentation

virtual void constrained_ik::constraints::AvoidObstacles::addAvoidanceLink ( const std::string &  link_name) [inline, virtual]

Adds an obstacle avoidance link.

Parameters:
link_nameName of link to add to link_names_

Definition at line 318 of file avoid_obstacles.h.

VectorXd constrained_ik::constraints::AvoidObstacles::calcError ( const AvoidObstaclesData cdata,
const LinkAvoidance link 
) const [virtual]

Creates vector representing velocity error term corresponding to calcJacobian()

Parameters:
cdataThe constraint specific data.
linkThe link to process
Returns:
VectorXd of joint velocities for obstacle avoidance scaled by weight

Definition at line 202 of file avoid_obstacles.cpp.

MatrixXd constrained_ik::constraints::AvoidObstacles::calcJacobian ( const AvoidObstaclesData cdata,
const LinkAvoidance link 
) const [virtual]

Creates Jacobian for avoiding a collision with link closest to a collision.

Parameters:
cdataThe constraint specific data.
linkThe link to process
Returns:
Jacobian scaled by weight

Definition at line 223 of file avoid_obstacles.cpp.

bool constrained_ik::constraints::AvoidObstacles::checkStatus ( const AvoidObstaclesData cdata,
const LinkAvoidance link 
) const [virtual]

Checks termination criteria There are no termination criteria for this constraint.

Parameters:
cdataThe constraint specific data.
linkThe link to process
Returns:
True

Definition at line 258 of file avoid_obstacles.cpp.

virtual double constrained_ik::constraints::AvoidObstacles::getAmplitude ( const std::string &  link_name) const [inline, virtual]

getter for link amplitude

Parameters:
link_nameName of link to get amplitude data
Returns:
amplitude_ On error -1.0 is returned

Definition at line 239 of file avoid_obstacles.h.

virtual double constrained_ik::constraints::AvoidObstacles::getAvoidanceDistance ( const std::string &  link_name) const [inline, virtual]

getter for link avoidance distance

Parameters:
link_nameName of link to get avoidance distance data
Returns:
avoidance_distance_ On error -1.0 is returned

Definition at line 265 of file avoid_obstacles.h.

virtual std::vector<std::string> constrained_ik::constraints::AvoidObstacles::getAvoidanceLinkNames ( ) const [inline, virtual]

getter for obstacle avoidance links

Returns:
link_names_

Definition at line 293 of file avoid_obstacles.h.

LinkAvoidance* constrained_ik::constraints::AvoidObstacles::getLinkData ( const std::string  link_name) [inline, protected]

Get a links avoidance data.

Parameters:
link_namename of the link
Returns:
LinkAvoidance object for named link

Definition at line 91 of file avoid_obstacles.h.

const LinkAvoidance* const constrained_ik::constraints::AvoidObstacles::getLinkData ( const std::string  link_name) const [inline, protected]

Get a links avoidance data.

Parameters:
link_namename of the link
Returns:
LinkAvoidance object for named link

Definition at line 111 of file avoid_obstacles.h.

virtual double constrained_ik::constraints::AvoidObstacles::getMinDistance ( const std::string &  link_name) const [inline, virtual]

getter for link min_distance_

Parameters:
link_nameName of link to get min_distance_
Returns:
min_distance_ On error -1.0 is returned

Definition at line 213 of file avoid_obstacles.h.

virtual double constrained_ik::constraints::AvoidObstacles::getWeight ( const std::string &  link_name) const [inline, virtual]

getter for link weight_

Parameters:
link_nameName of link to get weight_
Returns:
weight_ On error -1.0 is returned

Definition at line 187 of file avoid_obstacles.h.

void constrained_ik::constraints::AvoidObstacles::init ( const Constrained_IK ik) [override, virtual]

Initialize constraint (overrides Constraint::init) Should be called before using class.

Parameters:
ikPointer to Constrained_IK used for base-class init

Reimplemented from constrained_ik::Constraint.

Definition at line 59 of file avoid_obstacles.cpp.

virtual void constrained_ik::constraints::AvoidObstacles::setAmplitude ( const std::string &  link_name,
const double &  amplitude 
) [inline, virtual]

setter for link amplitude

Parameters:
link_nameName of link to set amplitude_
amplitudeValue to set amplitude_ to

Definition at line 253 of file avoid_obstacles.h.

virtual void constrained_ik::constraints::AvoidObstacles::setAvoidanceDistance ( const std::string &  link_name,
const double &  avoidance_distance 
) [inline, virtual]

setter for link avoidance distance

Parameters:
link_nameName of link to set avoidance_distance_
avoidance_distanceValue to set avoidance_distance_ to

Definition at line 279 of file avoid_obstacles.h.

virtual void constrained_ik::constraints::AvoidObstacles::setAvoidanceLinks ( const std::vector< std::string > &  link_names) [inline, virtual]

setter for obstacle avoidance links

Parameters:
link_namesList of link names to set link_names_

Definition at line 302 of file avoid_obstacles.h.

virtual void constrained_ik::constraints::AvoidObstacles::setMinDistance ( const std::string &  link_name,
const double &  min_distance 
) [inline, virtual]

setter for link min_distance_

Parameters:
link_nameName of link to set min_distance_
min_distanceValue to set min_distance_ to

Definition at line 227 of file avoid_obstacles.h.

virtual void constrained_ik::constraints::AvoidObstacles::setWeight ( const std::string &  link_name,
const double &  weight 
) [inline, virtual]

setter for link weight_

Parameters:
link_nameName of link to set weight_
weightValue to set weight_ to

Definition at line 201 of file avoid_obstacles.h.


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


constrained_ik
Author(s): Chris Lewis , Jeremy Zoss , Dan Solomon
autogenerated on Sat Jun 8 2019 19:23:46