Skip to content

Commit 35af9dc

Browse files
committed
cool beans
1 parent 0f9397a commit 35af9dc

12 files changed

+1345
-37
lines changed

citations.txt

+1
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,4 @@ https://jetsonhacks.com/2023/05/30/jetson-orin-nano-tutorial-ssd-install-boot-an
238238
https://web.archive.org/web/20191125073329/http://alexsharry.com/ - {reflect.app}
239239

240240
https://edu.irobot.com/what-we-offer/create3
241+
https://blog.gregbrockman.com/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 10-environmental-challenges-and-solutions-for-sensor-deployment
2+
3+
Content for 10-environmental-challenges-and-solutions-for-sensor-deployment
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 8-integrating-sensors-with-machine-learning-on-edge-devices
2+
3+
Content for 8-integrating-sensors-with-machine-learning-on-edge-devices

web-ui/docs/blag/iindex.html

+973
Large diffs are not rendered by default.

web-ui/docs/blag/index.md

+152
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Best Of
2+
1. Making RObotics odyssey: robot to feed cats
3+
2. Making Llama-tools
4+
3. Functional reactive infrastructure
5+
# Introduction to Sensors
6+
1. What are Sensors and Their Applications in Robotics
7+
2. Types of Sensors Used in Robotics: From Proximity to LIDAR
8+
3. How to Interface Sensors with Jetson Modules
9+
4. Choosing the Right Sensors for Your Robotics Project
10+
5. Top 10 Affordable Sensors for Hobbyists
11+
6. Sensor Fusion Techniques for Reliable Robotics Applications
12+
7. Using Zig to Manage Sensor Data in Real-Time Systems
13+
8. Integrating Sensors with Machine Learning on Edge Devices
14+
9. Best Practices for Calibration and Maintenance of Sensors
15+
10. Environmental Challenges and Solutions for Sensor Deployment
16+
17+
# NVIDIA Jetson Series
18+
19+
1. Getting Started with NVIDIA Jetson Nano for Robotics
20+
2. Differences Between Jetson Nano, Xavier, and Orin Explained
21+
3. Setting Up a Robotics Development Environment on Jetson
22+
4. Running AI Models on Jetson Devices with PyTorch
23+
5. Jetson as an Edge Device for Distributed Computing in Swarms
24+
6. Using Zig for Efficient Device Control on Jetson Boards
25+
7. Comparing Jetson Xavier NX with Raspberry Pi for Vision Tasks
26+
8. Deep Learning with Jetson: A Practical Guide
27+
9. Building ROS-Based Robots with Jetson Orin
28+
10. Jetson as a Brain for Autonomous Mobile Robots
29+
30+
# Robotic Arms
31+
32+
1. Building a Low-Cost Robotic Arm with Dynamixel Servos
33+
2. Robotic Arm Kinematics Explained: From Math to Implementation
34+
3. 3D Printed Robotic Arms: Design and Limitations
35+
4. Programming Robotic Arm Movements with ROS
36+
5. Integrating Robotic Arms with Jetson for Machine Learning Applications
37+
6. Using Zig to Optimize Robotic Arm Control Loops
38+
7. Selecting Servo Motors for Your Robotic Arm Project
39+
8. Collaborative Robots: Designing a User-Friendly Arm
40+
9. Precision Control for Robotic Arms in Manufacturing
41+
10. DIY Projects: Assembling a Robotic Arm Under $500
42+
43+
Locomotion and Mobility Systems
44+
45+
1. An Overview of Locomotion Types: Wheels, Legs, and Tracks
46+
2. Creating a Bipedal Robot: Challenges and Solutions
47+
3. Balancing Algorithms for Two-Wheeled Robots
48+
4. Mobile Robotics with Jetson: Mapping and Navigation
49+
5. Integration of Sensor Data for Autonomous Locomotion
50+
6. Zig for Writing Efficient Motion Control Programs
51+
7. Choosing the Right Wheels and Motors for Your Robot
52+
8. Designing a Modular Locomotion System for Versatility
53+
9. Swarm Robotics and Locomotion Synchronization Techniques
54+
10. Robotics Locomotion in Rough Terrain: Challenges and Strategies
55+
56+
3D Printing for Robotics
57+
58+
1. Designing 3D-Printed Parts for Robotics Projects
59+
2. Best 3D Printers for Robotic Prototyping
60+
3. Materials for 3D Printing Robotic Components: PLA vs. ABS
61+
4. Printing Jigs and Fixtures for Assembling Robots
62+
5. Integrating 3D-Printed Parts with Off-the-Shelf Electronics
63+
6. Customizing Robotic Arm Components Using 3D Printing
64+
7. Common Issues with 3D Printed Parts and How to Fix Them
65+
8. Combining 3D Printing with CNC Machining for Precision
66+
9. 3D Printing Gears for Robotic Applications: Tips and Tricks
67+
10. Designing Lightweight Yet Strong Robotic Components
68+
69+
Zig for Systems Engineering
70+
71+
1. Why Use Zig for Systems-Level Robotics Programming?
72+
2. Getting Started with Zig for Hardware Control
73+
3. Comparing Zig to C/C++ for Robotics Projects
74+
4. Writing Low-Latency Sensor Drivers in Zig
75+
5. Memory Safety in Zig: Advantages for Robotics Systems
76+
6. Using Zig to Interface with Real-Time Operating Systems
77+
7. Building Modular Robotics Software Architectures in Zig
78+
8. Code Examples: Interfacing Motors with Zig
79+
9. Best Practices for Zig in Embedded Systems
80+
10. Debugging Robotics Applications Written in Zig
81+
82+
Introduction to LlamaOps
83+
84+
1. What is LlamaOps and How Does It Work?
85+
2. Llama Models Explained: From GPT to Llama 3
86+
3. Deploying Llama Models on Local Servers vs. Cloud
87+
4. Training Llama Models for Robotics Applications
88+
5. Optimizing Llama Inference for Real-Time Systems
89+
6. Using LlamaOps for Conversational AI in Robotics
90+
7. Comparing Llama with GPT-4 for Technical Applications
91+
8. Hosting Llama Models with Docker and Kubernetes
92+
9. Privacy Concerns in Using Llama for On-Device AI
93+
10. Fine-Tuning Llama Models for Niche Applications
94+
95+
Llama Model Training and Deployment
96+
97+
1. How to Train Llama Models with Custom Datasets
98+
2. Understanding the Compute Requirements for Llama Training
99+
3. Using Jetson Devices to Run Llama Inference Efficiently
100+
4. Quantization Techniques to Optimize Llama Models
101+
5. Comparing Llama and BERT for Domain-Specific Tasks
102+
6. Hosting a Llama API for Your Robotics Project
103+
7. Using Zig with LlamaOps for Low-Level Optimizations
104+
8. Combining Llama Models with OpenCV for Object Detection
105+
9. Model Evaluation Metrics for Llama in Robotics Contexts
106+
10. Deploying Llama on Edge Devices for Offline Use
107+
108+
Llama for Robotics
109+
110+
1. Voice-Controlled Robotics Using Llama-Based NLP
111+
2. LlamaOps in Human-Robot Interaction Scenarios
112+
3. Integrating LlamaOps with ROS for Seamless Operation
113+
4. Creating an AI Chatbot for Your Robot with LlamaOps
114+
5. Using Llama for Fault Diagnosis in Autonomous Systems
115+
6. Exploring Multi-Agent Communication with LlamaOps
116+
7. Generating Movement Commands with Llama Language Models
117+
8. LlamaOps for Knowledge Sharing Among Robot Swarms
118+
9. Comparing Llama with Traditional ML for Command Execution
119+
10. Using Reinforcement Learning with Llama Models in Robotics
120+
121+
Introduction to Computer Vision
122+
123+
1. Basics of Computer Vision for Robotics Beginners
124+
2. Setting Up OpenCV on Jetson Devices
125+
3. How Computer Vision Powers Robotics Today
126+
4. Key Algorithms in Computer Vision: A Beginner’s Guide
127+
5. Using YOLO for Object Detection in Robotics
128+
6. Deep Learning Models for Computer Vision Tasks
129+
7. Camera Calibration for Accurate Computer Vision
130+
8. Combining Computer Vision with Llama for Perception
131+
9. Evaluating Object Recognition Models for Robotics
132+
10. Edge vs. Cloud: Where to Deploy Computer Vision Models
133+
134+
Advanced Computer Vision Techniques
135+
136+
1. Training Your Own Computer Vision Model with PyTorch
137+
2. Using GANs for Image Synthesis in Robotics Applications
138+
3. Segmentation Techniques in Robotics Using SAM
139+
4. Real-Time Image Processing for Mobile Robots
140+
5. Depth Estimation for 3D Perception in Robots
141+
6. Using Zig for Optimizing Vision Algorithms on Edge Devices
142+
7. Combining Lidar and Camera Data for Better Vision
143+
8. Object Tracking Techniques for Robotic Applications
144+
9. Using CUDA to Speed Up Vision Processing
145+
10. Evaluating SLAM Algorithms for Visual Localization
146+
Advanced Computer Graphics Techniques
147+
1. NERF
148+
2. Gaussian Splatting
149+
3. Point Cloud Rendering
150+
4. Voxels and Stixels
151+
5. Server Side WebGPU Streaming
152+
6. Ray Tracing (2D and 3D) - Visibility

web-ui/docs/making-llama-tools.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# making-llama-tools
2+
3+
Content for making-llama-tools
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# making-robotics-odyssey-robot-to-feed-cats
2+
3+
Content for making-robotics-odyssey-robot-to-feed-cats

web-ui/docs/nvidia-jetson-series.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# nvidia-jetson-series
2+
3+
Content for nvidia-jetson-series

web-ui/js/bun-helper-server.tsx

+115-35
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const ollama = require('ollama');
2+
import {$} from 'bun'
13
import { renderToString } from "react-dom/server";
24
import React, { Suspense, lazy } from 'react';
35
import Bun from 'bun'
@@ -7,6 +9,7 @@ import { connect_to_livekit } from './bun_handlers/bun-livekit-server.js'
79
import llamaRoutes from './bun_handlers/llama-backend.js'
810
import CgiRoutes from './bun_handlers/cgi-backend.js'
911
import { renderToReadableStream } from 'react-dom/server';
12+
import TurndownService from 'turndown';
1013

1114
const port = 8080;
1215
console.log(`Server running at http://localhost:${port}`);
@@ -77,53 +80,83 @@ function serveBlag(req: Request) {
7780
});
7881
}
7982

83+
function on_save_blag(req: Request) {
84+
ollama.generate({
85+
model: "llama3.2",
86+
prompt: "predict if there are errors before running thiss"
87+
})
88+
//run thing
89+
ollama.generate({
90+
//model: "llama3.2",
91+
model: "llama3.2",
92+
prompt: "if errors - suggest fixes"
93+
})
94+
}
95+
8096
async function serveBlagArchive(req: Request) {
81-
const url = `https://reflect.site/g/awahab/500-blog-posts---prolific---show-steps---12yr-exec--phd-x-7-in-2-yrs/d1ea069679c64f649827dd990648b17c`
82-
const response = await fetch(url);
83-
const htmlContent = await response.text();
97+
try {
98+
const filePath = path.join(process.cwd(), "docs/blag/index.md");
99+
// console.log('filePath', filePath);
100+
// const htmlContent = fs.readFileSync(filePath, "utf-8");
84101

85-
const turndownService = new TurndownService();
86-
const markdownContent = turndownService.turndown(htmlContent);
87-
const lines = markdownContent.split('\n');
102+
// async function convertHtmlToMarkdown(htmlContent) {
103+
// const ask_ollama = async (prompt) => {
104+
// const proc = Bun.spawn(["ollama", "run", "llama3.2", "prompt", prompt]);
105+
// const output = await new Response(proc.stdout).text();
106+
// return output;
107+
// };
88108

109+
// const prompt = "Convert the following HTML content to Markdown:\n\n" + htmlContent;
89110

90-
const docsPath = path.join(process.cwd(), 'docs');
91-
if (!fs.existsSync(docsPath)) {
92-
fs.mkdirSync(docsPath, { recursive: true });
93-
}
111+
// const markdownContent = await ask_ollama(prompt);
112+
// return markdownContent;
113+
// }
94114

95-
lines.forEach(line => {
96-
if (line.startsWith('#')) {
97-
const header = line.replace(/#/g, '').trim();
98-
const folderName = header.replace(/\s+/g, '-');
99-
const folderPath = path.join(docsPath, folderName);
100-
if (!fs.existsSync(folderPath)) {
101-
fs.mkdirSync(folderPath, { recursive: true });
102-
}
115+
const markdownContent = fs.readFileSync(filePath, "utf-8");
116+
//console.log('markdownContent', markdownContent);
117+
118+
//const lines = markdownContent.split('\n');
103119

104-
// Create an HTML file in the folder with the title
105-
const htmlContent = `<html><head><title>${header}</title></head><body><h1>${header}</h1></body></html>`;
106-
const filePath = path.join(folderPath, `${folderName}.html`);
107-
fs.writeFileSync(filePath, htmlContent, 'utf-8');
120+
//console.log('lines', lines);;
121+
122+
//immutable functional reactive infra -> on save -> refresh + replit but faster - tailwind 4 robots
123+
const lines = markdownContent.split('\n')
124+
125+
126+
const docsPath = path.join(process.cwd(), 'docs');
127+
if (!fs.existsSync(docsPath)) {
128+
fs.mkdirSync(docsPath, { recursive: true });
108129
}
109-
});
130+
131+
const content = `${lines.map((line, i) => {
110132
111-
let content = '<ul>';
112-
for (let i = 0; i < 500; i++) {
113-
const randomLink = `https://example.com/${Math.random()}`;
114-
content += `<li><a href="${randomLink}">Link ${i + 1}</a></li>`;
115-
}
116-
content += '</ul>';
133+
if (line.startsWith('#')) {
134+
return `<h1>${line.slice(2)}</h1>`;
135+
}
117136
118-
return new Response(content, {
119-
headers: {
120-
"Content-Type": "text/html",
121-
},
122-
});
137+
const cleanedLine = line.slice(3).replace(/[^a-zA-Z0-9\s-]/g, '').trim();
123138
139+
if (cleanedLine === ' ') {
140+
return '';
141+
}
124142
143+
144+
125145
126-
return new Response('blag archive')
146+
const simplifiedLink = cleanedLine.replace(/\s+/g, '-').toLowerCase();
147+
148+
return `<div><a href="blag/${simplifiedLink}">${cleanedLine}</a></div>`;
149+
}).join('<br/>')}`;
150+
151+
return new Response(content, {
152+
headers: {
153+
"Content-Type": "text/html",
154+
},
155+
});
156+
} catch (error) {
157+
console.error('Error in serveBlagArchive:', error);
158+
return new Response('An error occurred while processing your request', { status: 500 });
159+
}
127160
}
128161

129162
const CgiRoutesHandlers = Object.fromEntries(
@@ -142,6 +175,9 @@ const routes = {
142175
"/blag": (req: Request) => serveBlag(req),
143176
"/llama-tools": (req: Request) => serveLlamaTools(req),
144177
"/cgi-tools": (req: Request) => serveCgiTools(req),
178+
179+
180+
145181
"/blag-archive": (req: Request) => serveBlagArchive(req),
146182

147183
...CgiRoutesHandlers,
@@ -159,6 +195,47 @@ main();
159195

160196
async function fetch(req: Request) {
161197
const url = new URL(req.url);
198+
199+
if (!req.url) {
200+
console.error('Request URL is undefined');
201+
return new Response('Invalid request', { status: 400 });
202+
}
203+
if (url.pathname.startsWith("/blag/")) {
204+
const route = url.pathname.replace("/blag/", "");
205+
const filePath = `./docs/${route}.md`;
206+
try {
207+
await Bun.write(filePath, `# ${route}\n\nContent for ${route}`);
208+
const fileExists = await Bun.file(filePath).exists();
209+
if (fileExists) {
210+
return new Response(await Bun.file(filePath).text(), { status: 200 });
211+
} else {
212+
const prompt = `Generate a paragraph of PhD level content and 10 citations related to the topic described in the file: ${filePath}`;
213+
214+
const response = await ollama.chat({
215+
model: 'llama3.1',
216+
messages: [{ role: 'user', content: prompt }],
217+
})
218+
219+
const generatedContent = await response.message.content;
220+
const content = generatedContent.text;
221+
222+
await Bun.write(filePath, content);
223+
return new Response(content, { status: 200 });
224+
225+
226+
227+
}
228+
229+
230+
//return new Response(`File created at ${filePath}`, { status: 201 });
231+
} catch (error) {
232+
console.error('Error creating file:', error);
233+
return new Response('An error occurred while creating the file', { status: 500 });
234+
}
235+
}
236+
237+
238+
162239
console.log('url', url.pathname)
163240
if (url.pathname.startsWith("/assets")) return Bun.file('/Users/shelbernstein/homelab_status_page/web-ui/assets/output.css')
164241

@@ -352,3 +429,6 @@ function makeReactApp(component_name) {
352429
// }
353430

354431
//import RoboticsOdyssey from "views/odyssey/robotics-odyssey.tsx";
432+
433+
434+

0 commit comments

Comments
 (0)