robotics-toolbox-python
robotics-toolbox-python copied to clipboard
Outdated pgraph dependency from PyPI
Describe the bug It seems that the current version of the robotics toolbox uses a recent version of the pgraph API, which is not yet released on PyPI. As such, the pgraph dependency that gets installed automatically when pip installing the robotics toolbox is out of date, resulting in errors (see below).
Version information
Did you install from PyPI or GitHub? PyPI: roboticstoolbox-python 1.01
To Reproduce This can be reproduced using the first part of the RRT example script:
from roboticstoolbox import RRTPlanner, PolygonMap, Bicycle
from spatialmath import Polygon2
from math import pi
# create polygonal obstacles
map = PolygonMap(workspace=[0, 10])
map.add([(5, 50), (5, 6), (6, 6), (6, 50)])
map.add([(5, 4), (5, -50), (6, -50), (6, 4)])
# create outline polygon for vehicle
l, w = 3, 1.5
vpolygon = Polygon2(
[(-l / 2, w / 2), (-l / 2, -w / 2), (l / 2, -w / 2), (l / 2, w / 2)]
)
# create vehicle model
vehicle = Bicycle(steer_max=1, L=2, polygon=vpolygon)
# create planner
rrt = RRTPlanner(map=map, vehicle=vehicle, npoints=50, seed=0)
which results in the error message:
Traceback (most recent call last):
File "rrt.py", line 20, in <module>
rrt = RRTPlanner(map=map, vehicle=vehicle, npoints=50, seed=0)
File "/home/adam/.pyenv/versions/3.7.1/lib/python3.7/site-packages/roboticstoolbox/mobile/RRTPlanner.py", line 115, in __init__
self.g = DGraph(metric="SE2")
TypeError: __init__() got an unexpected keyword argument 'metric'
which appears to be because the current PyPI release of pgraph-python (0.6.1) has a different signature for the __init__
method of the PGraph
class (in particular, it does not accept a metric
keyword) than the most recent code on GitHub.
A workaround is of course to just install the latest version of pgraph-python manually from GitHub, rather than using pip/PyPI.
Environment:
- Ubuntu 18.04
- Python 3.7