This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from math import sin, cos | |
# Define a function to compute the arm configuration | |
def compute_arm_config(link1_length, link2_length, joint0_angle, joint1_angle): | |
# compute the (x, y) position of the p1 joint and the end effector at p2. | |
# input angle in radians | |
# X0 = distance1 * cos(angle0) | |
# Y0 = distance1 * sin(angle0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conversion Factors | |
rtd = 180./np.pi # radians to degrees | |
dtr = np.pi/180. # degrees to radians |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import symbols, cos, sin, pi, sqrt | |
from sympy.matrices import Matrix | |
### Create symbols for joint variables | |
q1, q2 = symbols('q1:3') | |
# Create a symbolic matrix representing an intrinsic sequence of rotations | |
# about the Y and then Z axes. Let the rotation about the Y axis be described | |
# by q1 and the rotation about Z by q2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
from sympy.matrices import Matrix | |
from sympy import symbols, atan2, sqrt | |
# Conversion Factors | |
rtd = 180./np.pi # radians to degrees | |
# Fixed Axis X-Y-Z Rotation Matrix | |
R_XYZ = Matrix([[ 0.353553390593274, -0.306186217847897, 0.883883476483184], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T0_1 = Matrix([[ cos(q1), -sin(q1), 0, a0], | |
[sin(q1)*cos(alpha0), cos(q1)*cos(alpha0), -sin(alpha0), -sin(alpha0)*d1], | |
[sin(q1)*sin(alpha0), cos(q1)*sin(alpha0), cos(alpha0), cos(alpha0)*d1], | |
[ 0, 0, 0, 1]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to search list of dictionaries and return a selected value in selected dictionary | |
def search_dictionaries(key1, value1, key2, list_of_dictionaries): | |
selected_dic = [element for element in list_of_dictionaries if element[key1] == value1][0] | |
selected_val = selected_dic.get(key2) | |
return selected_val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def normalize_grayscale(image_data): | |
""" | |
Normalize the image data with Min-Max scaling to a range of [0.1, 0.9] | |
:param image_data: The image data to be normalized | |
:return: Normalized image data | |
""" | |
# Implement Min-Max scaling for grayscale image data | |
a = 0.1 | |
b = 0.9 | |
grayscale_min = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def one_hot_encode(labels): | |
""" | |
One hot encode a list of sample labels. Return a one-hot encoded vector for each label. | |
: x: List of sample Labels | |
: return: Numpy array of one-hot encoded labels | |
""" | |
# TODO: Implement Function | |
depth = 10 | |
one_hot = np.eye(depth)[labels] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
################################################################# | |
##\file | |
# | |
# \note | |
# Copyright (c) 2010 \n | |
# Fraunhofer Institute for Manufacturing Engineering | |
# and Automation (IPA) \n\n | |
# | |
################################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<robot name="cham_bot"> | |
<link name="z_axis"> | |
<visual> | |
<geometry> | |
<box size="0.2 0.2 6.5"/> | |
</geometry> | |
<origin rpy="0 0 0" xyz="0.25 0 7"/> |
OlderNewer