Skip to content

Instantly share code, notes, and snippets.

@jones2126
jones2126 / ttgo_RH95_init.ino
Last active June 24, 2022 01:41
TTGO Semtech SX1276 ESP32 LoRa board using Radio Head RH_RF95. This program is used to test getting the LoRa service to initialize.
/*
ttgo_RH_RF95_init This program is used to test getting the LoRa service to initialize on a TTGO ESP32 LoRa board
ref: https://microcontrollerslab.com/ttgo-lora32-sx1276-oled-board-pinout-getting-started-with-arduino-ide/
*/
#include <SPI.h>
#include <RH_RF95.h>
#include <RHReliableDatagram.h>
// LoRa pins for TTGO Semtech SX1276
#define LORA_MISO 19
@jones2126
jones2126 / steer_base_test.ino
Created March 3, 2022 17:07
Test program for a MAP function aimed at testing code for a steering module that will be used to turn a steering servo from hard left to hard right based on the steering angle provided which will generally be between .82 and -.76 which has to be mapped to a range of -14,000 and 13,500 which are the values from the steering angle sensor.
/*
Test program for a MAP function aimed at testing code for a steering module that will be used to turn a steering servo from hard left to hard right
based on the steering angle provided which will generally be between .82 and -.76 which has to be mapped to a range of -14,000 and 13,500 which are
the values from the steering angle sensor.
I initially tested this on an Arduino Nano Every board
if(angular_vel_z > 0)
{
steering_angle_target = angular_vel_z*(steer_left_max - steer_straight) / 1+steer_straight;
@jones2126
jones2126 / map_function_test.ino
Last active December 4, 2021 17:50
Test code for MAP function to be integrated into steering control module
/*
Test program for a MAP function aimed at testing code for a steering module that will be used to turn a steering servo from hard left to hard right
based on the steering angle provided which will generally be between .82 and -.76 which has to be mapped to a range of -14,000 and 13,500 which are
the values from the steering angle sensor.
*/
#include <Arduino.h>
// steering value constants
const int steer_straight = 1;
@jones2126
jones2126 / transmission_v3.cpp
Last active November 14, 2021 20:01
Super Servo ROS enabled and control the transmission of a lawn tractor
/*
This program is designed to run on a Teensy that is connected to a SuperServo to make the Super Servo ROS enabled and control
the transmission of a lawn tractor. It is started in a launch file as one of multiple nodes with the command:
<node ns="transmission_teensy" name="transmission_cntrl" pkg="rosserial_python" type="serial_node.py" args="/dev/transmission_control" output="screen" />
Overview:
subscribe to a target speed in cmd_vel format (i.e. cmd_vel.linear.x)
subscribe to actual speed from the rear wheels
adjust servo position to match actual speed to target speed
@jones2126
jones2126 / notes.txt
Created October 25, 2021 00:12
Soontech RX 580 ellesmere 8gb not mining with ethminer using ethos; Receiving the error "Creating DAG buffer failed: clCreateBuffer: CL_INVALID_BUFFER_SIZE (-61)"
Similar posts https://github.com/ethereum-mining/ethminer/issues/1966
What is not clear is the fix. There is a mention, "You can continue using ethminer if you can build the binary on your own
See instructions here https://github.com/ethereum-mining/ethminer#build"
Download ethminer-0.18.0-cuda-8-linux-x86_64.tar.gz
Are these correct? (from: https://github.com/ethereum-mining/ethminer/blob/master/docs/BUILD.md)
$ sudo apt install libdbus-1-dev
$ sudo apt-get install mesa-common-dev
@jones2126
jones2126 / ROS_GUI_v7.py
Created August 21, 2021 23:09
Python Tkinter script to help start launch files from my laptop and to start windows that show the values of ros topics.
#!/usr/bin/env python
#
import tkinter as tk
from tkinter import ttk
import subprocess
import time
'''
issues:
- speed up the login process by looking for the $ which shows the login has completed
@jones2126
jones2126 / sensor_display.py
Last active August 15, 2021 16:41
ROS subscriber to read sensor and display using tkinter and a Class
import tkinter as tk
from tkinter import ttk
import rospy
from std_msgs.msg import Int16
"""
Simple Python subscriber to a ROS topic (/front_angle_low_res) which in my case is outputing an integer result
and displays the result in a tkinter window
credit: https://www.pythontutorial.net/tkinter/tkinter-after/
@jones2126
jones2126 / gist:f20d25b08bfcd38c1eb117367cf4d6c6
Created July 17, 2021 17:04
Sparkfun Example for reading BNO080 IMU
/*
Using the BNO080 IMU
Example : Euler Angles
By: Paul Clark
Date: April 28th, 2020
Based on: Example1-RotationVector
By: Nathan Seidle
SparkFun Electronics
@jones2126
jones2126 / gist:c33afeca3ea9e3e777dfe29f610b1a06
Created June 30, 2021 11:03
Reads rotation vector quaternion report from BNO085 from Adafruit using "new" I2C Library using Nano (168p)
/* BNO080 Rock bottom code for Arduino Atmega 328P 16Mhz (Arduino Nano etc)
by: JP Schramel https://github.com/jps2000/BNO080/blob/master/Arduino_BNO080_1.ino
date: August 25, 2017
Disclaimer:
Freeware: The code is provided "AS IS",without warranty of any kind.
# Demonstrates basic functionality 9DOF fused quaternions up to 400Hz data rate.
# Stores calibration data in flash.
# Tares the quaternion output to (1,0,0,0) in any arbitrary position
@jones2126
jones2126 / gist:3155dd13cf19ed10f8357a163b2a9333
Created May 16, 2021 16:48
teb_local_planner_params_carlike.yaml for lawn tractor
# file: teb_local_planner_params.yaml
TebLocalPlannerROS:
# Trajectory
teb_autosize: True
dt_ref: 0.3
dt_hysteresis: 0.1
global_plan_overwrite_orientation: True
allow_init_with_backwards_motion: False
max_global_plan_lookahead_dist: 3.0