Skip to content

Commit fae4520

Browse files
committed
expose Stage API to get the matching introspection ID
This was implicitly requested in moveit#192 .
1 parent 062a0c2 commit fae4520

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

core/include/moveit/task_constructor/stage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ class Stage
180180
const std::string& name() const;
181181
void setName(const std::string& name);
182182

183+
uint32_t introspectionId() const;
184+
183185
/** set computation timeout (in seconds)
184186
*
185187
* The logic of the individual stage should ensure this limit is respected.

core/src/stage.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@ void Stage::setName(const std::string& name) {
283283
pimpl_->name_ = name;
284284
}
285285

286+
uint32_t Stage::introspectionId() const {
287+
if (!pimpl_->introspection_)
288+
throw std::runtime_error(
289+
"Introspection not available. Initialize the full Task before calling introspectionId()");
290+
return const_cast<const moveit::task_constructor::Introspection*>(pimpl_->introspection_)->stageId(this);
291+
}
292+
286293
void Stage::forwardProperties(const InterfaceState& source, InterfaceState& dest) {
287294
const PropertyMap& src = source.properties();
288295
PropertyMap& dst = dest.properties();

0 commit comments

Comments
 (0)