#!/usr/bin/env python3 import ev3dev.ev3 as ev3 from wheel import Wheel from sensor import Sensor class Move: def __init__(self, planet): self._wheel_l = Wheel('outB') self._wheel_r = Wheel('outC') self._sensor = Sensor() self._bumper = ev3.TouchSensor() ''' determine maximum and minimum brightness of lines/white space depending on environment lighting ''' def _calibrate(self): pass ''' Function to correct errors should the robot wander astray ''' def _aligntoedge(self): pass ''' uses odometry and the planet object to map edges that are connected to current node. ''' def getstationedges(self): pass def traversetonextstation(self, isknownstation): self._wheel_l.speed_set = 24 self._wheel_r.speed_set = 24 self._wheel_l.run() self._wheel_r.run() while(self._bumper.value() == False): # this does not work... why? # self._wheel_l.speed_set(newspeed) # self._wheel_r.speed_set(newspeed) self._wheel_l._motor.duty_cycle_sp = 48 - self._sensor.getbrightness() self._wheel_r._motor.duty_cycle_sp = self._sensor.getbrightness() if(isknownstation == False): pass #run odometry stuff here self._wheel_l.stop() self._wheel_r.stop()