Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanwahab committed Oct 14, 2024
1 parent 6fce0dc commit 099e864
Show file tree
Hide file tree
Showing 1,099 changed files with 466 additions and 27 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
notebooks/
data/alan_kay/images
notebooks/robot_remote_control
notebooks/deno-webgpu
Expand Down
97 changes: 97 additions & 0 deletions notebooks/1_hardware/robot_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

from irobot_edu_sdk.backend.bluetooth import Bluetooth
from irobot_edu_sdk.robots import event, hand_over, Color, Robot, Root, Create3
from irobot_edu_sdk.music import Note
from bluetooth import *

print("performing inquiry...")

nearby_devices = discover_devices(lookup_names = True)

print("found %d devices" % len(nearby_devices))

for name, addr in nearby_devices:
print(" %s - %s" % (addr, name))

import asyncio

print('gay robot')
backend0 = Bluetooth('') # Connects to the first BLE robot detected.

robot = Create3(backend0)

@event(robot.when_play)
async def main(robot):
print('fuck your mom')
print('robot', robot)
await robot.play_note(Note.A4, 2)
await robot.play_note(55, .1)
await robot.wait(0.3)
await robot.play_note(110, .1)
await robot.wait(0.3)
return 'ym'
methods = [
"get_cliff_sensors",
"get_cliff_sensors_cached",
"get_docking_values",
"get_enabled_events",
"get_ipv4_address",
"get_ir_proximity",
"get_name",
"get_packed_ir_proximity",
"get_position",
"get_serial_number",
"get_sku",
"get_touch_sensors",
"get_touch_sensors_cached",
"get_version_string",
"get_versions",
"get_6x_ir_proximity",
"get_7x_ir_proximity",
"get_accelerometer",
"get_battery_level",
"get_bumpers",
"get_bumpers_cached",
]

for method in methods:
try:
result = await getattr(robot, method)()
print(f"{method}: {result}")
except Exception as e:
print(f"Error calling {method}: {e}")

robot.play()
#asyncio.run(main())

# robot = Create3(Bluetooth())

# duration = 0.15


# @event(robot.when_touched, [True, False]) # (.) button.
# async def touched(robot):
# await robot.set_lights_on_rgb(255, 0, 0)
# await robot.play_note(Note.A4, duration)


# @event(robot.when_touched, [False, True]) # (..) button.
# async def touched(robot):
# await robot.set_lights_on_rgb(0, 255, 0)
# await robot.play_note(Note.C5_SHARP, duration)


# @event(robot.when_touched, [True, True])
# async def touched(robot):
# print('ANY sensor touched')


# @event(robot.when_play)
# async def play(robot):
# await robot.play_note(Note.C5_SHARP, duration)
# await robot.play_note(Note.C5_SHARP, duration)
# await robot.play_note(Note.C5_SHARP, duration)
# await robot.play_note(Note.C5_SHARP, duration)
# await robot.play_note(Note.A5, duration)

# robot.play()
175 changes: 175 additions & 0 deletions notebooks/bun_rtsp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Caches

.cache

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
15 changes: 15 additions & 0 deletions notebooks/bun_rtsp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# bun_rtsp

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.0.23. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
1 change: 1 addition & 0 deletions notebooks/bun_rtsp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello via Bun!");
9 changes: 9 additions & 0 deletions notebooks/bun_rtsp/livekit_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// javscirpt for shit you actually need -
// go for fun

//zig for fun

//python is in between

//[]
//https://github.com/livekit/node-sdks
14 changes: 14 additions & 0 deletions notebooks/bun_rtsp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "bun_rtsp",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"dependencies": {
"livekit-server-sdk": "^2.7.0"
}
}
22 changes: 22 additions & 0 deletions notebooks/bun_rtsp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

/* Linting */
"skipLibCheck": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
}
}
Loading

0 comments on commit 099e864

Please sign in to comment.