Skip to content

Instantly share code, notes, and snippets.

@donghee
donghee / OTOS_raw_data.ino
Last active August 4, 2024 00:09
OTOS raw data
#include "SparkFun_Qwiic_OTOS_Arduino_Library.h"
#include "Wire.h"
QwiicOTOS myOtos;
byte buffer[24]; // lsm + paa registers
//byte buffer[96]; // all registers
byte lsmData[12];
byte paaData[12];
void setup() {
@donghee
donghee / facial_dubbing.py
Last active July 24, 2024 14:21
Testing AI avtar project using Gradio
import os
import glob
import time
import random
import subprocess
import numpy as np
import cv2
import torch
from collections import OrderedDict
@donghee
donghee / robot.cpp
Last active May 5, 2024 06:25
Robot driving with gnuplot
// @file main.cpp
// @author Donghee Park
//
// Copyright (c) 2024 Donghee Park, all rights reserved
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <unistd.h>
#include <math.h>
#define ANALOG_READ 'a'
#define GET_BAUDRATE 'b'
#define PIN_MODE 'c'
#define DIGITAL_READ 'd'
#define READ_ENCODERS 'e'
#define MOTOR_SPEEDS 'm'
#define MOTOR_POSITIONS 'p'
#define MOTOR_RAW_PWM 'o'
//#define PING 'p'
#define RESET_ENCODERS 'r'
@donghee
donghee / client.js
Last active July 1, 2023 10:34
Ground Station: Transmit the joystick command to the robot via WebRTC data channel https://www.youtube.com/watch?v=d-2WEI0uTZA
var pc = null;
var localVideo = document.querySelector("video#localVideo");
var serverVideo = document.querySelector("video#serverVideo");
navigator.mediaDevices
.getUserMedia({
video: {
height: 360,
width: 480,
},
// @file main.cpp
// @author Donghee Park
//
// Copyright (c) 2023 Donghee Park, all rights reserved
#include <iostream>
class Marine {
int hp;
int coord_x, coord_y;
int damage;
import carla
import random
client = carla.Client('127.0.0.1', 2000)
client.set_timeout(2.0)
world = client.get_world()
people = []
for i in range(2):
@donghee
donghee / install-mavproxy-service.md
Last active September 22, 2022 06:40
install mavproxy service

mavproxy 설치하기

  1. 다음 파일을 /home/agx 디렉토리에 복사
  • mavproxy.service, run-mavproxy.sh, mavproxy.sh

mavproxy.service

@donghee
donghee / hpc.cpp
Last active February 14, 2023 17:49
hybrid power control in mbed 2
#include "mbed.h"
DigitalOut power_out_led(D11);
DigitalOut mppt_led(D12);
DigitalOut fuel_led(D13);
DigitalOut fuel_off(D7);
DigitalOut batt_off(D9);
AnalogIn power_out_volt(A0);