Skip to content

Commit 6d104e8

Browse files
committed
polish: FixedState supports collision checking
1 parent 0a3dd3a commit 6d104e8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/src/stages/fixed_state.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ bool FixedState::canCompute() const {
6363
}
6464

6565
void FixedState::compute() {
66-
auto cost = !properties().get<bool>("ignore_collisions") && scene_->isStateColliding() ?
67-
std::numeric_limits<double>::infinity() :
68-
0.0;
69-
spawn(InterfaceState(scene_), cost);
66+
SubTrajectory trajectory;
67+
if (!properties().get<bool>("ignore_collisions") && scene_->isStateColliding()) {
68+
trajectory.markAsFailure("in collision");
69+
}
70+
71+
spawn(InterfaceState(scene_), std::move(trajectory));
7072
ran_ = true;
7173
}
7274
} // namespace stages

0 commit comments

Comments
 (0)