def launch(self): self.start = round(time.time(),2) self.stop = round(self.start+self.runTime,2) velchange.goXYOmegaTheta(self.vel_x, self.vel_y, self.omega, self.theta) while(time.time() < self.stop): pass velchange.goXYOmega(0,0,0)
def launch(self): self.start = round(time.time(), 2) self.stop = round(self.start + self.runTime, 2) velchange.goXYOmegaTheta(self.vel_x, self.vel_y, self.omega, self.theta) while (time.time() < self.stop): pass velchange.goXYOmega(0, 0, 0)
def execute(self): velchange.goXYOmega(self.vel_x, self.vel_y, self.omega) self.timestamp = getTime()
#!/usr/bin/python from motor_control import velchange import math import time scale = .3 velchange.goXYOmega(scale, 0, 0) time.sleep(1) velchange.goXYOmega(0, 0, 0) time.sleep(1) velchange.goXYOmega(-scale, 0, 0) time.sleep(1) velchange.goXYOmega(0, 0, 0) time.sleep(1) velchange.goXYOmega(scale * math.cos(2 * math.pi / 3), scale * math.sin(2 * math.pi / 3), 0) time.sleep(1) velchange.goXYOmega(0, 0, 0) time.sleep(1) velchange.goXYOmega(-math.cos(2 * math.pi / 3) * scale, -math.sin(2 * math.pi / 3) * scale, 0) time.sleep(1) velchange.goXYOmega(0, 0, 0) time.sleep(1) velchange.goXYOmega( math.cos(-2 * math.pi / 3) * scale, math.sin(-2 * math.pi / 3) * scale, 0) time.sleep(1) velchange.goXYOmega(0, 0, 0) time.sleep(1) velchange.goXYOmega(-math.cos(-2 * math.pi / 3) * scale,
from kalman_filter import Robot from param import * from motor_control import velchange import Point import MotionSkills import time from motor_control import roboclaw print("Go to point") #this sets the pid constants roboclaw.calibrateRoboclaws() Motion_Skills = MotionSkills.MotionSkills() state = Robot.State() desiredPoint = Point.Point(1.75, 0.5) command = Motion_Skills.go_to_point(state, desiredPoint) velchange.goXYOmega(command.vel_x, command.vel_y, 0) print("Run Time: %s" % command.runTime) time.sleep(command.runTime) velchange.goXYOmega(0,0,0)
#!/usr/bin/python from motor_control import velchange import math import time scale = .3 velchange.goXYOmega(scale,0,0) time.sleep(1) velchange.goXYOmega(0,0,0) time.sleep(1) velchange.goXYOmega(-scale,0,0) time.sleep(1) velchange.goXYOmega(0,0,0) time.sleep(1) velchange.goXYOmega(scale*math.cos(2*math.pi/3),scale*math.sin(2*math.pi/3),0) time.sleep(1) velchange.goXYOmega(0,0,0) time.sleep(1) velchange.goXYOmega(-math.cos(2*math.pi/3)*scale,-math.sin(2*math.pi/3)*scale,0) time.sleep(1) velchange.goXYOmega(0,0,0) time.sleep(1) velchange.goXYOmega(math.cos(-2*math.pi/3)*scale,math.sin(-2*math.pi/3)*scale,0) time.sleep(1) velchange.goXYOmega(0,0,0) time.sleep(1) velchange.goXYOmega(-math.cos(-2*math.pi/3)*scale,-math.sin(-2*math.pi/3)*scale,0) time.sleep(1) velchange.goXYOmega(0,0,0)