This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the Lidar returns some error values when it can't get a measurement. | |
# any value below 16mm indicates a bad reading or other problem. | |
# this code is practice for trimming the bad readings out of the array | |
# containing distances & angles. | |
import numpy as np | |
np.set_printoptions(suppress=True) | |
# create an array with some distances which returned invalid (ie 0, 0.002) | |
scan= np.array([ \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcm.!default { | |
type plug | |
slave { | |
pcm "hw:1,0" | |
} | |
} | |
ctl.!default { | |
type hw | |
card 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the SCUTTLE replacement for the adafruit_pwm.py file | |
# Use this program to overwrite the original adafruit_pwm.py contents. | |
def setup(robot_config): # setup is a required function for the selected hardware program | |
return | |
# A function for sending command to a file in the temporary folder | |
def tmpFile(value): # this function takes a 2-element array called val | |
txt = open("/tmp/commandFile.txt",'w+') # file with specified name | |
txt.write(str(value)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# l2_displacement.py | |
# This program takes the encoder values from encoders, computes wheel movement | |
# calculates the chassis displacement and continuously adds up the displacement | |
# to indicate how much the robot has advanced, in meters. | |
import L1_encoder as enc # local library for encoders | |
import numpy as np # library for math operations | |
import time # library for time access |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import math | |
import logging | |
import numpy as np | |
from scuttlepy import gpio | |
from scuttlepy import wheels | |
from scuttlepy import mpu | |
# Create and configure logger | |
logging.basicConfig(filename="robotTest.log", format='%(asctime)s %(message)s', filemode='w') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"22de6241.99d99e","type":"tab","label":"ReceiveMQTT","disabled":false,"info":""},{"id":"fa9bfea5.972ee","type":"mqtt in","z":"22de6241.99d99e","name":"","topic":"SCUTTLE/pi/cmd","qos":"2","datatype":"auto","broker":"1cc0cc73.690154","x":120,"y":80,"wires":[["721e0737.c93978","8d8ca943.671f88"]]},{"id":"721e0737.c93978","type":"csv","z":"22de6241.99d99e","name":"","sep":",","hdrin":false,"hdrout":"all","multi":"one","ret":"\\n","temp":"fieldA, fieldB","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":180,"y":180,"wires":[["cc5a197f.041b88","5895d1cf.f5221"]]},{"id":"cc5a197f.041b88","type":"file","z":"22de6241.99d99e","name":"","filename":"/home/pi/piScuttle/data3.csv","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":350,"y":240,"wires":[[]]},{"id":"5895d1cf.f5221","type":"debug","z":"22de6241.99d99e","name":"debug3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","sta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"22de6241.99d99e","type":"tab","label":"GamePad","disabled":false,"info":""},{"id":"3f6df30c.f1a0bc","type":"csv","z":"22de6241.99d99e","name":"","sep":"\\t","hdrin":true,"hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":370,"y":280,"wires":[["51721a8b.c03934","6003e56b.07b51c"]]},{"id":"d4cc4cd7.6b652","type":"file in","z":"22de6241.99d99e","name":"","filename":"/home/pi/piScuttle/data2.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":260,"y":200,"wires":[["3f6df30c.f1a0bc"]]},{"id":"ab78c8b0.7a8e18","type":"inject","z":"22de6241.99d99e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":120,"wires":[["d4cc4cd7.6b652"]]},{"id":"51721a8b.c03934","type":"mqtt out","z":"22de6241.99d99e","name":"","topic":"SCUTTLE/pi/gp2","qos":"2","retain":"","broker":"1cc0cc73.690154","x":470, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"4a052b50.075214","type":"tab","label":"PlotGP","disabled":false,"info":""},{"id":"dc90d6ca.9573c8","type":"ui_chart","z":"4a052b50.075214","name":"GamePad axis0 Chart","group":"341ef7b5.bb9218","order":6,"width":0,"height":0,"label":"Gamepad Axis0 Chart","chartType":"line","legend":"false","xformat":"HH:mm","interpolate":"linear","nodata":"Waiting for Data...","dot":false,"ymin":"-100","ymax":"100","removeOlder":"10","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":240,"y":260,"wires":[[]]},{"id":"350633a1.11bc9c","type":"ui_gauge","z":"4a052b50.075214","name":"","group":"341ef7b5.bb9218","order":1,"width":0,"height":0,"gtype":"gage","title":"Gamepad Axis0 Value","label":"percent","format":"{{value}}","min":"-100","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":240,"y":220,"wires":[]},{"id":"1cbd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "SCUTTLE", | |
"host": "192.168.1.8", | |
"protocol": "sftp", | |
"port": 22, | |
"username": "pi", | |
"password": "raspberry" | |
"remotePath": "/home", | |
"uploadOnSave": true | |
} |