import {
"moonbitstack/moonmcl" @mctl,
}
// A jerk-limited move over twelve metres.
let profile = @mctl.scurve(distance=12.0, v_max=2.0, a_max=1.0, j_max=4.0)
let end = profile.sample(profile.duration())
assert_eq((end.position - 12.0).abs() < 1.0e-6, true)
assert_eq(end.velocity.abs() < 1.0e-6, true)
// A route across an eight by eight grid with a wall in it.
let grid = @mctl.Grid::new(8, 8)
for row in 0..<6 {
grid.block(4, row)
}
let route = @mctl.grid_path(grid, start=grid.node(0, 0), goal=grid.node(7, 7))
assert_eq(route.length() > 8, true)