git.haldean.org wallbot / 7c5a15e wb / main.nim
7c5a15e

Tree @7c5a15e (Download .tar.gz)

main.nim @7c5a15eraw · history · blame

import basic2d
import display
import hal
import machine
import math
import plan
import position

var mp = initMotionPlanner(
  initHal(stepdeg = 0.42),
  WallPosition(
    rl: 4, rr: 4, rl_zero: 4, rr_zero: 4, rpos: vector2d(0, 0),
    pl: vector2d(-4.0, 5.0), pr: vector2d(2.0, 4.0)))

displayStart(mp.position)

mp.enable(left = true, right = true)
mp.relativeMove(vector2d(0, 2), 0.5)
mp.relativeMove(vector2d(2, 0), 0.5)
mp.relativeMove(vector2d(0, -2), 0.5)
mp.relativeMove(vector2d(-2, 0), 0.5)

displayWait()