Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Robots!!!

RobotGrrl RobotGrrl

🤖
Robots!!!
View GitHub Profile
@RobotGrrl
RobotGrrl / gist:5a5d1ddaa3378529f6da9907ee8086f0
Created Oct 17, 2018
Aframe register component question
View gist:5a5d1ddaa3378529f6da9907ee8086f0
AFRAME.registerComponent('voxelarena', {
init: function () {
var parentEl = this.el;
var col_ind = 0;
var row_ind = 0;
var num_tiles = 0;
setInterval(function () {
if(num_tiles >= 7*7) return;
var childEl = document.createElement('a-entity');
View gist:59a3ad2a48192efa963da23f3a219997
python3 Object_detection_picamera.py
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412
return f(*args, **kwds)
Traceback (most recent call last):
File "Object_detection_picamera.py", line 97, in <module>
image_tensor = detection_graph.get_tensor_by_name('image_tensor:0')
File "/home/pi/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3789, in get_tensor_by_name
return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
@RobotGrrl
RobotGrrl / pi_prep_for_processing
Last active Jul 30, 2018
pi prep for processing using the pi cam
View pi_prep_for_processing
0. download the latest pi + processing rasbian -- this is written using 3.3.7.2 (the previous revision had an error that we encountered too https://github.com/gohai/processing-glvideo/issues/53)
1. change the config to legacy gl driver... as enabling the kms ones would actually disable gpu video support (says so here: https://github.com/gohai/processing-glvideo#raspbian)
sudo raspi-config
2. change the memory available (gui - settings)
256
3. make sure interfaces are on
ssh (if you want to remote in to the pi)
@RobotGrrl
RobotGrrl / confusingservobug.txt
Last active Jan 12, 2018
Confusing Servo Bug
View confusingservobug.txt
Quick overview of the Bowie Lib:
- Modules like BowieHopper, BowieScoop, BowieComms, etc. all get imported by MegaBowieShoreline.
- This is so that there can eventually be a MegaBowieSeedPlanter, for the next missions etc.
In MegaBowieShoreline.cpp, void MegaBowieShoreline::begin() {
This is where the objects get initialised
Bowie Lib:
https://drive.google.com/open?id=1UxYtklpj5Cls7tZ_94N0011cSO4xvv_t
@RobotGrrl
RobotGrrl / randyIsAwesome
Created Oct 17, 2016
randyIsAwesome RGB Shades
View randyIsAwesome
void randyIsAwesome() {
// startup tasks
if (effectInit == false) {
effectInit = true;
effectDelay = 100;
}
for (byte x = 0; x < kMatrixWidth; x++) {
for (int y = 0; y < kMatrixHeight; y++) {
@RobotGrrl
RobotGrrl / timelapse.sh
Last active Aug 29, 2018
script for making a timelapse video from images
View timelapse.sh
ffmpeg -r 30 -f image2 -i image-%d.JPG -f mp4 -q:v 0 -vcodec mpeg4 -r 30 -vf scale=1920:-1 -vb 20M output.mp4
#before the 2nd -f put -vframes 100 for the first 100 frames
# save an image from a video every 10 seconds
# ffmpeg -i input.mkv -r 0.1 %06d.png
@RobotGrrl
RobotGrrl / Spheramid
Created Apr 1, 2015
Pyramid morphed with a sphere
View Spheramid
import fab
title('spheramid')
input('x0',float)
input('y0',float)
input('z0',float)
input('r',float)
input('width',float)
input('height',float)
@RobotGrrl
RobotGrrl / replicator g skeinforge profile location
Last active Aug 29, 2015
(i always forget this, so placing it here for useful reference)
View replicator g skeinforge profile location
Profile Location
Duplicated profiles are saved to your home directory and will show up between different versions of ReplicatorG.
Windows:
/Users/[USERNAME]/.replicatorg/sf_[VER]_profiles/
Mac:
~/.replicatorg/sf_[VER]_profiles/
@RobotGrrl
RobotGrrl / arduino_sound_snippet
Created Jun 25, 2014
Nice sounds on an Arduino
View arduino_sound_snippet
// (spkr is the output pin to your speaker)
void playTone(int tone, int duration) {
for (long i = 0; i < duration * 1000L; i += tone * 2) {
digitalWrite(spkr, HIGH);
delayMicroseconds(tone);
digitalWrite(spkr, LOW);
delayMicroseconds(tone);
}
@RobotGrrl
RobotGrrl / gist:8583bae096ff95233d44
Created May 20, 2014
Numbers in an array to int
View gist:8583bae096ff95233d44
for(int i=0; i<valLen; i++) {
valResult += (val[(valLen-1)-i] - '0')*pow(10, i);
if(DEBUG) Serial << i << ": " << val[(valLen-1)-i] << " " << (val[(valLen-1)-i] - '0') << " " << pow(10, i) << "=" << (val[(valLen-1)-i] - '0')*pow(10, i) << endl;
}
/*
if(valLen > 3) {
valResult += (val[0] - '0')*1000;
valResult += (val[1] - '0')*100;
valResult += (val[2] - '0')*10;