Skip to content

Commit 62d8941

Browse files
v4hnrhaschke
authored andcommitted
expose Stage API to get the matching introspection ID
This was implicitly requested in #192 .
1 parent 6bebe3f commit 62d8941

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ 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("Task is not initialized yet or Introspection was disabled.");
289+
return const_cast<const moveit::task_constructor::Introspection*>(pimpl_->introspection_)->stageId(this);
290+
}
291+
286292
void Stage::forwardProperties(const InterfaceState& source, InterfaceState& dest) {
287293
const PropertyMap& src = source.properties();
288294
PropertyMap& dst = dest.properties();

0 commit comments

Comments
 (0)