Skip to content

Instantly share code, notes, and snippets.

@comoc
comoc / note.md
Last active April 26, 2025 17:07
Dify Ollama RAG Docker

Dockerコンテナからホストにアクセスするときのホスト名 host.docker.internal

@comoc
comoc / genesis_on_wsl.md
Last active January 21, 2025 05:53
Genesis on WSL

エラー対策

@comoc
comoc / scantest.cpp
Created February 22, 2024 14:03 — forked from bertrandmartel/scantest.cpp
Bluez BLE scanning example (port of https://github.com/carsonmcdonald/bluez-experiments in C++)
// g++ scantest.cpp -lbluetooth
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <iostream>
#include <signal.h>
#include <bluetooth/bluetooth.h>
@comoc
comoc / AckermannSteering.cs
Last active September 29, 2024 13:27
Ackermann Steering Geometory for Unity in C#
using UnityEngine;
public class AckermannSteering : MonoBehaviour
{
[SerializeField] private float steeringAngle; // ステアリングの切れ角
[SerializeField] private float tread; // 左右の車輪間の距離 (トレッド)
[SerializeField] private float wheelBase; // 前後の車輪間の距離 (ホイールベース)
public float leftWheelAngle { get; private set; } // 左車輪の角度
public float rightWheelAngle { get; private set; } // 右車輪の角度
@comoc
comoc / gist:e784fefea4f16186f89f16010a1e8398
Last active September 18, 2020 06:48
@chikuta さんのプリメイドAIのURDFをUnity ROS#で表示する方法

準備

@chikuta さんのpremaidai_descriptionのURDFを ROS(Kinetic等)とROS#を使ってUnity上に召喚する方法

1. ROSのcatkin_ws内の作業

URDFをrosbridge websocketで送出するための作業

  1. https://github.com/siemens/ros-sharp/tree/master/ROS の file_server フォルダ以下を丸ごと catkin_ws/src 以下に置く
  2. cd catkin_ws/src そして git clone https://github.com/chikuta/premaidai_description.git
  3. premaidai_description/launch 内に以下の内容を記述した fileserver.launch という名前のファイルを作る
@comoc
comoc / mydll.c
Last active November 8, 2018 06:13
WindowsのGUIアプリやDLL内からのprintfを画面表示する方法 ref: https://qiita.com/comocc/items/4604bea440018dfb5bd1
#include <windows.h>
#include <stdio.h>
__declspec(dllexport) void __cdecl Function1(void) {
printf_s("%s\n", __func__); /* 標準出力 */
/* または */
fprintf_s(stdout, "%s\n", __func__); /* 標準出力 */
}
__declspec(dllexport) void __cdecl Function2(void) {
@comoc
comoc / GitignoreGenerator.cs
Created June 26, 2018 09:12
An editor extension makes easier to add a .gitignore file to the root folder of current Unity project
// Please locate this file as Assets/Editor/GitignoreGenerator.cs
// Then select "Custom" > "Add .gitignore to project root from menu".
using UnityEngine;
using UnityEngine.Networking;
using UnityEditor;
using System.IO;
using System;
public class GitignoreGenerator : EditorWindow {
@comoc
comoc / file0.txt
Last active April 13, 2018 03:02
python-oscで0がFalseになってしまう時の対処方法 ref: https://qiita.com/comocc/items/f247b8d14a6067b4fc79
from pythonosc import osc_message_builder
from pythonosc import udp_client
if __name__ == "__main__":
client = udp_client.UDPClient("127.0.0.1", 5005)
msg = osc_message_builder.OscMessageBuilder(address="/my_address")
msg.add_arg(0)
msg = msg.build()
@comoc
comoc / cr.c
Last active October 27, 2017 12:56
ASCII文字の16進表現の値を調べる各種の方法 ref: http://qiita.com/comocc/items/0dab7f5aac9dc7e43d07
#include <stdio.h>
int main(void)
{
printf("%x\n", '\n');
return 0;
}