Skip to content

Instantly share code, notes, and snippets.

View dmalawey's full-sized avatar
💭
performing kaizen

David dmalawey

💭
performing kaizen
View GitHub Profile
@dmalawey
dmalawey / .asoundrc
Created November 22, 2019 19:13
alsamixer configuration file for home directory on beaglebone
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
@dmalawey
dmalawey / adafruit_pwm_scuttle.py
Last active November 26, 2019 23:26
remo mods for Scuttle Robot
# 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))
@dmalawey
dmalawey / copy_of_button.py
Created November 19, 2019 22:21
direct copy of button.py on the beaglebone blue image.
#!/usr/bin/env python
# Reads the PAUSE button using interupts and sets the LED
# Pin table at https://github.com/beagleboard/beaglebone-blue/blob/master/BeagleBone_Blue_Pin_Table.csv
# Import PyBBIO library:
import Adafruit_BBIO.GPIO as GPIO
import time
button="P8_9" # PAUSE=P8_9, MODE=P8_10
LED ="USR3"
@dmalawey
dmalawey / findValidScanPoints.py
Created November 10, 2019 01:03
reconditioning of lidar readings and practice with numPy
# 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([ \
@dmalawey
dmalawey / L2_vector.py
Created November 5, 2019 21:24
code in progress for manipulating vectors
# Handling distance vectors in the robot coordinate frame
# Import external libraries
import numpy as np
from numpy import exp, abs, angle
import time
# Import internal programs
import L1_lidar as lidar
@dmalawey
dmalawey / streaming error report
Created October 24, 2019 16:22
streaming error report for video on beaglebone blue
I have followed both the guided installation and manual installation of the remotv controller on a Raspberry Pi and was able to control a robot successfully. I am now trying to get the remotv controller to run on a BeagleBone Blue which has not been successful. When I run the controller.py program, remo.tv says the robot is online and only streams audio while the video stays black. I have checked that the webcam does show up on /dev/video0 which is also what I have set in my controller.conf file. When I run the program I get this output:
debian@beaglebone:~/remotv$ python controller.py
04:48:27 - controller.py : RemoTV Controller Starting up
modprobe: FATAL: Module bcm2835_wdt not found in directory /lib/modules/4.14.71-ti-r80
aplay: main:788: audio open error: No such file or directory
04:48:29 - controller.py : RemoTV Controller Started
04:48:29 - controller.py : Unknown event type
Video does not stream but audio does.
Also as a comparison, I connected to remo.tv using a raspberry pian and had success str
@dmalawey
dmalawey / NodeRed_10.08
Created October 8, 2019 12:40
NodeRed code for telemetry.py plus extras
[
{
"id": "267bf868.5e6a88",
"type": "tab",
"label": "ScuttleFlowGeneral",
"disabled": false,
"info": ""
},
{
"id": "84aaf1fd.4870b",
@dmalawey
dmalawey / telemetry.py
Created October 8, 2019 12:38
Telemetry outputs from SCUTTLE to nodeRed
# data output functions to txt files for NodeRed and MQTT
# Import external programs
import numpy as np # for array manipulation
import time # for keeping time
# Import internal programs
import L1_encoder as enc
import L2_log as log
import L2_heading as head
@dmalawey
dmalawey / myflowExported.txt
Created September 26, 2019 01:27
export a flow for example for lab 4
[
{
"id": "267bf868.5e6a88",
"type": "tab",
"label": "My Export Flow",
"disabled": false,
"info": ""
},
{
"id": "84aaf1fd.4870b",
[
{
"id": "6cb40ed0.4205e",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "975b262b.d595d8",