45 return srdf_config_->getPlanningScene()->getRobotModel()->getLinkModelNamesWithCollisionGeometry();
53 auto& disabled_list =
srdf_config_->getDisabledCollisions();
54 disabled_list.clear();
57 srdf::Model::CollisionPair dc;
63 if (pair_it->second.disable_check)
65 dc.link1_ = pair_it->first.first;
66 dc.link2_ = pair_it->first.second;
68 disabled_list.push_back(dc);
76 auto& disabled_list =
srdf_config_->getDisabledCollisions();
78 srdf::Model::CollisionPair dc;
80 std::set<srdf::Model::CollisionPair, CollisionPairLess> disabled_collisions;
81 for (
auto& p : disabled_list)
83 if (p.link1_ >= p.link2_)
84 std::swap(p.link1_, p.link2_);
85 disabled_collisions.insert(p);
92 if (link_pair.second.disable_check)
94 if ((1 << link_pair.second.reason) & skip_mask)
97 dc.link1_ = link_pair.first.first;
98 dc.link2_ = link_pair.first.second;
99 if (dc.link1_ >= dc.link2_)
100 std::swap(dc.link1_, dc.link2_);
103 disabled_collisions.insert(dc);
107 disabled_list.assign(disabled_collisions.begin(), disabled_collisions.end());
119 planning_scene::PlanningScenePtr scene =
srdf_config_->getPlanningScene()->diff();
126 std::pair<std::string, std::string> link_pair;
129 for (
const auto& disabled_collision :
srdf_config_->getDisabledCollisions())
132 link_pair.first = disabled_collision.link1_;
133 link_pair.second = disabled_collision.link2_;
134 if (link_pair.first >= link_pair.second)
135 std::swap(link_pair.first, link_pair.second);
152 boost::thread([
this, num_trials, min_frac, verbose] {
generateCollisionTable(num_trials, min_frac, verbose); });
160 const bool include_never_colliding =
true;
163 srdf_config_->getPlanningScene()->getAllowedCollisionMatrixNonConst().clear();
167 num_trials, min_frac, verbose);
const rclcpp::Logger & getLogger() const
Makes a namespaced logger for this step available to the widget.
std::vector< std::string > getCollidingLinks()
void startGenerationThread(unsigned int num_trials, double min_frac, bool verbose=true)
int getThreadProgress() const
void linkPairsFromSRDF()
Load Link Pairs from SRDF Format.
LinkPairMap link_pairs_
main storage of link pair data
void joinGenerationThread()
void cancelGenerationThread()
void generateCollisionTable(unsigned int num_trials, double min_frac, bool verbose)
void linkPairsToSRDFSorted(size_t skip_mask=0)
Output Link Pairs to SRDF Format; sorted; with optional filter.
void linkPairsToSRDF()
Output Link Pairs to SRDF Format.
std::shared_ptr< SRDFConfig > srdf_config_
LinkPairMap computeDefaultCollisions(const planning_scene::PlanningSceneConstPtr &parent_scene, unsigned int *progress, const bool include_never_colliding, const unsigned int trials, const double min_collision_faction, const bool verbose)
Generate an adjacency list of links that are always and never in collision, to speed up collision det...
void computeLinkPairs(const planning_scene::PlanningScene &scene, LinkPairMap &link_pairs)
Generate a list of unique link pairs for all links with geometry. Order pairs alphabetically....
DisabledReason disabledReasonFromString(const std::string &reason)
Converts a string reason for disabling a link pair into a struct data type.
const std::string disabledReasonToString(DisabledReason reason)
Converts a reason for disabling a link pair into a string.
Store details on a pair of links.