2018-07-30 18:40:46 +00:00
|
|
|
# "modern_robotics" Python Package Instructions #
|
|
|
|
|
|
2019-02-07 20:10:18 +00:00
|
|
|
## Dependency Requirement
|
|
|
|
|
|
|
|
|
|
`numpy` should be preinstalled.
|
|
|
|
|
|
2018-08-30 07:08:52 +00:00
|
|
|
## Installing the Package ##
|
2018-08-13 03:46:28 +00:00
|
|
|
|
2018-08-30 07:08:52 +00:00
|
|
|
### Recommended Method ###
|
2018-08-13 03:46:28 +00:00
|
|
|
|
2018-08-30 07:08:52 +00:00
|
|
|
Use [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)) to install by
|
|
|
|
|
running
|
2018-08-13 03:46:28 +00:00
|
|
|
|
2018-08-30 07:08:52 +00:00
|
|
|
```
|
|
|
|
|
pip install modern_robotics
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If pip is not preinstalled, check
|
2018-09-03 22:38:37 +00:00
|
|
|
[here](https://pip.pypa.io/en/stable/installing/) for help installing pip.
|
2018-08-30 07:08:52 +00:00
|
|
|
|
|
|
|
|
### Alternative Method ###
|
|
|
|
|
|
|
|
|
|
Download the package and run `python setup.py build` and
|
|
|
|
|
`python setup.py install` in the package directory
|
|
|
|
|
|
|
|
|
|
## Importing the Package ##
|
2018-08-13 03:46:28 +00:00
|
|
|
|
|
|
|
|
To import the package, we recommend using
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
import modern_robotics as mr
|
|
|
|
|
```
|
2018-08-30 07:08:52 +00:00
|
|
|
|
|
|
|
|
This process is required for any Python program using this package.
|
|
|
|
|
|
|
|
|
|
## Using the Package ##
|
|
|
|
|
|
|
|
|
|
After importing the package, you should be able to use any function in the
|
|
|
|
|
package. Taking the function `RotInv` for example, you can check the
|
|
|
|
|
description and usage example of this function by running
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
help(mr.RotInv)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
As mentioned in the function usage example, you can try using this function
|
|
|
|
|
by running
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
R = np.array([[0, 0, 1],
|
|
|
|
|
[1, 0, 0],
|
|
|
|
|
[0, 1, 0]])
|
|
|
|
|
invR = mr.RotInv(R)
|
|
|
|
|
```
|
|
|
|
|
|
2018-09-03 22:38:37 +00:00
|
|
|
You should get the variable `invR` whose value is the same as the output
|
2018-08-30 07:08:52 +00:00
|
|
|
shown in the function usage example.
|
|
|
|
|
|
|
|
|
|
## Using the Package Locally ##
|
|
|
|
|
|
|
|
|
|
It is possible to use the package locally without installation. Download and
|
|
|
|
|
place the package in the working directory. Note that since the package is
|
|
|
|
|
not installed, you need to move the package if the working directory is
|
|
|
|
|
changed. Importing is still required before using.
|