Skip to content

Instantly share code, notes, and snippets.

View moriarty's full-sized avatar

Alex Moriarty moriarty

View GitHub Profile
4.53931 1.61412 -1.44282 3.06248 2.94969 platform_middle
3.78521 1.40886 -1.86213 3.54030 2.93517 platform_pre
4.53931 1.29317 -0.963919 2.85246 2.94982 platform_middle_intermediate
@moriarty
moriarty / gist:acd6971d89429ba60b12
Last active August 29, 2015 14:21
Learning and Adaptivity In Class Assignment READ DATA
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Alex Moriarty
"""
import numpy as np
import sklearn
from sklearn import tree
from sklearn.externals.six import StringIO
import pydot
@moriarty
moriarty / gist:1ba8c4a112f6bab4eae1
Created May 24, 2015 11:09
MAS Group ROS Indigo on Arch Linux
alex@moriarty-xmg:../src$ wstool
workspace: /home/alex/workspace/ros/indigo/robocup/src
Localname S SCM Version-Spec UID (Spec) URI (Spec) [http(s)://...]
--------- - ---- ------------ ----------- ---------------------------
youbot-manipulation V git hydro 5eb6b10cd5bd (0140b2c00642) github.com/svenschneider/youbot-manipulation.git
youbot_diagnostics V git hydro-devel 7a566dd954d8 (7e7861604986) github.com/mas-group/youbot_diagnostics.git
youbot_simulation git hydro-devel 1223bf999b95 github.com/mas-group/youbot_simulation.git
youbot_description git hydro-devel 3de35462caab github.com/mas-group/youbot_description.git
youbot_driver_ros_interface V git hydro-devel a3dcdc090633 (837ffceeb9a7) github.com/mas-group/youbot_driver_ros_interface.git
@moriarty
moriarty / gist:dd33dfd57e1a51b020a3
Created June 2, 2015 12:31
Colour Sensor Event R increasing
String epStatement = "select * from ColorSensorEvent "
+ " match_recognize ( "
+ " measures A as c1, B as c2 "
+ " pattern (A B) "
+ " define "
+ " A as A.r > 10.0 , "
+ " B as (A.r < B.r) ) ";
select twist.data from TwistROSMessage as twist
where twist.data.linear.x > 0
select cmd.data from CmdVelEvent as cmd
where cmd.data.linear.x > 0
select data from StringROSMessage(topic='chatter/String2')
where data != '0'
select * from pattern[ every [1] (a=AButtonEvent -> b=BButtonEvent)]
@moriarty
moriarty / linefollower.py
Created October 24, 2012 05:36
Python Line Follower NXT
"""
Line Follower
By: Alex Moriarty (alexander@dal.ca)
Location:
"""
from nxt.locator import *
from nxt.motor import *
from nxt.sensor import *
@moriarty
moriarty / move_arm_example.py
Created October 24, 2012 05:38
Python ROS example
#!/usr/bin/python
import time
import roslib
roslib.load_manifest('raw_arm_cmds')
import rospy
import actionlib
from simple_script_server import *
@moriarty
moriarty / bash_ros_stuff
Last active October 13, 2015 16:58
My bash ros stuff
## These are variables you might change often
_ROS_DISTRO=hydro
_PRINT=true # display ROS info in new bash sessions
_FANCY=true
export ROBOT=youbot-brsu-2
export ROBOT_ENV=brsu-c025
export ROS_MASTER_URI=http://localhost:11311
## These are used to locate your catkin_ws/devel/setup.bash
_ROS_WS=$HOME/workspace/ros_ws
@moriarty
moriarty / gdb cfh debugging
Created November 3, 2015 14:30
debugging cfh with gdb
(gdb) run
Starting program: /home/rockin/rockin-refbox/bin/llsf-refbox
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
15:26:46.818769 RefBox: Using CLIPS rules from: /home/rockin/rockin-refbox/rockin/clips/
[New Thread 0x7ffff1618700 (LWP 13597)]
13:57:45.774480 TriggeredConveyorBelt: DETECTED PLATE: NO_PLATE
13:57:46.098968 TriggeredConveyorBelt: DETECTED PLATE: NO_PLATE
13:57:46.425638 TriggeredConveyorBelt: DETECTED PLATE: NO_PLATE
13:57:46.750732 TriggeredConveyorBelt: DETECTED PLATE: NO_PLATE
13:57:47.075578 TriggeredConveyorBelt: DETECTED PLATE: NO_PLATE
13:57:47.646121 TriggeredConveyorBelt: DETECTED PLATE: FAULTY_PLATE
13:57:47.687523 TriggeredConveyorBelt: DETECTED PLATE: FAULTY_PLATE
13:57:47.774259 TriggeredConveyorBelt: DETECTED PLATE: FAULTY_PLATE
13:57:47.855565 TriggeredConveyorBelt: DETECTED PLATE: FAULTY_PLATE
13:57:47.896288 TriggeredConveyorBelt: DETECTED PLATE: FAULTY_PLATE