Skip to content

Instantly share code, notes, and snippets.

View pjmara's full-sized avatar
🏠
Working from home

PJ Mara pjmara

🏠
Working from home
View GitHub Profile
@pjmara
pjmara / pointcloudProcessing.cpp
Created August 29, 2020 21:52
Pointcloud detection with intel d435 camera, ROS. Triggers another ROS node with behavior (topic /sentinel_detections)
#Developed by PJ Mara, property of Autonodyne LLC
#include <ros/ros.h>
#include <std_msgs/String.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/point_cloud_conversion.h>
#include <sensor_msgs/NavSatFix.h>
#include <mavros_msgs/GlobalPositionTarget.h>
#include <geometry_msgs/Polygon.h>
#include <nav_msgs/GridCells.h>
@pjmara
pjmara / base_controller.py
Last active August 29, 2020 21:47
ROS Nodes for RBE 3002 SLAM Course WPI
#!/usr/bin/env python2
import rospy
import tf
import math
from nav_msgs.msg import Odometry, OccupancyGrid
from std_msgs.msg import Header, Bool
from nav_msgs.srv import GetPlan, GetMap, GetPlanRequest, GetPlanResponse
@pjmara
pjmara / lab2.py
Created November 7, 2019 13:51
Lab2 files for team 16
#!/usr/bin/env python2
import rospy
import math
from nav_msgs.msg import Odometry
from geometry_msgs.msg import PoseStamped
from geometry_msgs.msg import Twist
from tf.transformations import euler_from_quaternion
class Lab2:
@pjmara
pjmara / cliqueSolver.py
Last active August 1, 2019 15:56
A simple solver for the clique problem
import random
import copy
import time
class myNode:
def __init__(self, name):
self.connection_count = 0
self.connections = []
self.name = name
@pjmara
pjmara / rhoBetaAppProblem1.py
Created January 10, 2019 00:17
Rho Beta Epsilon problem 1 from the application
def specialFunc(ref, threshold):
returnList = []
refDict = {0: 0}
for i in range(0, len(ref)):
test = ref[i]
if test in refDict:
refDict[test] = refDict[test] + 1
else:
refDict[test] = 1
@pjmara
pjmara / bevelgear.groovy
Last active November 28, 2018 21:50
Adding new file from BowlerStudio
//Your code here
import javafx.scene.transform.Affine;
import javafx.application.Platform;
// call another script that will create the robot object and return it.
def myRobot = ScriptingEngine.gitScriptRun(
"https://gist.github.com/fd1602bce81ca9096db3f28648b3d312.git", // git location of the library
"LoadIMUServer.groovy" , // file to load
// Pass the name of the device. This needs to match what was written to the device in Arduino
["IMU-Team21"]
)
@pjmara
pjmara / newControlNoSpeed.groovy
Last active March 9, 2017 20:01
Adding new file from BowlerStudio
import com.neuronrobotics.sdk.addons.gamepad.IJInputEventListener;
import com.neuronrobotics.sdk.addons.gamepad.BowlerJInputDevice;
import net.java.games.input.Component;
import net.java.games.input.Event;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.sdk.dyio.DyIO;
import com.neuronrobotics.sdk.ui.ConnectionDialog;
import com.neuronrobotics.bowlerstudio.physics.*;
@pjmara
pjmara / TheoryFunction.groovy
Last active February 8, 2017 17:37
Adding new file from BowlerStudio
// here in lies my theory of making the greatest function ever...doglegshouldermove
public int WalkMotion (int input, int min, int max) {
int target = (max-min/2); //sets target to middle by default, can change later
if (target < max) {
target = target + 1 //sets target 1 above current thing
Thread.sleep(120/input) //sets wait time
pan.getChannel().setCachedValue(target); //sets value to servo
@pjmara
pjmara / ConnectADyio.groovy
Last active February 15, 2017 19:58
Adding new file from BowlerStudio
import com.neuronrobotics.sdk.addons.gamepad.IJInputEventListener;
import com.neuronrobotics.sdk.addons.gamepad.BowlerJInputDevice;
import net.java.games.input.Component;
import net.java.games.input.Event;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.sdk.dyio.DyIO;
import com.neuronrobotics.sdk.ui.ConnectionDialog;
import com.neuronrobotics.bowlerstudio.physics.*;