Modify some READMEs
This commit is contained in:
parent
cd2b965069
commit
484dcedbea
|
|
@ -1,13 +1,14 @@
|
|||
# Mathematica Front-End Installation Instructions #
|
||||
|
||||
If you'd like to be able to use this package inside of any notebook, regardless
|
||||
of the notebook's location on your filesystem, then you can use Mathematica's
|
||||
front end to install this package. Use the following steps:
|
||||
If you'd like to be able to use this package inside of any notebook,
|
||||
regardless of the notebook's location on your filesystem, then you can use
|
||||
Mathematica's front end to install this package. Use the following steps:
|
||||
|
||||
1. Click `File -> Install...`
|
||||
2. Select `Package` for the _Type of Item to Install_
|
||||
3. Chose `From File...` for the _Source_
|
||||
4. Navigate to the `ModernRobotics.m` and select it as the source for the package
|
||||
4. Navigate to the `ModernRobotics.m` and select it as the source for the
|
||||
package
|
||||
5. The _Install Name_ should default to `ModernRobotics`; if it doesn't then
|
||||
fill in the install name to be `ModernRobotics`.
|
||||
6. Choose whether you want the package installed for a single user or for all
|
||||
|
|
@ -39,8 +40,8 @@ common operating systems:
|
|||
## Manual Installation Instructions ##
|
||||
|
||||
If you have any troubles with the front-end installation described above, you
|
||||
can try manually installing the package by copying the `ModernRobotics.m` file
|
||||
into the same directory mentioned for uninstalling.
|
||||
can try manually installing the package by copying the `ModernRobotics.m`
|
||||
file into the same directory mentioned for uninstalling.
|
||||
|
||||
|
||||
# Using the Package Locally #
|
||||
|
|
@ -53,7 +54,8 @@ SetDirectory["<PATH-TO-DIRECTORY-CONTAINING-ModernRobotics.m>"]
|
|||
<<ModernRobotics`
|
||||
```
|
||||
|
||||
If the notebook and the package are located in the same directory you could use
|
||||
If the notebook and the package are located in the same directory you could
|
||||
use
|
||||
|
||||
```
|
||||
SetDirectory[NotebookDirectory[]]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
# "mr" Matlab Package Instructions #
|
||||
|
||||
This package is the code library for _Modern Robotics: Mechanics, Planning,
|
||||
and Control_. For more details please see the library introduction pdf file
|
||||
or the [website](http://modernrobotics.org/).
|
||||
|
||||
To import the package, use `addpath` as
|
||||
|
||||
```
|
||||
addpath('$FOLDER_PATH/mr')
|
||||
```
|
||||
|
||||
where `$FOLDER_PATH` is the path to "mr" directory.
|
||||
|
||||
To check the function list and which chapter in the book do those functions
|
||||
belong to, use `help` as
|
||||
|
||||
```
|
||||
help mr
|
||||
```
|
||||
|
||||
To check more introduction and example of a function, use `help` as
|
||||
|
||||
```
|
||||
help $FUNCTION_NAME
|
||||
```
|
||||
|
||||
## ##
|
||||
|
||||
Author: Huan Weng, Bill Hunt, Mikhail Todes, Jarvis Schultz
|
||||
Contact: huanweng@u.northwestern.edu
|
||||
Package Version: 1.0.0
|
||||
Matlab Version: R2017b
|
||||
Tested in Matlab R2017b
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
function [thetalist, success] ...
|
||||
= IKinSpace(Slist, M, T, thetalist0, eomg, ev)
|
||||
% *** CHAPTER 6: INVERSE KINEMATICS ***
|
||||
% Takes Slist: The joint screw axes in the space frame when the manipulator
|
||||
% is at the home position, in the format of a matrix with the
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
# "modern_robotics" Python Package Instructions #
|
||||
|
||||
This package is the code library for _Modern Robotics: Mechanics, Planning,
|
||||
and Control_. For more details please see the library introduction pdf file
|
||||
or the [website](http://modernrobotics.org/).
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from __version__ import __version__
|
||||
from .__version__ import __version__
|
||||
|
||||
from core import *
|
||||
from .core import *
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
from __future__ import print_function
|
||||
'''
|
||||
***************************************************************************
|
||||
Modern Robotics: Mechanics, Planning, and Control.
|
||||
|
|
@ -19,7 +20,6 @@ Optional library: matplotlib
|
|||
'''
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
'''
|
||||
*** BASIC HELPER FUNCTIONS ***
|
||||
|
|
@ -658,7 +658,7 @@ def JacobianBody(Blist, thetalist):
|
|||
[-1.44321167, 2.94561275, 1.43306521, 0.3]
|
||||
[-2.06639565, 1.82881722, -1.58868628, 0.4]])
|
||||
"""
|
||||
Jb = np.array(Blist).copy()
|
||||
Jb = np.array(Blist).copy().astype(np.float)
|
||||
T = np.eye(4)
|
||||
for i in range(len(thetalist) - 2, -1, -1):
|
||||
T = np.dot(T,MatrixExp6(VecTose3(np.array(Blist)[:, i + 1] \
|
||||
|
|
@ -690,7 +690,7 @@ def JacobianSpace(Slist, thetalist):
|
|||
[0.2, 0.43654132, -2.43712573, 2.77535713]
|
||||
[0.2, 2.96026613, 3.23573065, 2.22512443]])
|
||||
"""
|
||||
Js = np.array(Slist).copy()
|
||||
Js = np.array(Slist).copy().astype(np.float)
|
||||
T = np.eye(4)
|
||||
for i in range(1, len(thetalist)):
|
||||
T = np.dot(T, MatrixExp6(VecTose3(np.array(Slist)[:, i - 1] \
|
||||
|
|
@ -1305,7 +1305,7 @@ def InverseDynamicsTrajectory(thetamat, dthetamat, ddthetamat, g, \
|
|||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
except:
|
||||
print 'The result will not be plotted due to a lack of package matplotlib'
|
||||
print('The result will not be plotted due to a lack of package matplotlib')
|
||||
else:
|
||||
plt.plot(timestamp, Tau1, label = "Tau1")
|
||||
plt.plot(timestamp, Tau2, label = "Tau2")
|
||||
|
|
@ -1409,11 +1409,11 @@ def ForwardDynamicsTrajectory(thetalist, dthetalist, taumat, g, Ftipmat, \
|
|||
dtheta3 = dthetamat[:, 2]
|
||||
N = np.array(taumat).shape[0]
|
||||
Tf = np.array(taumat).shape[0] * dt
|
||||
timestamp = np.linspace(0, Tf, N)
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
timestamp = np.linspace(0, Tf, N)
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
except:
|
||||
print 'The result will not be plotted due to a lack of package matplotlib'
|
||||
print(The result will not be plotted due to a lack of package matplotlib)
|
||||
else:
|
||||
plt.plot(timestamp, theta1, label = "Theta1")
|
||||
plt.plot(timestamp, theta2, label = "Theta2")
|
||||
|
|
@ -1430,9 +1430,9 @@ def ForwardDynamicsTrajectory(thetalist, dthetalist, taumat, g, Ftipmat, \
|
|||
"""
|
||||
taumat = np.array(taumat).T
|
||||
Ftipmat = np.array(Ftipmat).T
|
||||
thetamat = taumat.copy()
|
||||
thetamat = taumat.copy().astype(np.float)
|
||||
thetamat[:, 0] = thetalist
|
||||
dthetamat = taumat.copy()
|
||||
dthetamat = taumat.copy().astype(np.float)
|
||||
dthetamat[:, 0] = dthetalist
|
||||
for i in range(np.array(taumat).shape[1] - 1):
|
||||
for j in range(intRes):
|
||||
|
|
@ -1798,7 +1798,7 @@ def SimulateControl(thetalist, dthetalist, g, Ftipmat, Mlist, Glist, \
|
|||
#Create a trajectory to follow
|
||||
thetaend = np.array([np.pi / 2, np.pi, 1.5 * np.pi])
|
||||
Tf = 1
|
||||
N = 1.0 * Tf / dt
|
||||
N = int(1.0 * Tf / dt)
|
||||
method = 5
|
||||
traj = mr.JointTrajectory(thetalist, thetaend, Tf, N, method)
|
||||
thetamatd = np.array(traj).copy()
|
||||
|
|
@ -1871,26 +1871,26 @@ def SimulateControl(thetalist, dthetalist, g, Ftipmat, Mlist, Glist, \
|
|||
eint = np.add(eint, dt * np.subtract(thetamatd[:, i], thetacurrent))
|
||||
#Output using matplotlib to plot
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.pyplot as plt
|
||||
except:
|
||||
print 'The result will not be plotted due to a lack of package matplotlib'
|
||||
print('The result will not be plotted due to a lack of package matplotlib')
|
||||
else:
|
||||
links = np.array(thetamat).shape[0]
|
||||
N = np.array(thetamat).shape[1]
|
||||
Tf = N * dt
|
||||
timestamp = np.linspace(0, Tf, N)
|
||||
for i in range(links):
|
||||
col = [np.random.uniform(0, 1), np.random.uniform(0, 1),
|
||||
np.random.uniform(0, 1)]
|
||||
plt.plot(timestamp, thetamat[i, :], "-", color=col, \
|
||||
label = ("ActualTheta" + str(i + 1)))
|
||||
plt.plot(timestamp, thetamatd[i, :], ".", color=col, \
|
||||
label = ("DesiredTheta" + str(i + 1)))
|
||||
plt.legend(loc = 'upper left')
|
||||
plt.xlabel("Time")
|
||||
plt.ylabel("Joint Angles")
|
||||
plt.title("Plot of Actual and Desired Joint Angles")
|
||||
plt.show()
|
||||
links = np.array(thetamat).shape[0]
|
||||
N = np.array(thetamat).shape[1]
|
||||
Tf = N * dt
|
||||
timestamp = np.linspace(0, Tf, N)
|
||||
for i in range(links):
|
||||
col = [np.random.uniform(0, 1), np.random.uniform(0, 1),
|
||||
np.random.uniform(0, 1)]
|
||||
plt.plot(timestamp, thetamat[i, :], "-", color=col, \
|
||||
label = ("ActualTheta" + str(i + 1)))
|
||||
plt.plot(timestamp, thetamatd[i, :], ".", color=col, \
|
||||
label = ("DesiredTheta" + str(i + 1)))
|
||||
plt.legend(loc = 'upper left')
|
||||
plt.xlabel("Time")
|
||||
plt.ylabel("Joint Angles")
|
||||
plt.title("Plot of Actual and Desired Joint Angles")
|
||||
plt.show()
|
||||
taumat = np.array(taumat).T
|
||||
thetamat = np.array(thetamat).T
|
||||
return (taumat, thetamat)
|
||||
|
|
|
|||
|
|
@ -12,11 +12,17 @@ setup(
|
|||
packages=['modern_robotics'],
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Topic :: Utilities",
|
||||
"License :: OSI Approved :: BSD License",
|
||||
"Intended Audience :: Education",
|
||||
"Intended Audience :: Science/Research",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Natural Language :: English",
|
||||
"Programming Language :: Python :: 2",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Topic :: Education",
|
||||
"Topic :: Scientific/Engineering",
|
||||
],
|
||||
install_requires=[
|
||||
'numpy'
|
||||
'numpy',
|
||||
],
|
||||
platforms='Linux, Mac, Windows',
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue