You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the RandomPath driver and running a robot simulation, a RuntimeError is raised when attempting to update the goal marker position: RuntimeError: x must be a sequence
Version information
Did you install from PyPI or GitHub?
Installed from: PyPI(pip install rvc3python)
Robotics Toolbox version: 1.1.1
Swift: 1.1.0
SpatialMath toolbox: version 1.1.14
Robotics Toolbox depends heavily on two other packages: Swift (3D graphics) and SpatialMath toolbox (underpinning maths utilities). If you think your issue is related to these, then please answer the questions above for them.
(rvc-sim) PS D:\repos\rvc-sim> & d:/repos/rvc-sim/.venv/Scripts/python.exe d:/repos/rvc-sim/temp.py
Traceback (most recent call last):
File "d:\repos\rvc-sim\temp.py", line 9, in <module>
robot.run(T=10);
File "D:\repos\rvc-sim\.venv\lib\site-packages\roboticstoolbox\mobile\Vehicle.py", line 460, in run
self.step(animate=animate)
File "D:\repos\rvc-sim\.venv\lib\site-packages\roboticstoolbox\mobile\Vehicle.py", line 672, in step
u = self.eval_control(self._control, self._x)
File "D:\repos\rvc-sim\.venv\lib\site-packages\roboticstoolbox\mobile\Vehicle.py", line 330, in eval_control
u = control.demand()
File "D:\repos\rvc-sim\.venv\lib\site-packages\roboticstoolbox\mobile\drivers.py", line 233, in demand
self._new_goal()
File "D:\repos\rvc-sim\.venv\lib\site-packages\roboticstoolbox\mobile\drivers.py", line 275, in _new_goal
self._goal_marker.set_xdata(self._goal[0])
File "D:\repos\rvc-sim\.venv\lib\site-packages\matplotlib\lines.py", line 1304, in set_xdata
raise RuntimeError('x must be a sequence')
RuntimeError: x must be a sequence
Expected behavior
The simulation should be started correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Windows
Python 3.10.11
Additional context
The error occurs because matplotlib.lines.Line2D.set_xdata() expects an iterable input (like a list or array), but a scalar value was passed instead.
Temporary fix:
In drivers.py, locate the RandomPath._new_goal() method and change:
Check here first
Common issues
Describe the bug
When using the
RandomPath
driver and running a robot simulation, aRuntimeError
is raised when attempting to update the goal marker position: RuntimeError: x must be a sequenceVersion information
Did you install from PyPI or GitHub?
Robotics Toolbox depends heavily on two other packages: Swift (3D graphics) and SpatialMath toolbox (underpinning maths utilities). If you think your issue is related to these, then please answer the questions above for them.
To Reproduce
Example code:
Output:
Expected behavior
The simulation should be started correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
The error occurs because
matplotlib.lines.Line2D.set_xdata()
expects an iterable input (like a list or array), but a scalar value was passed instead.Temporary fix:
In
drivers.py
, locate theRandomPath._new_goal()
method and change:to:
This ensures compatibility with Matplotlib's plotting interface and avoids the runtime error.
The text was updated successfully, but these errors were encountered: