joint_model_group.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2013, Ioan A. Sucan
5 * Copyright (c) 2008-2013, Willow Garage, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of Willow Garage, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *********************************************************************/
35 
36 /* Author: Ioan Sucan */
37 
38 #ifndef MOVEIT_CORE_ROBOT_MODEL_JOINT_MODEL_GROUP_
39 #define MOVEIT_CORE_ROBOT_MODEL_JOINT_MODEL_GROUP_
40 
44 #include <srdfdom/model.h>
45 #include <boost/function.hpp>
46 #include <set>
47 
48 namespace moveit
49 {
50 namespace core
51 {
52 class RobotModel;
54 
56 typedef boost::function<kinematics::KinematicsBasePtr(const JointModelGroup*)> SolverAllocatorFn;
57 
59 typedef std::map<const JointModelGroup*, SolverAllocatorFn> SolverAllocatorMapFn;
60 
62 typedef std::map<std::string, JointModelGroup*> JointModelGroupMap;
63 
65 typedef std::map<std::string, const JointModelGroup*> JointModelGroupMapConst;
66 
67 typedef std::vector<const JointModel::Bounds*> JointBoundsVector;
68 
70 {
71 public:
73  {
75  {
76  }
77 
79  operator bool() const
80  {
81  return allocator_ && !bijection_.empty() && solver_instance_;
82  }
83 
84  void reset()
85  {
86  solver_instance_.reset();
87  solver_instance_const_.reset();
88  bijection_.clear();
89  }
90 
92  SolverAllocatorFn allocator_;
93 
99  std::vector<unsigned int> bijection_;
100 
101  kinematics::KinematicsBaseConstPtr solver_instance_const_;
102 
103  kinematics::KinematicsBasePtr solver_instance_;
104 
106 
107  unsigned int default_ik_attempts_;
108  };
109 
111  typedef std::map<const JointModelGroup*, KinematicsSolver> KinematicsSolverMap;
112 
113  JointModelGroup(const std::string& name, const srdf::Model::Group& config,
114  const std::vector<const JointModel*>& joint_vector, const RobotModel* parent_model);
115 
117 
119  const RobotModel& getParentModel() const
120  {
121  return *parent_model_;
122  }
123 
125  const std::string& getName() const
126  {
127  return name_;
128  }
129 
132  {
133  return config_;
134  }
135 
137  bool hasJointModel(const std::string& joint) const;
138 
140  bool hasLinkModel(const std::string& link) const;
141 
143  const JointModel* getJointModel(const std::string& joint) const;
144 
146  const LinkModel* getLinkModel(const std::string& link) const;
147 
149  const std::vector<const JointModel*>& getJointModels() const
150  {
151  return joint_model_vector_;
152  }
153 
156  const std::vector<std::string>& getJointModelNames() const
157  {
159  }
160 
162  const std::vector<const JointModel*>& getActiveJointModels() const
163  {
165  }
166 
169  const std::vector<std::string>& getActiveJointModelNames() const
170  {
172  }
173 
175  const std::vector<const JointModel*>& getFixedJointModels() const
176  {
177  return fixed_joints_;
178  }
179 
181  const std::vector<const JointModel*>& getMimicJointModels() const
182  {
183  return mimic_joints_;
184  }
185 
187  const std::vector<const JointModel*>& getContinuousJointModels() const
188  {
190  }
191 
194  const std::vector<std::string>& getVariableNames() const
195  {
196  return variable_names_;
197  }
198 
206  const std::vector<const JointModel*>& getJointRoots() const
207  {
208  return joint_roots_;
209  }
210 
212  const JointModel* getCommonRoot() const
213  {
214  return common_root_;
215  }
216 
218  const std::vector<const LinkModel*>& getLinkModels() const
219  {
220  return link_model_vector_;
221  }
222 
224  const std::vector<std::string>& getLinkModelNames() const
225  {
227  }
228 
230  const std::vector<std::string>& getLinkModelNamesWithCollisionGeometry() const
231  {
233  }
234 
239  const std::vector<const LinkModel*>& getUpdatedLinkModels() const
240  {
242  }
243 
245  const std::set<const LinkModel*>& getUpdatedLinkModelsSet() const
246  {
248  }
249 
251  const std::vector<std::string>& getUpdatedLinkModelNames() const
252  {
254  }
255 
259  const std::vector<const LinkModel*>& getUpdatedLinkModelsWithGeometry() const
260  {
262  }
263 
265  const std::set<const LinkModel*>& getUpdatedLinkModelsWithGeometrySet() const
266  {
268  }
269 
271  const std::vector<std::string>& getUpdatedLinkModelsWithGeometryNames() const
272  {
274  }
275 
277  const std::set<std::string>& getUpdatedLinkModelsWithGeometryNamesSet() const
278  {
280  }
281 
285  bool isLinkUpdated(const std::string& name) const
286  {
288  }
289 
291  const std::vector<int>& getVariableIndexList() const
292  {
293  return variable_index_list_;
294  }
295 
297  int getVariableGroupIndex(const std::string& variable) const;
298 
300  const std::vector<std::string>& getDefaultStateNames() const
301  {
302  return default_states_names_;
303  }
304 
305  void addDefaultState(const std::string& name, const std::map<std::string, double>& default_state);
306 
308  bool getVariableDefaultPositions(const std::string& name, std::map<std::string, double>& values) const;
309 
311  void getVariableDefaultPositions(std::map<std::string, double>& values) const;
312 
314  void getVariableDefaultPositions(std::vector<double>& values) const
315  {
316  values.resize(variable_count_);
317  getVariableDefaultPositions(&values[0]);
318  }
319 
321  void getVariableDefaultPositions(double* values) const;
322 
325  {
327  }
328 
330  void getVariableRandomPositions(random_numbers::RandomNumberGenerator& rng, std::vector<double>& values) const
331  {
332  values.resize(variable_count_);
334  }
335 
337  void getVariableRandomPositionsNearBy(random_numbers::RandomNumberGenerator& rng, double* values, const double* near,
338  const double distance) const
339  {
341  }
344  const std::vector<double>& near, double distance) const
345  {
346  values.resize(variable_count_);
347  getVariableRandomPositionsNearBy(rng, &values[0], active_joint_models_bounds_, &near[0], distance);
348  }
349 
352  const std::vector<double>& near,
353  const std::map<JointModel::JointType, double>& distance_map) const
354  {
355  values.resize(variable_count_);
356  getVariableRandomPositionsNearBy(rng, &values[0], active_joint_models_bounds_, &near[0], distance_map);
357  }
358 
361  const std::vector<double>& near, const std::vector<double>& distances) const
362  {
363  values.resize(variable_count_);
364  getVariableRandomPositionsNearBy(rng, &values[0], active_joint_models_bounds_, &near[0], distances);
365  }
366 
368  const JointBoundsVector& active_joint_bounds) const;
369 
372  const JointBoundsVector& active_joint_bounds, const double* near,
373  const double distance) const;
374 
377  const JointBoundsVector& active_joint_bounds, const double* near,
378  const std::map<JointModel::JointType, double>& distance_map) const;
379 
382  const JointBoundsVector& active_joint_bounds, const double* near,
383  const std::vector<double>& distances) const;
384 
385  bool enforcePositionBounds(double* state) const
386  {
388  }
389 
390  bool enforcePositionBounds(double* state, const JointBoundsVector& active_joint_bounds) const;
391  bool satisfiesPositionBounds(const double* state, double margin = 0.0) const
392  {
394  }
395  bool satisfiesPositionBounds(const double* state, const JointBoundsVector& active_joint_bounds,
396  double margin = 0.0) const;
397 
398  double getMaximumExtent() const
399  {
401  }
402  double getMaximumExtent(const JointBoundsVector& active_joint_bounds) const;
403 
404  double distance(const double* state1, const double* state2) const;
405  void interpolate(const double* from, const double* to, double t, double* state) const;
406 
409  unsigned int getVariableCount() const
410  {
411  return variable_count_;
412  }
413 
415  void setSubgroupNames(const std::vector<std::string>& subgroups);
416 
418  const std::vector<std::string>& getSubgroupNames() const
419  {
420  return subgroup_names_;
421  }
422 
424  void getSubgroups(std::vector<const JointModelGroup*>& sub_groups) const;
425 
427  bool isSubgroup(const std::string& group) const
428  {
429  return subgroup_names_set_.find(group) != subgroup_names_set_.end();
430  }
431 
433  bool isChain() const
434  {
435  return is_chain_;
436  }
437 
439  bool isSingleDOFJoints() const
440  {
441  return is_single_dof_;
442  }
443 
445  bool isEndEffector() const
446  {
447  return !end_effector_name_.empty();
448  }
449 
451  {
453  }
454 
456  const std::string& getEndEffectorName() const
457  {
458  return end_effector_name_;
459  }
460 
462  void setEndEffectorName(const std::string& name);
463 
467  void setEndEffectorParent(const std::string& group, const std::string& link);
468 
470  void attachEndEffector(const std::string& eef_name);
471 
474  const std::pair<std::string, std::string>& getEndEffectorParentGroup() const
475  {
476  return end_effector_parent_;
477  }
478 
480  const std::vector<std::string>& getAttachedEndEffectorNames() const
481  {
483  }
484 
492  bool getEndEffectorTips(std::vector<const LinkModel*>& tips) const;
493 
501  bool getEndEffectorTips(std::vector<std::string>& tips) const;
502 
509 
511  const JointBoundsVector& getActiveJointModelsBounds() const
512  {
514  }
515 
516  const std::pair<KinematicsSolver, KinematicsSolverMap>& getGroupKinematics() const
517  {
518  return group_kinematics_;
519  }
520 
521  void setSolverAllocators(const SolverAllocatorFn& solver,
522  const SolverAllocatorMapFn& solver_map = SolverAllocatorMapFn())
523  {
524  setSolverAllocators(std::make_pair(solver, solver_map));
525  }
526 
527  void setSolverAllocators(const std::pair<SolverAllocatorFn, SolverAllocatorMapFn>& solvers);
528 
529  const kinematics::KinematicsBaseConstPtr& getSolverInstance() const
530  {
531  return group_kinematics_.first.solver_instance_const_;
532  }
533 
534  const kinematics::KinematicsBasePtr& getSolverInstance()
535  {
536  return group_kinematics_.first.solver_instance_;
537  }
538 
539  bool canSetStateFromIK(const std::string& tip) const;
540 
541  bool setRedundantJoints(const std::vector<std::string>& joints)
542  {
543  if (group_kinematics_.first.solver_instance_)
544  return group_kinematics_.first.solver_instance_->setRedundantJoints(joints);
545  return false;
546  }
547 
549  double getDefaultIKTimeout() const
550  {
551  return group_kinematics_.first.default_ik_timeout_;
552  }
553 
555  void setDefaultIKTimeout(double ik_timeout);
556 
558  unsigned int getDefaultIKAttempts() const
559  {
560  return group_kinematics_.first.default_ik_attempts_;
561  }
562 
564  void setDefaultIKAttempts(unsigned int ik_attempts);
565 
570  const std::vector<unsigned int>& getKinematicsSolverJointBijection() const
571  {
572  return group_kinematics_.first.bijection_;
573  }
574 
576  void printGroupInfo(std::ostream& out = std::cout) const;
577 
578 protected:
579  bool computeIKIndexBijection(const std::vector<std::string>& ik_jnames,
580  std::vector<unsigned int>& joint_bijection) const;
581 
585  void updateMimicJoints(double* values) const;
586 
589 
591  std::string name_;
592 
594  std::vector<const JointModel*> joint_model_vector_;
595 
597  std::vector<std::string> joint_model_name_vector_;
598 
600  std::vector<const JointModel*> active_joint_model_vector_;
601 
603  std::vector<std::string> active_joint_model_name_vector_;
604 
606  std::vector<const JointModel*> fixed_joints_;
607 
609  std::vector<const JointModel*> mimic_joints_;
610 
612  std::vector<const JointModel*> continuous_joint_model_vector_;
613 
616  std::vector<std::string> variable_names_;
617 
620  std::set<std::string> variable_names_set_;
621 
624 
626  std::vector<const JointModel*> joint_roots_;
627 
630 
635 
637  JointBoundsVector active_joint_models_bounds_;
638 
641  std::vector<int> variable_index_list_;
642 
646 
650  std::vector<const LinkModel*> link_model_vector_;
651 
654 
656  std::vector<std::string> link_model_name_vector_;
657 
658  std::vector<const LinkModel*> link_model_with_geometry_vector_;
659 
661  std::vector<std::string> link_model_with_geometry_name_vector_;
662 
665  std::vector<const LinkModel*> updated_link_model_vector_;
666 
669  std::set<const LinkModel*> updated_link_model_set_;
670 
673  std::vector<std::string> updated_link_model_name_vector_;
674 
677  std::set<std::string> updated_link_model_name_set_;
678 
681  std::vector<const LinkModel*> updated_link_model_with_geometry_vector_;
682 
685  std::set<const LinkModel*> updated_link_model_with_geometry_set_;
686 
690 
694 
696  unsigned int variable_count_;
697 
701 
703  std::vector<std::string> subgroup_names_;
704 
706  std::set<std::string> subgroup_names_set_;
707 
709  std::vector<std::string> attached_end_effector_names_;
710 
714  std::pair<std::string, std::string> end_effector_parent_;
715 
717  std::string end_effector_name_;
718 
719  bool is_chain_;
720 
722 
724  {
725  GroupMimicUpdate(int s, int d, double f, double o) : src(s), dest(d), factor(f), offset(o)
726  {
727  }
728  int src;
729  int dest;
730  double factor;
731  double offset;
732  };
733 
734  std::vector<GroupMimicUpdate> group_mimic_update_;
735 
736  std::pair<KinematicsSolver, KinematicsSolverMap> group_kinematics_;
737 
739 
741  std::map<std::string, std::map<std::string, double> > default_states_;
742 
744  std::vector<std::string> default_states_names_;
745 };
746 }
747 }
748 
749 #endif
bool isSubgroup(const std::string &group) const
Check if the joints of group group are a subset of the joints in this group.
SolverAllocatorFn allocator_
Function type that allocates a kinematics solver for a particular group.
void updateMimicJoints(double *values) const
Update the variable values for the state of a group with respect to the mimic joints. This only updates mimic joints that have the parent in this group. If there is a joint mimicking one that is outside the group, there are no values to be read (values is only the group state)
const std::vector< const LinkModel * > & getUpdatedLinkModels() const
Get the names of the links that are to be updated when the state of this group changes. This includes links that are in the kinematic model but outside this group, if those links are descendants of joints in this group that have their values updated. The order is the correct order for updating the corresponding states.
bool hasJointModel(const std::string &joint) const
Check if a joint is part of this group.
const RobotModel & getParentModel() const
Get the kinematic model this group is part of.
std::map< std::string, const LinkModel * > LinkModelMapConst
Map of names to const instances for LinkModel.
Definition: link_model.h:64
const kinematics::KinematicsBaseConstPtr & getSolverInstance() const
std::set< const LinkModel * > updated_link_model_with_geometry_set_
The list of downstream link models in the order they should be updated (may include links that are no...
void setEndEffectorParent(const std::string &group, const std::string &link)
If this group is an end-effector, specify the parent group (e.g., the arm holding the eef) and the li...
const srdf::Model::Group & getConfig() const
get the SRDF configuration this group is based on
const std::vector< std::string > & getVariableNames() const
Get the names of the variables that make up the joints included in this group. The number of returned...
std::vector< GroupMimicUpdate > group_mimic_update_
std::vector< std::string > subgroup_names_
The set of labelled subgroups that are included in this group.
bool isChain() const
Check if this group is a linear chain.
const std::vector< std::string > & getSubgroupNames() const
Get the names of the groups that are subsets of this one (in terms of joints set) ...
std::vector< const JointModel * > joint_model_vector_
Joint instances in the order they appear in the group state.
const JointModel * getJointModel(const std::string &joint) const
Get a joint by its name. Throw an exception if the joint is not part of this group.
int getVariableGroupIndex(const std::string &variable) const
Get the index of a variable within the group. Return -1 on error.
void getVariableRandomPositionsNearBy(random_numbers::RandomNumberGenerator &rng, std::vector< double > &values, const std::vector< double > &near, double distance) const
Compute random values for the state of the joint group.
double getDefaultIKTimeout() const
Get the default IK timeout.
std::set< const LinkModel * > updated_link_model_set_
The list of downstream link models in the order they should be updated (may include links that are no...
bool getVariableDefaultPositions(const std::string &name, std::map< std::string, double > &values) const
Get the values that correspond to a named state as read from the URDF. Return false on failure...
std::map< std::string, std::map< std::string, double > > default_states_
The set of default states specified for this group in the SRDF.
unsigned int variable_count_
The number of variables necessary to describe this group of joints.
const std::vector< std::string > & getLinkModelNames() const
Get the names of the links that are part of this joint group.
const LinkModel * getLinkModel(const std::string &link) const
Get a joint by its name. Throw an exception if the joint is not part of this group.
std::set< std::string > variable_names_set_
The names of the DOF that make up this group (this is just a sequence of joint variable names; not ne...
const std::string & getName() const
Get the name of the joint group.
const std::set< std::string > & getUpdatedLinkModelsWithGeometryNamesSet() const
Get the names of the links returned by getUpdatedLinkModels()
std::vector< std::string > active_joint_model_name_vector_
Names of active joints in the order they appear in the group state.
std::set< std::string > updated_link_model_name_set_
The list of downstream link names in the order they should be updated (may include links that are not...
void getVariableRandomPositionsNearBy(random_numbers::RandomNumberGenerator &rng, double *values, const double *near, const double distance) const
Compute random values for the state of the joint group.
void getVariableRandomPositions(random_numbers::RandomNumberGenerator &rng, std::vector< double > &values) const
Compute random values for the state of the joint group.
const std::vector< const JointModel * > & getMimicJointModels() const
Get the mimic joints that are part of this group.
const std::pair< std::string, std::string > & getEndEffectorParentGroup() const
Get the name of the group this end-effector attaches to (first) and the name of the link in that grou...
std::map< std::string, JointModelGroup * > JointModelGroupMap
Map of names to instances for JointModelGroup.
const std::string & getEndEffectorName() const
Return the name of the end effector, if this group is an end-effector.
GroupMimicUpdate(int s, int d, double f, double o)
bool canSetStateFromIK(const std::string &tip) const
bool getEndEffectorTips(std::vector< const LinkModel * > &tips) const
Get a vector of end effector tips included in a particular joint model group as defined by the SRDF e...
std::vector< const JointModel * > joint_roots_
The list of active joint models that are roots in this group.
std::string name_
Name of group.
std::vector< std::string > joint_model_name_vector_
Names of joints in the order they appear in the group state.
bool is_contiguous_index_list_
True if the state of this group is contiguous within the full robot state; this also means that the i...
Definition of a kinematic model. This class is not thread safe, however multiple instances can be cre...
Definition: robot_model.h:67
std::vector< int > variable_index_list_
The list of index values this group includes, with respect to a full robot state; this includes mimic...
std::vector< std::string > link_model_with_geometry_name_vector_
The names of the links in this group that also have geometry.
std::vector< const LinkModel * > updated_link_model_vector_
The list of downstream link models in the order they should be updated (may include links that are no...
void addDefaultState(const std::string &name, const std::map< std::string, double > &default_state)
std::vector< std::string > default_states_names_
The names of the default states specified for this group in the SRDF.
void setDefaultIKTimeout(double ik_timeout)
Set the default IK timeout.
std::vector< const LinkModel * > link_model_with_geometry_vector_
void interpolate(const double *from, const double *to, double t, double *state) const
unsigned int getVariableCount() const
Get the number of variables that describe this joint group. This includes variables necessary for mim...
bool isLinkUpdated(const std::string &name) const
True if this name is in the set of links that are to be updated when the state of this group changes...
std::map< std::string, const JointModelGroup * > JointModelGroupMapConst
Map of names to const instances for JointModelGroup.
const std::vector< const JointModel * > & getContinuousJointModels() const
Get the array of continuous joints used in this group (may include mimic joints). ...
JointModelMapConst joint_model_map_
A map from joint names to their instances. This includes all joints in the group. ...
const std::vector< unsigned int > & getKinematicsSolverJointBijection() const
Return the mapping between the order of the joints in this group and the order of the joints in the k...
void setEndEffectorName(const std::string &name)
Set the name of the end-effector, and remember this group is indeed an end-effector.
const std::pair< KinematicsSolver, KinematicsSolverMap > & getGroupKinematics() const
const std::vector< const JointModel * > & getFixedJointModels() const
Get the fixed joints that are part of this group.
const std::vector< const LinkModel * > & getUpdatedLinkModelsWithGeometry() const
Get the names of the links that are to be updated when the state of this group changes. This includes links that are in the kinematic model but outside this group, if those links are descendants of joints in this group that have their values updated.
const kinematics::KinematicsBasePtr & getSolverInstance()
std::vector< const JointModel * > mimic_joints_
Joints that mimic other joints.
bool setRedundantJoints(const std::vector< std::string > &joints)
void setSubgroupNames(const std::vector< std::string > &subgroups)
Set the names of the subgroups for this group.
std::vector< std::string > link_model_name_vector_
The names of the links in this group.
const std::vector< std::string > & getDefaultStateNames() const
Get the names of the known default states (as specified in the SRDF)
void getVariableDefaultPositions(std::vector< double > &values) const
Compute the default values for the joint group.
std::vector< std::string > updated_link_model_with_geometry_name_vector_
The list of downstream link names in the order they should be updated (may include links that are not...
void getVariableRandomPositions(random_numbers::RandomNumberGenerator &rng, double *values) const
Compute random values for the state of the joint group.
boost::function< kinematics::KinematicsBasePtr(const JointModelGroup *)> SolverAllocatorFn
Function type that allocates a kinematics solver for a particular group.
JointModelGroup(const std::string &name, const srdf::Model::Group &config, const std::vector< const JointModel * > &joint_vector, const RobotModel *parent_model)
const RobotModel * parent_model_
Owner model.
std::vector< const JointModel::Bounds * > JointBoundsVector
const std::vector< std::string > & getActiveJointModelNames() const
Get the names of the active joints in this group. These are the names of the joints returned by getJo...
const std::vector< std::string > & getJointModelNames() const
Get the names of the joints in this group. These are the names of the joints returned by getJointMode...
VariableIndexMap joint_variables_index_map_
The group includes all the joint variables that make up the joints the group consists of...
std::pair< KinematicsSolver, KinematicsSolverMap > group_kinematics_
JointBoundsVector active_joint_models_bounds_
The bounds for all the active joint models.
void attachEndEffector(const std::string &eef_name)
Notify this group that there is an end-effector attached to it.
void setSolverAllocators(const SolverAllocatorFn &solver, const SolverAllocatorMapFn &solver_map=SolverAllocatorMapFn())
std::map< const JointModelGroup *, KinematicsSolver > KinematicsSolverMap
Map from group instances to allocator functions & bijections.
std::map< std::string, int > VariableIndexMap
Data type for holding mappings from variable names to their position in a state vector.
Definition: joint_model.h:82
const std::vector< std::string > & getAttachedEndEffectorNames() const
Get the names of the end effectors attached to this group.
bool isSingleDOFJoints() const
Return true if the group consists only of joints that are single DOF.
std::vector< const JointModel * > fixed_joints_
The joints that have no DOF (fixed)
kinematics::KinematicsBaseConstPtr solver_instance_const_
std::vector< unsigned int > bijection_
The mapping between the order of the joints in the group and the order of the joints in the kinematic...
A joint from the robot. Models the transform that this joint applies in the kinematic chain...
Definition: joint_model.h:108
const std::vector< const JointModel * > & getJointModels() const
Get all the joints in this group (including fixed and mimic joints).
bool hasLinkModel(const std::string &link) const
Check if a link is part of this group.
bool isEndEffector() const
Check if this group was designated as an end-effector in the SRDF.
void getVariableRandomPositionsNearBy(random_numbers::RandomNumberGenerator &rng, std::vector< double > &values, const std::vector< double > &near, const std::vector< double > &distances) const
Compute random values for the state of the joint group.
const moveit::core::LinkModel * getOnlyOneEndEffectorTip() const
Get one end effector tip, throwing an error if there ends up being more in the joint model group This...
std::vector< std::string > attached_end_effector_names_
If an end-effector is attached to this group, the name of that end-effector is stored in this variabl...
const std::vector< std::string > & getUpdatedLinkModelNames() const
Get the names of the links returned by getUpdatedLinkModels()
const JointModel * getCommonRoot() const
Get the common root of all joint roots; not necessarily part of this group.
unsigned int getDefaultIKAttempts() const
Get the default IK attempts.
std::string end_effector_name_
The name of the end effector, if this group is an end-effector.
const std::vector< int > & getVariableIndexList() const
Get the index locations in the complete robot state for all the variables in this group...
bool enforcePositionBounds(double *state) const
void printGroupInfo(std::ostream &out=std::cout) const
Print information about the constructed model.
LinkModelMapConst link_model_map_
A map from link names to their instances.
const std::vector< std::string > & getLinkModelNamesWithCollisionGeometry() const
Get the names of the links that are part of this joint group and also have geometry associated with t...
bool computeIKIndexBijection(const std::vector< std::string > &ik_jnames, std::vector< unsigned int > &joint_bijection) const
std::vector< const JointModel * > continuous_joint_model_vector_
The set of continuous joints this group contains.
std::vector< const JointModel * > active_joint_model_vector_
Active joint instances in the order they appear in the group state.
std::vector< std::string > variable_names_
The names of the DOF that make up this group (this is just a sequence of joint variable names; not ne...
std::map< const JointModelGroup *, SolverAllocatorFn > SolverAllocatorMapFn
Map from group instances to allocator functions & bijections.
std::vector< int > active_joint_model_start_index_
For each active joint model in this group, hold the index at which the corresponding joint state star...
std::set< std::string > subgroup_names_set_
The set of labelled subgroups that are included in this group.
const std::vector< const JointModel * > & getJointRoots() const
Unlike a complete kinematic model, a group may contain disconnected parts of the kinematic tree – a ...
const std::set< const LinkModel * > & getUpdatedLinkModelsWithGeometrySet() const
Return the same data as getUpdatedLinkModelsWithGeometry() but as a set.
const JointModel * common_root_
The joint that is a common root for all joints in this group (not necessarily part of this group) ...
const std::vector< const JointModel * > & getActiveJointModels() const
Get the active joints in this group (that have controllable DOF). This does not include mimic joints...
const std::vector< const LinkModel * > & getLinkModels() const
Get the links that are part of this joint group.
A link from the robot. Contains the constant transform applied to the link and its geometry...
Definition: link_model.h:72
const std::vector< std::string > & getUpdatedLinkModelsWithGeometryNames() const
Get the names of the links returned by getUpdatedLinkModels()
double distance(const double *state1, const double *state2) const
std::map< std::string, const JointModel * > JointModelMapConst
Map of names to const instances for JointModel.
Definition: joint_model.h:94
const std::set< const LinkModel * > & getUpdatedLinkModelsSet() const
Return the same data as getUpdatedLinkModels() but as a set.
std::pair< std::string, std::string > end_effector_parent_
First: name of the group that is parent to this end-effector group; Second: the link this in the pare...
std::vector< std::string > updated_link_model_name_vector_
The list of downstream link names in the order they should be updated (may include links that are not...
Main namespace for MoveIt!
std::vector< const LinkModel * > updated_link_model_with_geometry_vector_
The list of downstream link models in the order they should be updated (may include links that are no...
void setDefaultIKAttempts(unsigned int ik_attempts)
Set the default IK attempts.
std::set< std::string > updated_link_model_with_geometry_name_set_
The list of downstream link names in the order they should be updated (may include links that are not...
std::vector< const LinkModel * > link_model_vector_
The links that are on the direct lineage between joints and joint_roots_, as well as the children of ...
const JointBoundsVector & getActiveJointModelsBounds() const
Get the bounds for all the active joints.
void getSubgroups(std::vector< const JointModelGroup * > &sub_groups) const
Get the groups that are subsets of this one (in terms of joints set)
void getVariableRandomPositionsNearBy(random_numbers::RandomNumberGenerator &rng, std::vector< double > &values, const std::vector< double > &near, const std::map< JointModel::JointType, double > &distance_map) const
Compute random values for the state of the joint group.
bool satisfiesPositionBounds(const double *state, double margin=0.0) const


moveit_core
Author(s): Ioan Sucan , Sachin Chitta , Acorn Pooley
autogenerated on Sun Oct 18 2020 13:16:33