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
#!/usr/bin/env python | |
import rospy | |
import time | |
from pidrone_pkg.msg import State | |
from sensor_msgs.msg import Range, Imu | |
def callbackRange(data): | |
import datetime | |
dt = datetime.datetime.now() | |
print("range",data.range,dt.second+dt.microsecond/1000000.0," "," "," ") |
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
#!/usr/bin/env python3 | |
""" | |
optical_flow_node_replacer.py is a ros node that can be used instead of the optical_flow_node in pidrone_pkg/scripts to publish a zero velocity and fly with no camera. | |
JoshuaPhelps127@gmail.com 2023-03-10 | |
""" | |
import rospy | |
from geometry_msgs.msg import TwistStamped |
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
#!/usr/bin/env python3 | |
import rospy | |
import argparse | |
import numpy as np | |
from sensor_msgs.msg import Range | |
from std_msgs.msg import Header | |
from dt_vl53l0x import \ |
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
/** | |
Arduino program written by joshua-8 and rowanberry in 2021 | |
This program was written to display patterns on | |
Adafruit's large led disk: https://www.adafruit.com/product/2477 | |
a "sector", a portion of one of the circular paths, can be light up and fade out towards each end | |
another animation looks like a stone dropped in the center of poo. | |
*/ |
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
// written by Joshua-8 2022-05 | |
// testing code for combining relays with a high resolution (PWMed) "fine adjust" to reduce relay movement | |
import grafica.*; | |
import java.util.Collections; | |
int gi=0; | |
GPlot plot; | |
int numRelays=5; | |
int numCoarseSteps=int(pow(2, numRelays)); |
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
// written by Joshua-8 2022-03 | |
import grafica.*; | |
import java.util.Collections; | |
//simulate resistors being inaccurate | |
float[] scale={1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; |
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
/* | |
* It is an inexpensive device to motivate children to exercise on a stationary bike; when the children pedal a bike, a movie or song they have chosen plays. | |
* It uses a magnet sensor to measure the speed of the pedal or crank of an exercise machine, and has a knob for changing what threshold is fast enough. | |
* The microcontroller emulates a keyboard and sends a space key press to start or stop any video or music playing on a computer. | |
* Use with a Digispark http://digistump.com/products/1, knob, and magnet sensor. | |
* by Joshua, 2015 | |
*/ | |
#include "DigiKeyboard.h" | |
boolean paused = true; | |
unsigned long timeSinceCrank = 10000000; |
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
String inString = ""; | |
#include <Servo.h> | |
Servo myservo1; | |
void setup() { | |
myservo1.attach(9); | |
Serial.begin(2000000); | |
Serial.println("ESCs Speed Control. attach pin 9 to the ESC."); | |
} |
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 program is for testing code that can be used to limit the first and second derivative of a variable as it approaches a target value. | |
It's easiest to think of in terms of position, velocity, and acceleration. If used with a servo, for example, the servo would smoothly move to a target value with a trapezoidal velocity profile. | |
The formula in this program supports being run at uneven intervals, and allows for editing the target, position, and velocity while it runs | |
Arduino library I wrote using the algoritihm developed here: https://github.com/joshua-8/Derivs_Limiter | |
The code was rewritten for version 3 of Derivs_Limiter (supporting different accel from decel and velocity target mode) in June 2022 by joshua-8 | |
*/ |