Skip to content

Commit

Permalink
Use a timer to limit the path finding
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Feb 15, 2019
1 parent 5144e27 commit 0a6e1bb
Show file tree
Hide file tree
Showing 90 changed files with 18,168 additions and 18,118 deletions.
6 changes: 5 additions & 1 deletion surface_vectorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,13 @@ optional<linestring_type_fp> do_milling(
const double horizontalG0speed = 100;
const double g0_time = vertical_distance/vertG0speed + max_manhattan/horizontalG0speed + vertical_distance/vertG1speed;
const double max_g1_distance = g0_time * horizontalG1speed;
//path_finding::PathLimiter x = [](const point_type_fp& target, const coordinate_type_fp& length) -> bool { return true; };
using namespace std::chrono;
auto t1 = system_clock::now();
path_finding::PathLimiter path_limiter =
[&](const point_type_fp& waypoint, const coordinate_type_fp& length_so_far) -> bool {
if (system_clock::now() - t1 > seconds(1)) {
return true;
}
// Return true if this path needs to be clipped. The distance from
// a to target so far is length. At best, we'll have a stright
// line from there to the goal, b.
Expand Down
Loading

0 comments on commit 0a6e1bb

Please sign in to comment.