Skip to content

Instantly share code, notes, and snippets.

View yjiro0403's full-sized avatar

Ojiro Yamaguchi yjiro0403

  • JAPAN
View GitHub Profile
@yjiro0403
yjiro0403 / CMakeLists.txt
Last active July 20, 2016 07:31
Point Cloud Library1.8(PCL)のプロジェクト作成 ref: http://qiita.com/yjiro0403/items/8df31f95970f424fa9c6
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(MY_GRAND_PROJECT)
find_package(PCL 1.8 REQUIRED COMPONENTS common io)
set(GUI_TYPE WIN32)
set(HDR)
set(RES)
add_definitions(-DWIN32 -D_WINDOWS -D_UNICODE -DUNICODE)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
@yjiro0403
yjiro0403 / file0.cs
Last active June 27, 2016 03:34
KinectのRGB-Dデータからポイントクラウドを生成してみた ref: http://qiita.com/yjiro0403/items/405e180ee5d1701d6b15
for (int y = 0; y < depthHeight; y += 2)
{
for (int x = 0; x < depthWidth; x += 2)
{
int depthIndex = (y * depthWidth) + x;
CameraSpacePoint p = cameraSpacePoints[depthIndex];
ColorSpacePoint colorPoint = colorSpacePoints[depthIndex];
byte r = 0;
byte g = 0;
@yjiro0403
yjiro0403 / UnityandKinectV2_ColoredPointCloud.cs
Created June 27, 2016 03:02
Unity And Kinect V2 Point Cloud
using UnityEngine;
using Windows.Kinect;
//fileIO
using System.IO;
public class ColoredParticle2 : MonoBehaviour {
public GameObject MultiSourceManager;
public Color color = Color.green;
void setup() {
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
byte var = Serial.read();
int val = var - 0x30;
if (val >= 0 && val < 9) {
Serial.println(val);
@yjiro0403
yjiro0403 / SerialHandler.cs
Last active November 11, 2016 09:15
UnityとArduinoをシリアル通信 ref: http://qiita.com/yjiro0403/items/54e9518b5624c0030531
using UnityEngine;
using System.Collections;
using System.IO.Ports;
using System.Threading;
public class SerialHandler : MonoBehaviour
{
public delegate void SerialDataReceivedEventHandler(string message);
public event SerialDataReceivedEventHandler OnDataReceived;
@yjiro0403
yjiro0403 / file0.d
Last active January 4, 2016 08:49
[D言語]UFCSを自分なりにメモ ref: http://qiita.com/yjiro0403/items/74b6eaf4c6cc2e4c2af1
//'a'をn回繰り返した配列を作る
char[] str = 'a'.repeat(n).array;