A 2D (XY) Robotic Platform
Here are the files for my 2d robotic platform. Each file is meant to be fabricated on a 3d printer (except the assembly.scad file, which is really just a visualization for the final build).
const { | |
aws_route53: route53, | |
aws_certificatemanager: acm, | |
aws_ecs: ecs, | |
aws_ec2: ec2, | |
aws_ecr_assets: ecr_assets, | |
aws_elasticloadbalancingv2: elbv2, | |
Stack, | |
CfnOutput, | |
IgnoreMode, |
Here are the files for my 2d robotic platform. Each file is meant to be fabricated on a 3d printer (except the assembly.scad file, which is really just a visualization for the final build).
function getAABB(rect: Cuboid) { | |
const result = { | |
min: [rect.x, rect.y, rect.z], | |
max: [rect.x + rect.w, rect.y + rect.h, rect.z + rect.d], | |
}; | |
// Swap the vertices if the min/max is reversed | |
// because of orientation or whatever. | |
for (let i = 0; i < 3; i++) { | |
if (result.max[i] < result.min[i]) { |
This project is all about calculating the position of a telescope. I derive absolute orientation using a magnetometer sensor and accelerometer sensor. By absolute orientation, I mean deriving the euler angles
of the telescope. The root problem I'm facing is that the yaw
reading experiences a mostly linear error after pitching the device beyond a specific threshold. (About 50 degrees or so).
To consistently observe the error, a simple experiment can be performed which reliably yields the problem.
#![allow(unused)] | |
use chrono::prelude::*; | |
use std::f64::consts::PI; | |
type Float = f64; | |
#[derive(Copy, Clone)] | |
pub struct GpsCoordinate { | |
pub latitude: Angle, |
SPACING = 1.5; | |
W = 25; | |
H = 100; | |
module grate(W, H, SPACING) { | |
for (i = [0:W/SPACING/2]) { | |
translate([(SPACING * 2 * i) - ((W-SPACING)/2), 0, 0]) | |
square([SPACING, H], center=true); | |
} | |
} |
This algorithm will take a 10/12/14 bit word and distribute it among 2 8-bit words. But in a lossless, efficient way. Why might someone want this? Well, it lets you stream uniquely sized words over 8-bit serial. That's why I need it anyway. Here's an example:
Suppose you have an 8-bit serial port and you want to stream 12-bit audio at 8kHz. Well, serial is typically maxing out around 115200 bits/s. You can't just use 2 bytes per datapoint, because you'll generate too much content. In order to solve
$fn=100; | |
mount_base_w = 32.4; | |
mount_top_w = 23.8; | |
mount_depth = 10.0; | |
splitter_stem = 7; | |
splitter_height = 30; | |
platform_length = 45; | |
platform_angle = 22.5; |
@font-face { | |
font-family: 'Roboto-Regular'; | |
font-style: normal; | |
font-weight: 400; | |
src: url('/custom/fonts/Roboto-Regular.woff2') format('woff2'); | |
} | |
:root { | |
--main-bg: var(--white); | |
--main-text: #000; |
pub fn interpolate(start: u32, end: u32, elapsed: u64, duration: u64) -> u32 { | |
// Calculate step | |
let x0 = 0f32; | |
let y0 = min(start, end) as f32; | |
let x1 = duration as f32; | |
let y1 = max(end, start) as f32; | |
let x = min(elapsed, duration) as f32; | |
let delta = (x * ((y1 - y0)/(x1 - x0))) as u32; | |
if start > end { | |
return start - delta; |