Modern_Robotics/packages/Python/README.md

64 lines
1.7 KiB
Markdown

# "modern_robotics" Python Package Instructions #
This package is the code library for _Modern Robotics: Mechanics, Planning,
and Control_. [Here](../../doc/MRlib.pdf) is the introduction. For more
details please see the [website](http://modernrobotics.org/).
## Installing the Package ##
### Recommended Method ###
Use [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)) to install by
running
```
pip install modern_robotics
```
If pip is not preinstalled, check
[here](https://pip.pypa.io/en/stable/installing/) for help of installing pip.
### Alternative Method ###
Download the package and run `python setup.py build` and
`python setup.py install` in the package directory
## Importing the Package ##
To import the package, we recommend using
```
import modern_robotics as mr
```
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)
```
You should get the the variable `invR` whose value is the same as the output
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.