Weitere Vorbereitungen
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
|
||||
def sb_write(fd, servo, pulse):
|
||||
try:
|
||||
os.write(fd, '%d=%d\n' % (servo,pulse))
|
||||
except IOError as e:
|
||||
print e
|
||||
|
||||
try:
|
||||
fd = os.open('/dev/servoblaster', os.O_WRONLY)
|
||||
except OSError as e:
|
||||
print 'could not open /dev/servoblaster'
|
||||
raise SystemExit(5)
|
||||
except (KeyboardInterrupt, SystemExit):
|
||||
os.close(fd)
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -80,6 +80,7 @@ try:
|
||||
|
||||
delta = 1.0 / 50
|
||||
print("({},{} --> {})".format(car.speed_cur, car.angle_cur, (car.speed_cur - car.speed_last) / delta)) + ", Servo_active: " + str(car.is_testmode_servo_active) + "CC Speed: " str(car.speed_cruise_control)
|
||||
sleep(1 / 50)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print "Exiting through keyboard event (CTRL + C)"
|
||||
|
||||
Reference in New Issue
Block a user