Skip to content

Instantly share code, notes, and snippets.

View meganetaaan's full-sized avatar
🏠
Working from home

Shinya Ishikawa meganetaaan

🏠
Working from home
View GitHub Profile
@meganetaaan
meganetaaan / gist:b05153a7a0e9267980dc5e4abaac17b0
Created April 12, 2023 09:50
idf-v5でスタックチャン(Core2)のビルドに失敗する
[sskw]$ npm run build
> stack-chan@0.2.1 build /work/ghq/github.com/meganetaaan/stack-chan/firmware
> cross-env npm_config_target?=esp32/m5stack cross-env-shell mcconfig -d -m -p \$npm_config_target -t build ./stackchan/manifest_local.json
/home/sskw/.local/share/esp32/esp-idf/tools/idf.py
/home/sskw/.local/share/moddable/build/tmp/esp32/m5stack/debug/stackchan/makefile:2109: 警告: ターゲット '/home/sskw/.local/share/moddable/build/tmp/esp32/m5stack/debug/stackchan/ftimage.h.xsi' のためのレシピを置き換えます
/home/sskw/.local/share/moddable/build/tmp/esp32/m5stack/debug/stackchan/makefile:2040: 警告: ターゲット '/home/sskw/.local/share/moddable/build/tmp/esp32/m5stack/debug/stackchan/ftimage.h.xsi' のための古いレシピは無視されます
# xsc pins/digital.xsb
# xsc ili9341.xsb
@meganetaaan
meganetaaan / ROS2DebugVSCode.md
Created February 15, 2023 01:20 — forked from JADC362/ROS2DebugVSCode.md
Debug ROS2 C++ node on VSCode (Ubuntu)

Debug ROS2 C++ node on VSCode (Ubuntu)

Description

This is a small tutorial on how to debug a ROS2 C++ node usign VSCode.

Requeriments

This implementation was done using:

@meganetaaan
meganetaaan / main.js
Created January 10, 2023 17:11
BLEのアドバタイジングパケットのユーザ定義領域の値を動的に変えるテスト
import BLEServer from "bleserver";
import Timer from "timer";
let count = 0;
class Advertiser extends BLEServer {
onReady() {
}
onConnected(connection) {
this.stopAdvertising();
}
@meganetaaan
meganetaaan / mod.js
Last active September 23, 2022 15:19
Avatar drawing
import { Outline } from "commodetto/outline";
const useBlink = (openMin, openMax, closeMin, closeMax) => {
let eyeOpen = 1
let nextToggle = randomBetween(openMin, openMax)
return (tickMillis) => {
nextToggle -= tickMillis
if (nextToggle < 0) {
eyeOpen = Number(!eyeOpen)
nextToggle = eyeOpen ? randomBetween(openMin, openMax) : randomBetween(closeMin, closeMax)
@meganetaaan
meganetaaan / generate-speech.js
Last active April 30, 2022 16:51
Speech generation via Google Text-to-Speech API
/**
https://cloud.google.com/text-to-speech/docs/create-audio-text-client-libraries#client-libraries-usage-nodejs
### USAGE
* [Setup your googleplatform project](https://cloud.google.com/text-to-speech/docs/before-you-begin)
and download a service account json key.
* run below.
```
diff --git a/build/devices/esp32/targets/m5stack_core2/setup-target.js b/build/devices/esp32/targets/m5stack_core2/setup-target.js
index 443db0c6..72d58b2b 100644
--- a/build/devices/esp32/targets/m5stack_core2/setup-target.js
+++ b/build/devices/esp32/targets/m5stack_core2/setup-target.js
@@ -68,65 +68,69 @@ export default function (done) {
}
// accelerometer and gyrometer
- state.accelerometerGyro = new MPU6886(INTERNAL_I2C);
+ try {
@meganetaaan
meganetaaan / stackchan_speech.md
Last active October 26, 2021 15:45
スタックチャンのコンテスト用動画台本

導入

こんにちは。ししかわです。 秋葉原のロボットベンチャーでソフトエンジニアをしています。

近年、様々なコミュニケーションロボットが登場しています。 しかし、そのほとんどが、ロボットベンダー独自のサービスに依存していたり、限られた機能しか使えず仕様も公開されていない「クローズド」なものです。 クローズドなロボットの中には、その裏で動いているサービスが終了すると同時に、ロボット自身の寿命も尽きてしまうという悲しい運命をたどるものも少なくありません。

"コミュニケーションロボットをもっとオープンにできないだろうか?もっと気軽にロボットのいるくらしを体験してほしい!"

@meganetaaan
meganetaaan / useMediaPipe.ts
Created September 23, 2021 17:31
@mediapipe/holistic で上半身のトラッキングを行うhooks
import { Camera } from "@mediapipe/camera_utils";
import { Holistic, Results } from "@mediapipe/holistic";
import { Ref, useCallback, useState } from "react";
export default function useMediaPipe(): [
Ref<HTMLVideoElement>,
Results | null
] {
const [results, setResults] = useState<Results | null>(null);
const ref = useCallback(async (videoElement: HTMLVideoElement | null) => {
@meganetaaan
meganetaaan / index.html
Last active September 18, 2021 07:11
スタックチャンをWebARで(model-viewerを使用)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
@meganetaaan
meganetaaan / launch_server.log
Created August 2, 2021 07:31
自前ビルドしたバイナリを使ってサーバアプリを立ち上げる。(バイナリは`/home/m5stack/payload/bin`に転送済み)
unitv2% pwd
/home/m5stack/payload
unitv2% sudo env LD_LIBRARY_PATH=/home/m5stack/payload/opencv4/lib:$LD_LIBRARY_PATH python server.py
Password:
/usr/lib/python3.8/subprocess.py:838: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
/usr/lib/python3.8/subprocess.py:844: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
server_core.py:3: DeprecationWarning: The import 'werkzeug.secure_filename' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.utils import secure_filename' instead.
from werkzeug import secure_filename
rm: can't remove './uploads/temp/*': No such file or directory
1970-01-01 05:28:50,264 - [line:795] - INFO: Server PID = 2763, Core PID = 2764