Skip to content

Instantly share code, notes, and snippets.

@Kdoje
Kdoje / Question1.m
Created November 12, 2018 01:05
Kent Libby question 1 gist
%% Kent Libby question 1 matlab script
L=.2; % in meters
end_point=[6 7]; % in meters
R=5; % in meters
D=sqrt(end_point(1)^2+end_point(2)^2)
%% This calculates angle of the arc the robot travels
arc=acos((-D^2+R^2+R^2)/(2*R*R)) % in radians
dt=20 % in seconds
omega=-arc/dt
%% This finds the wheel speeds based off radius and omega
@Kdoje
Kdoje / robot.py
Created November 10, 2018 20:32
Lab 2 code
#!/usr/bin/env python
import math
import copy
import numpy
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import PoseStamped, Twist, Pose, PoseWithCovariance
from geometry_msgs.msg import Quaternion
"""
@Author Kent Libby
This was compiled against python 2
To run the script use python2 Hwk2.py
"""
import random
import math
def create_array(num_items):
#=
Kent Libby Homework 2, 11/03/18
=#
clearconsole()
using Plots; gr()
#=
Excercise 1.1:
1. The formula needed is V=omega(rad/s)*Diameter/2
=#
function [DH] = dhOutput(a, alp, d, th)
DH = [cosd(th), -sind(th)*cosd(alp), sind(th)*sind(alp), a*cosd(th);
sind(th), cosd(th)*cosd(alp), -cosd(th)*sind(alp), a*sind(th);
0, sind(alp), cosd(alp), d;
0, 0, 0, 1];
end
@Kdoje
Kdoje / ikin.m
Created September 13, 2018 07:20
Kent Libby's inverse kinematic solution for pre-lab3
function [joints]= ikin(x, y, z)
%% TODO update these with the robot params
theta1=0;
theta2=0;
theta3=90;
curPos=zeros(3,1);
L1 = 135; L2 = 175; L3 = 169.28;
%% Creates a jacobian then uses the difference between the locations to give the theta values to move to
J1=cross([0;0;1], [L2*cosd(theta2) + L3*cosd(theta3); L2*sind(theta2)+L3*sind(theta3); L1]);
J2=cross([sind(theta1); -cosd(theta1); 0], [L2*cosd(theta2) + L3*cosd(theta3); L2*sind(theta2)+L3*sind(theta3); 0]);
@Kdoje
Kdoje / fwkin.m
Created September 6, 2018 04:20
Kent Libby forward kinematic script
%% For this function, z is defined to be the axis coming out of the plane the base is on (z is up)
%This uses degrees
function p = fwkin(t1, t2, t3)
L1=135;
L2=175;
L3=169.28;
TX12=[cosd(t1) -sind(t1) 0 0;
sind(t1) cosd(t1) 0 0;
0 0 1 L1;
0 0 0 1];
#include "DummyServer.h"
void DummyServer::event(float * buffer){
for(int i = 0; i < myPumberOfPidChannels; i++)
{
buffer[(i*3)+0] = 0;
buffer[(i*3)+1] = 0;
buffer[(i*3)+2] = 0;
}