rvc3python


Namervc3python JSON
Version 0.9.2 PyPI version JSON
download
home_pageNone
SummarySupport for book: Robotics, Vision & Control 3 in Python
upload_time2024-08-06 02:36:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords robotics robot manipulator robot arm mobile robot mobile manipulation path planning slam pose graph dubins reeds-shepp lattice planner rrt prm rapidly exploring random tree probabilistic roadmap planner force control kinematics jacobian position control velocity control spatial math so(2) se(2) so(3) se(3) twist product of exponential translation orientation angle-axis lie group skew symmetric matrix pose translation rotation matrix rigid body transform homogeneous transformation euler angles roll-pitch-yaw angles quaternion unit-quaternion computer vision machine vision robotic vision color space blackbody image segmentation blobs hough transform k-means homography camera calibration visual odometry bundle adjustment stereo vision rectification
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Robotics, Vision & Control: 3rd edition in Python (2023)
[![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/master/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python)
[![QUT Centre for Robotics Open Source](https://github.com/qcr/qcr.github.io/raw/master/misc/badge.svg)](https://qcr.github.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

[![PyPI version](https://badge.fury.io/py/rvc3python.svg)](https://badge.fury.io/py/rvc3python)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rvc3python.svg)
[![PyPI - Downloads](https://img.shields.io/pypi/dw/rvc3python)](https://pypistats.org/packages/rvc3python)

<table style="border:0px">
<tr style="border:0px">
<td style="border:0px">
<img src="https://github.com/petercorke/RVC3-python/raw/main/doc/frontcover.png" alt="Front cover 978-3-031-06468-5_5208" width="300">
</td>
<td style="border:0px">
Welcome to the online hub for the book:
<ul type="none">
<li><b>Robotics, Vision & Control</b>: fundamental algorithms in Python (3rd edition) 
<li>Peter Corke, published by Springer-Nature 2023.</li>
<li><b>ISBN</b> 978-3-031-06468-5 (hardcopy), 978-3-031-06469-2 (eBook)</li>
<li><b>DOI</b> <a href="https://doi.org/10.1007/978-3-031-06469-2">10.1007/978-3-031-06469-2</a></li>
</ul>
<br><br>
<p>Report an issue with the book or its supporting code <a href="https://github.com/petercorke/RVC3-python/issues/new/choose">here</a>.</p>

<p>Known errata for the book can be viewed <a href="https://github.com/petercorke/RVC3-python/wiki/Errata">here</a>.</p>
</td>
</tr>
</table>


This book uses many examples based on the following open-source Python packages

<a href="https://github.com/petercorke/robotics-toolbox-python"><img alt="Robotics Toolbox for Python" src="https://github.com/petercorke/robotics-toolbox-python/raw/master/docs/figs/RobToolBox_RoundLogoB.png" width="130"></a>
<a href="https://github.com/petercorke/machinevision-toolbox-python"><img alt="Machine Vision Toolbox for Python" src="https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/VisionToolboxLogo_NoBackgnd@2x.png" width="150"></a>
<a href="https://github.com/petercorke/spatialmath-python"><img alt="Spatial Maths Toolbox for Python" src="https://github.com/petercorke/spatialmath-python/raw/master/docs/figs/CartesianSnakes_LogoW.png" width="130"></a>
<a href="https://github.com/petercorke/bdsim"><img alt="Block diagram simulation for Python" src="https://github.com/petercorke/bdsim/raw/master/figs/BDSimLogo_NoBackgnd@2x.png" width="250"></a>

**Robotics Toolbox for Python**, **Machine Vision Toolbox for Python**, **Spatial Maths Toolbox for Python**, **Block Diagram Simulation for Python**.  These in turn have dependencies on other packages created by the author and
third parties.

## Installing the package

This package provides a simple one-step installation of *all* the required Toolboxes
```shell
pip install rvc3python
```
or
```shell
conda install rvc3python
```

There are a lot of dependencies and this might take a minute or so.  You now have a very
powerful computing environment for robotics and computer vision.

### Python version

Given the rapid rate of language additions, particularly around type hinting, use at
least Python 3.8.  Python 3.7 goes end of life in June 2023.

Not all package dependencies will work with the latest release of Python.  In particular, check:
* [PyTorch](https://pypi.org/project/torch/) used for segmentation examples in Chapter 12
* [Open3D](https://pypi.org/project/open3d), used for point cloud examples in Chapter 14.

### Installing into a Conda environment

It's probably a good idea to create a virtual environment to keep this package
and its dependencies separated from your other Python code and projects.  If you've
never used virtual environments before this might be a good time to start, and it
is really easy [using Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html):
```shell
conda create -n RVC3 python=3.10
conda activate RVC3
pip install rvc3python
```

### Installing deep learning tools

Chapter 11 has some deep learning examples based on PyTorch.  If you don't have 
PyTorch installed you can use the `pytorch` install option
```shell
pip install rvc3python[pytorch]
```
or
```shell
conda install rvc3python
```
## Using the Toolboxes

The simplest way to get going is to use the command line tool

```shell
$ rvctool
 ____       _           _   _             __     ___     _                ___      ____            _             _   _____ 
|  _ \ ___ | |__   ___ | |_(_) ___ ___    \ \   / (_)___(_) ___  _ __    ( _ )    / ___|___  _ __ | |_ _ __ ___ | | |___ / 
| |_) / _ \| '_ \ / _ \| __| |/ __/ __|    \ \ / /| / __| |/ _ \| '_ \   / _ \/\ | |   / _ \| '_ \| __| '__/ _ \| |   |_ \ 
|  _ < (_) | |_) | (_) | |_| | (__\__ \_    \ V / | \__ \ | (_) | | | | | (_>  < | |__| (_) | | | | |_| | | (_) | |  ___) |
|_| \_\___/|_.__/ \___/ \__|_|\___|___( )    \_/  |_|___/_|\___/|_| |_|  \___/\/  \____\___/|_| |_|\__|_|  \___/|_| |____/ 
                                      |/                                                                                   
                                                                                 
for Python (RTB==1.1.0, MVTB==0.9.5, SG==1.1.7, SMTB==1.1.7, NumPy==1.24.2, SciPy==1.10.1, Matplotlib==3.7.1)

    import math
    import numpy as np
    from scipy import linalg, optimize
    import matplotlib.pyplot as plt
    from spatialmath import *
    from spatialmath.base import *
    from spatialmath.base import sym
    from spatialgeometry import *
    from roboticstoolbox import *
    from machinevisiontoolbox import *
    import machinevisiontoolbox.base as mvb
    
    # useful variables
    from math import pi
    puma = models.DH.Puma560()
    panda = models.DH.Panda()

    func/object?       - show brief help
    help(func/object)  - show detailed help
    func/object??      - show source code

Results of assignments will be displayed, use trailing ; to suppress
    
Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:24:27) [Clang 14.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.11.0 -- An enhanced Interactive Python. Type '?' for help.


>>> 
```

This provides an interactive Python
([IPython](https://ipython.readthedocs.io/en/stable)) session with all the Toolboxes and
supporting packages imported, and ready to go.  It's a highly capable, convenient, and
"MATLAB-like" workbench environment for robotics and computer vision.

For example to load an ETS model of a Panda robot, solve a forward kinematics
and inverse kinematics problem, and an interactive graphical display is simply:

```python
>>> panda = models.ETS.Panda()
ERobot: Panda (by Franka Emika), 7 joints (RRRRRRR)
┌─────┬───────┬───────┬────────┬─────────────────────────────────────────────┐
│link │ link  │ joint │ parent │             ETS: parent to link             │
├─────┼───────┼───────┼────────┼─────────────────────────────────────────────┤
│   0 │ link0 │     0 │ BASE   │ tz(0.333) ⊕ Rz(q0)                          │
│   1 │ link1 │     1 │ link0  │ Rx(-90°) ⊕ Rz(q1)                           │
│   2 │ link2 │     2 │ link1  │ Rx(90°) ⊕ tz(0.316) ⊕ Rz(q2)                │
│   3 │ link3 │     3 │ link2  │ tx(0.0825) ⊕ Rx(90°) ⊕ Rz(q3)               │
│   4 │ link4 │     4 │ link3  │ tx(-0.0825) ⊕ Rx(-90°) ⊕ tz(0.384) ⊕ Rz(q4) │
│   5 │ link5 │     5 │ link4  │ Rx(90°) ⊕ Rz(q5)                            │
│   6 │ link6 │     6 │ link5  │ tx(0.088) ⊕ Rx(90°) ⊕ tz(0.107) ⊕ Rz(q6)    │
│   7 │ @ee   │       │ link6  │ tz(0.103) ⊕ Rz(-45°)                        │
└─────┴───────┴───────┴────────┴─────────────────────────────────────────────┘

┌─────┬─────┬────────┬─────┬───────┬─────┬───────┬──────┐
│name │ q0  │ q1     │ q2  │ q3    │ q4  │ q5    │ q6   │
├─────┼─────┼────────┼─────┼───────┼─────┼───────┼──────┤
│  qr │  0° │ -17.2° │  0° │ -126° │  0° │  115° │  45° │
│  qz │  0° │  0°    │  0° │  0°   │  0° │  0°   │  0°  │
└─────┴─────┴────────┴─────┴───────┴─────┴───────┴──────┘

>>> panda.fkine(panda.qz)
   0.7071    0.7071    0         0.088     
   0.7071   -0.7071    0         0         
   0         0        -1         0.823     
   0         0         0         1      
>>> panda.ikine_LM(SE3.Trans(0.4, 0.5, 0.2) * SE3.Ry(pi/2))
IKSolution(q=array([  -1.849,   -2.576,   -2.914,     1.22,   -1.587,    2.056,   -1.013]), success=True, iterations=13, searches=1, residual=3.3549072615799585e-10, reason='Success')
>>> panda.teach(panda.qz)
```
![](https://github.com/petercorke/RVC3-python/raw/main/doc/panda_noodle.png)

Computer vision is just as easy.  For example, we can import an image, blur it
and display it alongside the original
```python
>>> mona = Image.Read("monalisa.png")
>>> Image.Hstack([mona, mona.smooth(sigma=5)]).disp()
```
![](https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/mona%2Bsmooth.png)

or load two images of the same scene, compute SIFT features and display putative
matches
```python
>>> sf1 = Image.Read("eiffel-1.png", mono=True).SIFT()
>>> sf2 = Image.Read("eiffel-2.png", mono=True).SIFT()
>>> matches = sf1.match(sf2)
>>> matches.subset(100).plot("w")
```
![](https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/matching.png)

`rvctool` is a wrapper around
[IPython](https://ipython.readthedocs.io/en/stable) where:
- robotics and vision functions and classes can be accessed without needing
  package prefixes
- results are displayed by default like MATLAB does, and like MATLAB you need to
  put a semicolon on the end of the line to prevent this
- the prompt is the standard Python REPL prompt `>>>` rather than the IPython
  prompt, this can be overridden by a command-line switch
- allows cutting and pasting in lines from the book, and prompt characters are
  ignored

The Robotics, Vision & Control book uses `rvctool` for all the included
examples.

`rvctool` imports the all the above mentioned packages using `import *` which is
not considered best Python practice.  It is very convenient for interactive
experimentation, but in your own code you can handle the imports as you see
fit.

### Cutting and pasting

IPython is very forgiving when it comes to cutting and pasting in blocks of Python
code.  It will strip off the `>>>` prompt character and ignore indentation.  The normal
python REPL is not so forgiving.  IPython also maintains a command history and
allows command editing.
### Simple scripting
You can write very simple scripts, for example `test.py` is

```python
T = puma.fkine(puma.qn)
sol = puma.ikine_LM(T)
sol.q
puma.plot(sol.q);
```

then 

```shell
$ rvctool test.py
   0         0         1         0.5963    
   0         1         0        -0.1501    
  -1         0         0         0.6575    
   0         0         0         1         

IKSolution(q=array([7.235e-08,  -0.8335,  0.09396,    3.142,   0.8312,   -3.142]), success=True, iterations=15, searches=1, residual=1.406125546650288e-07, reason='Success')
array([7.235e-08,  -0.8335,  0.09396,    3.142,   0.8312,   -3.142])
PyPlot3D backend, t = 0.05, scene:
  robot: Text(0.0, 0.0, 'Puma 560')
>>>
```
and you are dropped into an IPython session after the script has run.

## Issues running on Apple Silicon

Check out the [wiki page](https://github.com/petercorke/RVC3-python/wiki/Running-on-Apple-Silicon).

## Using Jupyter and Colab

Graphics and animations are problematic in these environments, some things work
well, some don't.  As much as possible I've tweaked the Jupyter notebooks to work
as best they can in these environments.

For local use the [Jupyter plugin for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) is pretty decent.  Colab suffers
from old versions of major packages (though they are getting better at keeping up to date)
and animations can suffer from slow update over the network.
## Other command line tools

Additional command line tools available (from the Robotics Toolbox) include:
- `eigdemo`, animation showing linear transformation of a rotating unit vector
  which demonstrates eigenvalues and eigenvectors.
- `tripleangledemo`, Swift visualization that lets you experiment with various triple-angle sequences.
- `twistdemo`, Swift visualization that lets you experiment with 3D twists. The screw axis is the blue rod and you can
   position and orient it using the sliders, and adjust its pitch. Then apply a rotation
   about the screw using the bottom slider.
# Block diagram models

<a href="https://github.com/petercorke/bdsim"><img
src="https://github.com/petercorke/bdsim/raw/master/figs/BDSimLogo_NoBackgnd%402x.png"
alt="bdsim logo" width="300"></a>

Block diagram models are key to the pedagogy of the RVC3 book and 25 models are
included. To simulate these models we use the Python package
[bdsim](https://github.com/petercorke/bdsim) which can run models:

- written in Python using
  [bdsim](https://github.com/petercorke/bdsim#getting-started) blocks and
  wiring.
- created graphically using
  [bdedit](https://github.com/petercorke/bdsim#bdedit-the-graphical-editing-tool)
  and saved as a `.bd` (JSON format) file.

The models are included in the `RVC3` package when it is installed and `rvctool`
adds them to the module search path.  This means you can invoke them from
`rvctool` by
```python
>>> %run -m vloop_test
```

If you want to directly access the folder containing the models, the command
line tool
```shell
bdsim_path
```
will display the full path to where they have been installed in the Python
package tree.


# Additional book resources

<img src="https://github.com/petercorke/RVC3-python/raw/main/doc/frontcover.png" alt="Front cover 978-3-031-06468-5_5208" width="100">

This GitHub repo provides additional resources for readers including:
- Jupyter notebooks containing all code lines from each chapter, see
  the [`notebooks`](notebooks) folder
- The code to produce every Python/Matplotlib (2D) figure in the book, see the [`figures`](figures) folder
- 3D points clouds from chapter 14, and the code to create them, see
  the [`pointclouds`](../pointclouds) folder.
- 3D figures from chapters 2-3, 7-9, and the code to create them, see the [`3dfigures`](../3dfigures) folder.
- All example scripts, see the [`examples`](examples) folder.
- To run the visual odometry example in Sect. 14.8.3 you need to download two image sequence, each over 100MB, [see the instructions here](https://github.com/petercorke/machinevision-toolbox-python/blob/master/mvtb-data/README.md#install-big-image-files). 

To get that material you must clone the repo
```shell
git clone https://github.com/petercorke/RVC3-python.git
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rvc3python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "robotics, robot, manipulator, robot arm, mobile robot, mobile manipulation, path planning, SLAM, pose graph, Dubins, Reeds-Shepp, lattice planner, RRT, PRM, rapidly exploring random tree, probabilistic roadmap planner, force control, kinematics, Jacobian, position control, velocity control, spatial math, SO(2), SE(2), SO(3), SE(3), twist, product of exponential, translation, orientation, angle-axis, Lie group, skew symmetric matrix, pose, translation, rotation matrix, rigid body transform, homogeneous transformation, Euler angles, roll-pitch-yaw angles, quaternion, unit-quaternion, computer vision, machine vision, robotic vision, color space, blackbody, image segmentation, blobs, Hough transform, k-means, homography, camera calibration, visual odometry, bundle adjustment, stereo vision, rectification",
    "author": null,
    "author_email": "Peter Corke <rvc@petercorke.com>",
    "download_url": "https://files.pythonhosted.org/packages/77/5a/20953c89f912362fcf90b19c85894ffe8f4240e8eb53ca8a6f2bef3b5cf8/rvc3python-0.9.2.tar.gz",
    "platform": null,
    "description": "# Robotics, Vision & Control: 3rd edition in Python (2023)\n[![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/master/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python)\n[![QUT Centre for Robotics Open Source](https://github.com/qcr/qcr.github.io/raw/master/misc/badge.svg)](https://qcr.github.io)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n[![PyPI version](https://badge.fury.io/py/rvc3python.svg)](https://badge.fury.io/py/rvc3python)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rvc3python.svg)\n[![PyPI - Downloads](https://img.shields.io/pypi/dw/rvc3python)](https://pypistats.org/packages/rvc3python)\n\n<table style=\"border:0px\">\n<tr style=\"border:0px\">\n<td style=\"border:0px\">\n<img src=\"https://github.com/petercorke/RVC3-python/raw/main/doc/frontcover.png\" alt=\"Front cover 978-3-031-06468-5_5208\" width=\"300\">\n</td>\n<td style=\"border:0px\">\nWelcome to the online hub for the book:\n<ul type=\"none\">\n<li><b>Robotics, Vision & Control</b>: fundamental algorithms in Python (3rd edition) \n<li>Peter Corke, published by Springer-Nature 2023.</li>\n<li><b>ISBN</b> 978-3-031-06468-5 (hardcopy), 978-3-031-06469-2 (eBook)</li>\n<li><b>DOI</b> <a href=\"https://doi.org/10.1007/978-3-031-06469-2\">10.1007/978-3-031-06469-2</a></li>\n</ul>\n<br><br>\n<p>Report an issue with the book or its supporting code <a href=\"https://github.com/petercorke/RVC3-python/issues/new/choose\">here</a>.</p>\n\n<p>Known errata for the book can be viewed <a href=\"https://github.com/petercorke/RVC3-python/wiki/Errata\">here</a>.</p>\n</td>\n</tr>\n</table>\n\n\nThis book uses many examples based on the following open-source Python packages\n\n<a href=\"https://github.com/petercorke/robotics-toolbox-python\"><img alt=\"Robotics Toolbox for Python\" src=\"https://github.com/petercorke/robotics-toolbox-python/raw/master/docs/figs/RobToolBox_RoundLogoB.png\" width=\"130\"></a>\n<a href=\"https://github.com/petercorke/machinevision-toolbox-python\"><img alt=\"Machine Vision Toolbox for Python\" src=\"https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/VisionToolboxLogo_NoBackgnd@2x.png\" width=\"150\"></a>\n<a href=\"https://github.com/petercorke/spatialmath-python\"><img alt=\"Spatial Maths Toolbox for Python\" src=\"https://github.com/petercorke/spatialmath-python/raw/master/docs/figs/CartesianSnakes_LogoW.png\" width=\"130\"></a>\n<a href=\"https://github.com/petercorke/bdsim\"><img alt=\"Block diagram simulation for Python\" src=\"https://github.com/petercorke/bdsim/raw/master/figs/BDSimLogo_NoBackgnd@2x.png\" width=\"250\"></a>\n\n**Robotics Toolbox for Python**, **Machine Vision Toolbox for Python**, **Spatial Maths Toolbox for Python**, **Block Diagram Simulation for Python**.  These in turn have dependencies on other packages created by the author and\nthird parties.\n\n## Installing the package\n\nThis package provides a simple one-step installation of *all* the required Toolboxes\n```shell\npip install rvc3python\n```\nor\n```shell\nconda install rvc3python\n```\n\nThere are a lot of dependencies and this might take a minute or so.  You now have a very\npowerful computing environment for robotics and computer vision.\n\n### Python version\n\nGiven the rapid rate of language additions, particularly around type hinting, use at\nleast Python 3.8.  Python 3.7 goes end of life in June 2023.\n\nNot all package dependencies will work with the latest release of Python.  In particular, check:\n* [PyTorch](https://pypi.org/project/torch/) used for segmentation examples in Chapter 12\n* [Open3D](https://pypi.org/project/open3d), used for point cloud examples in Chapter 14.\n\n### Installing into a Conda environment\n\nIt's probably a good idea to create a virtual environment to keep this package\nand its dependencies separated from your other Python code and projects.  If you've\nnever used virtual environments before this might be a good time to start, and it\nis really easy [using Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html):\n```shell\nconda create -n RVC3 python=3.10\nconda activate RVC3\npip install rvc3python\n```\n\n### Installing deep learning tools\n\nChapter 11 has some deep learning examples based on PyTorch.  If you don't have \nPyTorch installed you can use the `pytorch` install option\n```shell\npip install rvc3python[pytorch]\n```\nor\n```shell\nconda install rvc3python\n```\n## Using the Toolboxes\n\nThe simplest way to get going is to use the command line tool\n\n```shell\n$ rvctool\n ____       _           _   _             __     ___     _                ___      ____            _             _   _____ \n|  _ \\ ___ | |__   ___ | |_(_) ___ ___    \\ \\   / (_)___(_) ___  _ __    ( _ )    / ___|___  _ __ | |_ _ __ ___ | | |___ / \n| |_) / _ \\| '_ \\ / _ \\| __| |/ __/ __|    \\ \\ / /| / __| |/ _ \\| '_ \\   / _ \\/\\ | |   / _ \\| '_ \\| __| '__/ _ \\| |   |_ \\ \n|  _ < (_) | |_) | (_) | |_| | (__\\__ \\_    \\ V / | \\__ \\ | (_) | | | | | (_>  < | |__| (_) | | | | |_| | | (_) | |  ___) |\n|_| \\_\\___/|_.__/ \\___/ \\__|_|\\___|___( )    \\_/  |_|___/_|\\___/|_| |_|  \\___/\\/  \\____\\___/|_| |_|\\__|_|  \\___/|_| |____/ \n                                      |/                                                                                   \n                                                                                 \nfor Python (RTB==1.1.0, MVTB==0.9.5, SG==1.1.7, SMTB==1.1.7, NumPy==1.24.2, SciPy==1.10.1, Matplotlib==3.7.1)\n\n    import math\n    import numpy as np\n    from scipy import linalg, optimize\n    import matplotlib.pyplot as plt\n    from spatialmath import *\n    from spatialmath.base import *\n    from spatialmath.base import sym\n    from spatialgeometry import *\n    from roboticstoolbox import *\n    from machinevisiontoolbox import *\n    import machinevisiontoolbox.base as mvb\n    \n    # useful variables\n    from math import pi\n    puma = models.DH.Puma560()\n    panda = models.DH.Panda()\n\n    func/object?       - show brief help\n    help(func/object)  - show detailed help\n    func/object??      - show source code\n\nResults of assignments will be displayed, use trailing ; to suppress\n    \nPython 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:24:27) [Clang 14.0.6 ]\nType 'copyright', 'credits' or 'license' for more information\nIPython 8.11.0 -- An enhanced Interactive Python. Type '?' for help.\n\n\n>>> \n```\n\nThis provides an interactive Python\n([IPython](https://ipython.readthedocs.io/en/stable)) session with all the Toolboxes and\nsupporting packages imported, and ready to go.  It's a highly capable, convenient, and\n\"MATLAB-like\" workbench environment for robotics and computer vision.\n\nFor example to load an ETS model of a Panda robot, solve a forward kinematics\nand inverse kinematics problem, and an interactive graphical display is simply:\n\n```python\n>>> panda = models.ETS.Panda()\nERobot: Panda (by Franka Emika), 7 joints (RRRRRRR)\n\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502link \u2502 link  \u2502 joint \u2502 parent \u2502             ETS: parent to link             \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502   0 \u2502 link0 \u2502     0 \u2502 BASE   \u2502 tz(0.333) \u2295 Rz(q0)                          \u2502\n\u2502   1 \u2502 link1 \u2502     1 \u2502 link0  \u2502 Rx(-90\u00b0) \u2295 Rz(q1)                           \u2502\n\u2502   2 \u2502 link2 \u2502     2 \u2502 link1  \u2502 Rx(90\u00b0) \u2295 tz(0.316) \u2295 Rz(q2)                \u2502\n\u2502   3 \u2502 link3 \u2502     3 \u2502 link2  \u2502 tx(0.0825) \u2295 Rx(90\u00b0) \u2295 Rz(q3)               \u2502\n\u2502   4 \u2502 link4 \u2502     4 \u2502 link3  \u2502 tx(-0.0825) \u2295 Rx(-90\u00b0) \u2295 tz(0.384) \u2295 Rz(q4) \u2502\n\u2502   5 \u2502 link5 \u2502     5 \u2502 link4  \u2502 Rx(90\u00b0) \u2295 Rz(q5)                            \u2502\n\u2502   6 \u2502 link6 \u2502     6 \u2502 link5  \u2502 tx(0.088) \u2295 Rx(90\u00b0) \u2295 tz(0.107) \u2295 Rz(q6)    \u2502\n\u2502   7 \u2502 @ee   \u2502       \u2502 link6  \u2502 tz(0.103) \u2295 Rz(-45\u00b0)                        \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502name \u2502 q0  \u2502 q1     \u2502 q2  \u2502 q3    \u2502 q4  \u2502 q5    \u2502 q6   \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502  qr \u2502  0\u00b0 \u2502 -17.2\u00b0 \u2502  0\u00b0 \u2502 -126\u00b0 \u2502  0\u00b0 \u2502  115\u00b0 \u2502  45\u00b0 \u2502\n\u2502  qz \u2502  0\u00b0 \u2502  0\u00b0    \u2502  0\u00b0 \u2502  0\u00b0   \u2502  0\u00b0 \u2502  0\u00b0   \u2502  0\u00b0  \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n>>> panda.fkine(panda.qz)\n   0.7071    0.7071    0         0.088     \n   0.7071   -0.7071    0         0         \n   0         0        -1         0.823     \n   0         0         0         1      \n>>> panda.ikine_LM(SE3.Trans(0.4, 0.5, 0.2) * SE3.Ry(pi/2))\nIKSolution(q=array([  -1.849,   -2.576,   -2.914,     1.22,   -1.587,    2.056,   -1.013]), success=True, iterations=13, searches=1, residual=3.3549072615799585e-10, reason='Success')\n>>> panda.teach(panda.qz)\n```\n![](https://github.com/petercorke/RVC3-python/raw/main/doc/panda_noodle.png)\n\nComputer vision is just as easy.  For example, we can import an image, blur it\nand display it alongside the original\n```python\n>>> mona = Image.Read(\"monalisa.png\")\n>>> Image.Hstack([mona, mona.smooth(sigma=5)]).disp()\n```\n![](https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/mona%2Bsmooth.png)\n\nor load two images of the same scene, compute SIFT features and display putative\nmatches\n```python\n>>> sf1 = Image.Read(\"eiffel-1.png\", mono=True).SIFT()\n>>> sf2 = Image.Read(\"eiffel-2.png\", mono=True).SIFT()\n>>> matches = sf1.match(sf2)\n>>> matches.subset(100).plot(\"w\")\n```\n![](https://github.com/petercorke/machinevision-toolbox-python/raw/master/figs/matching.png)\n\n`rvctool` is a wrapper around\n[IPython](https://ipython.readthedocs.io/en/stable) where:\n- robotics and vision functions and classes can be accessed without needing\n  package prefixes\n- results are displayed by default like MATLAB does, and like MATLAB you need to\n  put a semicolon on the end of the line to prevent this\n- the prompt is the standard Python REPL prompt `>>>` rather than the IPython\n  prompt, this can be overridden by a command-line switch\n- allows cutting and pasting in lines from the book, and prompt characters are\n  ignored\n\nThe Robotics, Vision & Control book uses `rvctool` for all the included\nexamples.\n\n`rvctool` imports the all the above mentioned packages using `import *` which is\nnot considered best Python practice.  It is very convenient for interactive\nexperimentation, but in your own code you can handle the imports as you see\nfit.\n\n### Cutting and pasting\n\nIPython is very forgiving when it comes to cutting and pasting in blocks of Python\ncode.  It will strip off the `>>>` prompt character and ignore indentation.  The normal\npython REPL is not so forgiving.  IPython also maintains a command history and\nallows command editing.\n### Simple scripting\nYou can write very simple scripts, for example `test.py` is\n\n```python\nT = puma.fkine(puma.qn)\nsol = puma.ikine_LM(T)\nsol.q\npuma.plot(sol.q);\n```\n\nthen \n\n```shell\n$ rvctool test.py\n   0         0         1         0.5963    \n   0         1         0        -0.1501    \n  -1         0         0         0.6575    \n   0         0         0         1         \n\nIKSolution(q=array([7.235e-08,  -0.8335,  0.09396,    3.142,   0.8312,   -3.142]), success=True, iterations=15, searches=1, residual=1.406125546650288e-07, reason='Success')\narray([7.235e-08,  -0.8335,  0.09396,    3.142,   0.8312,   -3.142])\nPyPlot3D backend, t = 0.05, scene:\n  robot: Text(0.0, 0.0, 'Puma 560')\n>>>\n```\nand you are dropped into an IPython session after the script has run.\n\n## Issues running on Apple Silicon\n\nCheck out the [wiki page](https://github.com/petercorke/RVC3-python/wiki/Running-on-Apple-Silicon).\n\n## Using Jupyter and Colab\n\nGraphics and animations are problematic in these environments, some things work\nwell, some don't.  As much as possible I've tweaked the Jupyter notebooks to work\nas best they can in these environments.\n\nFor local use the [Jupyter plugin for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter) is pretty decent.  Colab suffers\nfrom old versions of major packages (though they are getting better at keeping up to date)\nand animations can suffer from slow update over the network.\n## Other command line tools\n\nAdditional command line tools available (from the Robotics Toolbox) include:\n- `eigdemo`, animation showing linear transformation of a rotating unit vector\n  which demonstrates eigenvalues and eigenvectors.\n- `tripleangledemo`, Swift visualization that lets you experiment with various triple-angle sequences.\n- `twistdemo`, Swift visualization that lets you experiment with 3D twists. The screw axis is the blue rod and you can\n   position and orient it using the sliders, and adjust its pitch. Then apply a rotation\n   about the screw using the bottom slider.\n# Block diagram models\n\n<a href=\"https://github.com/petercorke/bdsim\"><img\nsrc=\"https://github.com/petercorke/bdsim/raw/master/figs/BDSimLogo_NoBackgnd%402x.png\"\nalt=\"bdsim logo\" width=\"300\"></a>\n\nBlock diagram models are key to the pedagogy of the RVC3 book and 25 models are\nincluded. To simulate these models we use the Python package\n[bdsim](https://github.com/petercorke/bdsim) which can run models:\n\n- written in Python using\n  [bdsim](https://github.com/petercorke/bdsim#getting-started) blocks and\n  wiring.\n- created graphically using\n  [bdedit](https://github.com/petercorke/bdsim#bdedit-the-graphical-editing-tool)\n  and saved as a `.bd` (JSON format) file.\n\nThe models are included in the `RVC3` package when it is installed and `rvctool`\nadds them to the module search path.  This means you can invoke them from\n`rvctool` by\n```python\n>>> %run -m vloop_test\n```\n\nIf you want to directly access the folder containing the models, the command\nline tool\n```shell\nbdsim_path\n```\nwill display the full path to where they have been installed in the Python\npackage tree.\n\n\n# Additional book resources\n\n<img src=\"https://github.com/petercorke/RVC3-python/raw/main/doc/frontcover.png\" alt=\"Front cover 978-3-031-06468-5_5208\" width=\"100\">\n\nThis GitHub repo provides additional resources for readers including:\n- Jupyter notebooks containing all code lines from each chapter, see\n  the [`notebooks`](notebooks) folder\n- The code to produce every Python/Matplotlib (2D) figure in the book, see the [`figures`](figures) folder\n- 3D points clouds from chapter 14, and the code to create them, see\n  the [`pointclouds`](../pointclouds) folder.\n- 3D figures from chapters 2-3, 7-9, and the code to create them, see the [`3dfigures`](../3dfigures) folder.\n- All example scripts, see the [`examples`](examples) folder.\n- To run the visual odometry example in Sect. 14.8.3 you need to download two image sequence, each over 100MB, [see the instructions here](https://github.com/petercorke/machinevision-toolbox-python/blob/master/mvtb-data/README.md#install-big-image-files). \n\nTo get that material you must clone the repo\n```shell\ngit clone https://github.com/petercorke/RVC3-python.git\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Support for book: Robotics, Vision & Control 3 in Python",
    "version": "0.9.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/petercorke/RVC3-python/issues",
        "Homepage": "https://github.com/petercorke/RVC3-python",
        "Source": "https://github.com/petercorke/RVC3-python"
    },
    "split_keywords": [
        "robotics",
        " robot",
        " manipulator",
        " robot arm",
        " mobile robot",
        " mobile manipulation",
        " path planning",
        " slam",
        " pose graph",
        " dubins",
        " reeds-shepp",
        " lattice planner",
        " rrt",
        " prm",
        " rapidly exploring random tree",
        " probabilistic roadmap planner",
        " force control",
        " kinematics",
        " jacobian",
        " position control",
        " velocity control",
        " spatial math",
        " so(2)",
        " se(2)",
        " so(3)",
        " se(3)",
        " twist",
        " product of exponential",
        " translation",
        " orientation",
        " angle-axis",
        " lie group",
        " skew symmetric matrix",
        " pose",
        " translation",
        " rotation matrix",
        " rigid body transform",
        " homogeneous transformation",
        " euler angles",
        " roll-pitch-yaw angles",
        " quaternion",
        " unit-quaternion",
        " computer vision",
        " machine vision",
        " robotic vision",
        " color space",
        " blackbody",
        " image segmentation",
        " blobs",
        " hough transform",
        " k-means",
        " homography",
        " camera calibration",
        " visual odometry",
        " bundle adjustment",
        " stereo vision",
        " rectification"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "104b7005861ef9db443dea000c23239877292a927f28de174a4fbac5b0a5dc27",
                "md5": "90f7a2ca2e26036927b61e342ea07964",
                "sha256": "ff080fb4eac5d641ccbba178d6ff36510646ee786109cb519bd0f537742b0588"
            },
            "downloads": -1,
            "filename": "rvc3python-0.9.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "90f7a2ca2e26036927b61e342ea07964",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 174071,
            "upload_time": "2024-08-06T02:36:46",
            "upload_time_iso_8601": "2024-08-06T02:36:46.596411Z",
            "url": "https://files.pythonhosted.org/packages/10/4b/7005861ef9db443dea000c23239877292a927f28de174a4fbac5b0a5dc27/rvc3python-0.9.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "775a20953c89f912362fcf90b19c85894ffe8f4240e8eb53ca8a6f2bef3b5cf8",
                "md5": "f4b3280952058ade5d96d8611e6f88a2",
                "sha256": "8901fc0f52181311e9875ea3f940c18899f49ea1946aca8c2be05481db56cac0"
            },
            "downloads": -1,
            "filename": "rvc3python-0.9.2.tar.gz",
            "has_sig": false,
            "md5_digest": "f4b3280952058ade5d96d8611e6f88a2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 154332,
            "upload_time": "2024-08-06T02:36:49",
            "upload_time_iso_8601": "2024-08-06T02:36:49.306884Z",
            "url": "https://files.pythonhosted.org/packages/77/5a/20953c89f912362fcf90b19c85894ffe8f4240e8eb53ca8a6f2bef3b5cf8/rvc3python-0.9.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-06 02:36:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "petercorke",
    "github_project": "RVC3-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "rvc3python"
}
        
Elapsed time: 0.51787s