added RoFish and adaptiveFreqOsc sketches

This commit is contained in:
M. Stokroos
2019-02-01 13:36:01 +01:00
parent 4ee18c83aa
commit 1f3d63ea1c
8 changed files with 581 additions and 4 deletions

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env python
import sys, time
import carcomm
if __name__ == "__main__":
try:
# voorlopig vast
port = "/dev/ttyUSB0"
baudrate = 28800
parity = 'N'
rtscts = False
xonxoff = False
echo = False
convert_outgoing = carcomm.CONVERT_CRLF
repr_mode = 0
carcon = carcomm.CarControl(
port,
baudrate,
parity,
rtscts,
xonxoff,
echo,
convert_outgoing,
repr_mode,
)
time.sleep(2) # de nexus robot is niet zo snel..
carcon.sendpacket(20,0)
carcon.getinfopacket()
for x in range(0, 200):
carcon.setspeed( 2.5, 0.0)
# carcon.getinfopacket()
time.sleep(0.05)
carcon.setspeed( 2.5, 0.0)
# carcon.getinfopacket()
time.sleep(0.05)
carcon.setspeed( 0, 0)
except carcomm.serial.SerialException as e:
sys.stderr.write("could not open port %r: %s\n" % (port, e))
sys.exit(1)