Skip to content

Instantly share code, notes, and snippets.

View xaxxontech's full-sized avatar

Colin Adamson xaxxontech

  • Xaxxon Technologies
  • Vancouver, Canada
View GitHub Profile
#!/usr/bin/env python
import oculusprimesocket
import time
oculusprimesocket.connect()
# define waypoint names in loop
waypoints = ["waypoint1", "waypoint2", "waypoint3", "waypoint4"]
i=0
#!/usr/bin/env python
import rospy, actionlib, tf
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
# convert x,y,radians into 3D pose and send to move_base action server
def publishgoal(str):
global move_base
s = str.split(",")
@xaxxontech
xaxxontech / nav_controller.rb
Created February 1, 2016 19:27
Convert G-code into Tormach Mach 3
class NavController < ApplicationController
def index
end
def translate_ncf
end
def processed
#get rid of all G70s & G94s, add G40 and G49 at beginning
#!/usr/bin/env python
import time, datetime, oculusprimesocket
# connect to server app, keep trying if not running yet
oculusprimesocket.reconnect = True
oculusprimesocket.connect()
while True:
@xaxxontech
xaxxontech / rc.local
Last active January 13, 2016 02:42
Oculus Prime /etc/rc.local example
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#!/usr/bin/env python
import time
import rospy
from sensor_msgs.msg import CameraInfo
"""
ROS node to read timestamp of openni depth camera frame
subtract raw_image header timestamp from system time
start camera 1st with:
#!/usr/bin/env python
"""
ROS node to determine frame rate of openni depth camera
start camera 1st with:
roslaunch openni2_launch openni2.launch
"""
import time
import rospy
#!/usr/bin/env python
import oculusprimesocket
oculusprimesocket.connect()
oculusprimesocket.sendString("gotowaypoint some waypoint")
# when waypoint reached, state var roscurrentgoal is deleted by remote_nav node:
oculusprimesocket.waitForReplySearch("<state> deleted: roscurrentgoal")
#!/usr/bin/env python
import time, oculusprimesocket
oculusprimesocket.reconnect = True
oculusprimesocket.connect()
while True: # loop forever
# wait for docked
#!/usr/bin/env python
import re, time
import oculusprimesocket
oculusprimesocket.connect()
oculusprimesocket.sendString("publish camera")
time.sleep(4) # wait for camera stream to start up
oculusprimesocket.sendString("getlightlevel")
result = oculusprimesocket.waitForReplySearch("<state> lightlevel")