mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
streamline trait parameters
state asked for a reference, but trajectories for a pointer.
This commit is contained in:
parent
bca01e8aa7
commit
a82b88355e
@ -391,14 +391,14 @@ inline const InterfaceState* state<Interface::BACKWARD>(const SolutionBase& solu
|
|||||||
|
|
||||||
/// Trait to retrieve outgoing (FORWARD) or incoming (BACKWARD) solution segments of a given state
|
/// Trait to retrieve outgoing (FORWARD) or incoming (BACKWARD) solution segments of a given state
|
||||||
template <Interface::Direction dir>
|
template <Interface::Direction dir>
|
||||||
const InterfaceState::Solutions& trajectories(const InterfaceState* state);
|
const InterfaceState::Solutions& trajectories(const InterfaceState& state);
|
||||||
template <>
|
template <>
|
||||||
inline const InterfaceState::Solutions& trajectories<Interface::FORWARD>(const InterfaceState* state) {
|
inline const InterfaceState::Solutions& trajectories<Interface::FORWARD>(const InterfaceState& state) {
|
||||||
return state->outgoingTrajectories();
|
return state.outgoingTrajectories();
|
||||||
}
|
}
|
||||||
template <>
|
template <>
|
||||||
inline const InterfaceState::Solutions& trajectories<Interface::BACKWARD>(const InterfaceState* state) {
|
inline const InterfaceState::Solutions& trajectories<Interface::BACKWARD>(const InterfaceState& state) {
|
||||||
return state->incomingTrajectories();
|
return state.incomingTrajectories();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Trait to retrieve opposite direction (FORWARD <-> BACKWARD)
|
/// Trait to retrieve opposite direction (FORWARD <-> BACKWARD)
|
||||||
|
|||||||
@ -317,7 +317,7 @@ struct SolutionCollector
|
|||||||
}
|
}
|
||||||
|
|
||||||
void traverse(const SolutionBase& start, const InterfaceState::Priority& prio) {
|
void traverse(const SolutionBase& start, const InterfaceState::Priority& prio) {
|
||||||
const InterfaceState::Solutions& next = trajectories<dir>(state<dir>(start));
|
const InterfaceState::Solutions& next = trajectories<dir>(*state<dir>(start));
|
||||||
if (next.empty()) { // when reaching the end, add the trace to solutions
|
if (next.empty()) { // when reaching the end, add the trace to solutions
|
||||||
assert(prio.depth() == trace.size());
|
assert(prio.depth() == trace.size());
|
||||||
assert(prio.depth() <= max_depth);
|
assert(prio.depth() <= max_depth);
|
||||||
|
|||||||
@ -166,7 +166,7 @@ void StagePrivate::setStatus(const InterfaceState* s, InterfaceState::Status sta
|
|||||||
status = InterfaceState::DISABLED; // only the first state is marked as FAILED
|
status = InterfaceState::DISABLED; // only the first state is marked as FAILED
|
||||||
|
|
||||||
// traverse solution tree
|
// traverse solution tree
|
||||||
for (const SolutionBase* successor : trajectories<dir>(s))
|
for (const SolutionBase* successor : trajectories<dir>(*s))
|
||||||
setStatus<dir>(state<dir>(*successor), status);
|
setStatus<dir>(state<dir>(*successor), status);
|
||||||
}
|
}
|
||||||
template void StagePrivate::setStatus<Interface::FORWARD>(const InterfaceState* s, InterfaceState::Status status);
|
template void StagePrivate::setStatus<Interface::FORWARD>(const InterfaceState* s, InterfaceState::Status status);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user