Skip to content

Commit

Permalink
formatを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
KuraZuzu committed Dec 16, 2024
1 parent 0934aa8 commit cadb496
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion firmware/mods/face_tracker/mod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* @brief face tracking mod with UnitV2
* @param {*} robot
Expand Down
1 change: 0 additions & 1 deletion firmware/mods/look_around/mod.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Timer from 'timer'
import { randomBetween, asyncWait } from 'stackchan-util'


export function onRobotCreated(robot) {
let isFollowing = false
robot.button.a.onChanged = function () {
Expand Down
5 changes: 4 additions & 1 deletion firmware/mods/mimic_main/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ function onRobotCreated(robot) {
service.txt['yaw'] = yaw
service.txt['pitch'] = pitch
mdns.update(service)
trace(yaw);trace(" ");trace(pitch);trace("\n\r");
trace(yaw)
trace(' ')
trace(pitch)
trace('\n\r')
}
}, 100)
}
Expand Down
4 changes: 2 additions & 2 deletions firmware/stackchan/ble/beacon-packet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export class BeaconDataPacket {
success: false,
reason: 'invalid length',
}
}else{
trace('${payload}')
} else {
trace('${payload}')
}
if (payload[0] !== 0x02 || payload[1] !== 0x15) {
return {
Expand Down
12 changes: 4 additions & 8 deletions firmware/stackchan/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { Renderer as SimpleRenderer } from 'simple-face'
import { NetworkService } from 'network-service'
import Touch from 'touch'
import { loadPreferences, asyncWait } from 'stackchan-util'
import TextDecoder from 'text/decoder'

import TextDecoder from 'text/decoder'

function createRobot() {
const decoder = new TextDecoder()
Expand All @@ -24,17 +23,15 @@ function createRobot() {
['voicevox', VoiceVoxTTS],
['elevenlabs', ElevenLabsTTS],
])
const renderers = new Map<string, new (param: unknown) => Renderer>([
['simple', SimpleRenderer],
])
const renderers = new Map<string, new (param: unknown) => Renderer>([['simple', SimpleRenderer]])

// TODO: select driver/tts/renderer by mod

const errors: string[] = []

// Servo Driver
const driverPrefs = loadPreferences('driver')
const driverKey = "dynamixel"
const driverKey = 'dynamixel'
const Driver = DynamixelDriver

// TTS
Expand All @@ -47,7 +44,7 @@ function createRobot() {
const rendererKey = rendererPrefs.type ?? 'simple'
const Renderer = renderers.get(rendererKey)

if ( !TTS || !Renderer) {
if (!TTS || !Renderer) {
for (const [key, klass] of [
[ttsKey, TTS],
[rendererKey, Renderer],
Expand All @@ -59,7 +56,6 @@ function createRobot() {
throw new Error(errors.join('\n'))
}


const driver = new DynamixelDriver(driverPrefs)
const renderer = new Renderer(rendererPrefs)
const tts = new TTS(ttsPrefs)
Expand Down
2 changes: 1 addition & 1 deletion firmware/stackchan/robot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export class Robot {
})
}

decode(buffer){
decode(buffer) {
return this.#decoder.decode(buffer)
}

Expand Down

0 comments on commit cadb496

Please sign in to comment.