Skip to content

Instantly share code, notes, and snippets.

@DrewRobert
DrewRobert / RhoBetaApp.py
Last active January 19, 2019 00:28
Rho Beta Application, CS Question 1
"""
Drew Robert
Rho Beta Application
Computer Science, Question 1
"""
# initialize dictionary as a dictionary and final_list as a list
dictionary = {}
final_list = []
@DrewRobert
DrewRobert / Expand_Map.py
Created December 12, 2018 17:41
Expand Map
def map_callback(self, map):
"""
This is a callback for the /map topic
:param map: OccupancyGrid
:return: None
"""
"""
expanded_map = self.expand(map)
occo_map = OccupancyGrid()
occo_map.header = map.header
@DrewRobert
DrewRobert / lab2.py
Last active November 9, 2018 01:50
RBE 3002 Lab 2: Drew Robert
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped, Twist, Pose, PoseWithCovariance, Quaternion
import math
import copy
import numpy as np
from nav_msgs.msg import Odometry
import tf
from tf.transformations import euler_from_quaternion
PI = 3.1415926535897
@DrewRobert
DrewRobert / Homework4Functions.m
Created October 8, 2018 17:29
Homework4 Supporting Functions
function [transMat] = fwkin(theta,d,a,alpha)
transMat = [cos(theta), -sin(theta)*cos(alpha), sin(theta)*sin(alpha), a*cos(theta);
sin(theta), cos(theta)*cos(alpha), -cos(theta)*sin(alpha), a*sin(theta);
0, sin(alpha), cos(alpha), d;
0, 0, 0, 1];
end
@DrewRobert
DrewRobert / Homework4.m
Created October 8, 2018 17:28
Homework4 Main
%% Homework 4
% Drew Robert
% RBE 3001
%% Definitions
%for the purposes of this homework, theta1 and theta2 are labeled as q1(t)
%and q2(t) in all symbolic variable expressions.
syms L1 L2 q1(t) q2(t) pi px py pz Lc1 Lc2 m1 m2 mL g
symVariables = [L1, L2, q1(t), q2(t), px, py, pz, Lc1, Lc2, m1, m2, mL, g];
@DrewRobert
DrewRobert / livePlotVelocityVector.m
Last active September 24, 2018 02:15
Live plot of the task-space velocity vector (Lab 4, Part 5)
%% This script performs live trajectory generation and plotting
% Lab 4 live plotting of task-space velocity vector
clear;
clear java;
%clear import;
clear classes;
vid = hex2dec('3742');
pid = hex2dec('0007');
disp (vid );
@DrewRobert
DrewRobert / FwdVel.m
Created September 24, 2018 02:09
Forward Velocity Kinematics Funtion (Lab4, Part4)
function [pdot] = FwdVel(q,qdot)
jacobian = jacob0(q);
pdot = jacobian*qdot;
end
@DrewRobert
DrewRobert / mainHomework3
Created September 19, 2018 21:46
Homework 3 Main
%% Homework 3
% Drew Robert
% RBE 3001
%% Definitions
syms A B C q1(t) q2(t) q3(t) pi
symVariables = [A, B, C, q1(t), q2(t), q3(t)];
%% Question 1d
%input into fwkin in the form: theta, d, a, alpha
@DrewRobert
DrewRobert / fwkin.m
Created September 19, 2018 21:45
Homework 3 fwkin
function [transMat] = fwkin(theta,d,a,alpha)
transMat = [cos(theta), -sin(theta)*cos(alpha), sin(theta)*sin(alpha), a*cos(theta);
sin(theta), cos(theta)*cos(alpha), -cos(theta)*sin(alpha), a*sin(theta);
0, sin(alpha), cos(alpha), d;
0, 0, 0, 1];
end
@DrewRobert
DrewRobert / ikin.m
Created September 18, 2018 17:32
ikin
function angles = ikin(tipPos)
x = tipPos(1);
y = tipPos(2);
z = tipPos(3);
L1 = 135; %lenth of link 1 (mm)
L2 = 175; %lenth of link 2 (mm)
L3 = 169.28; %lenth of link 3 (mm)
theta1 = atan2(y,x); %degree of joint 1 (rad)