This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var leftDiff = (leftIndex.transform.position - leftThumb.transform.position).magnitude; | |
var rightDiff = (rightIndex.transform.position - rightThumb.transform.position).magnitude; | |
if (leftDiff < PINCH_DISTANCE && rightDiff < PINCH_DISTANCE) | |
{ | |
var leftX = leftIndex.transform.position.x; | |
var leftY = leftIndex.transform.position.y; | |
var leftZ = leftIndex.transform.position.z; | |
var rightX = rightIndex.transform.position.x; | |
var rightY = rightIndex.transform.position.y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rospy | |
import tf | |
import socket | |
import time | |
# specify host on network you wish to broadcast on | |
HOST = '192.168.43.36' | |
PORT = 44444 | |
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import serial | |
import numpy as np | |
btns = np.zeros(19) | |
# data sent in two-byte chunks | |
# first 10 bits map to shapes, sel/start, and trigger buttons | |
# next 4 bit map to D-Pad, but not 1:1; can press up-left, down-right, etc |