question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pyplot not plotting DH robot

See original GitHub issue

Check here first Common issues

Describe the bug The pyplot in inline mode (spyder or jupyter notebook) of DH robot do not show the robot, I think that is the last update of some dependency.

Version information

Did you install from PyPI or GitHub? I install the last version with pip

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

import matplotlib.pyplot as plt
import roboticstoolbox as rtb
%matplotlib inline  
puma = rtb.models.DH.Puma560()
puma.q=puma.qz
puma.plot(puma.qz, block=False)

generate a 3dplot without the robot draw

Expected behavior See the robot like happen if the back is qt5 or before the error.

Screenshots

Environment (please complete the following information):

  • WINDOWS
  • Python 3.8.5.
  • anaconda

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
rag-hcommented, Oct 24, 2021

I was going through this tutorial and I managed to plot the puma robot in cell 4. Looking at why in a little bit more detail, i found that the %matplotlib notbook, was the only major difference.

Adding that line into the top of my notebook after my imports made it so that the models all appeared.

Without the line: image

With the line: image

1reaction
core-engineeringcommented, Feb 25, 2022

Hi,

A workaround for me is to use %matplotlib widgets in jupyterLab and in vscode

Camille

Read more comments on GitHub >

github_iconTop Results From Across the Web

How could one plot rtb.models.DH.plot and spatialmath.base ...
Plots not easily superposed here... can use plt.ion(), but I notice that when the coordinates are loaded, the robot shrinks. Continue to display ......
Read more >
PyPlot (matplotlib) — Robotics Toolbox for Python ...
PyPlot is the default backend, and robot. plot(q) effectively performs lines 7-8 above. `env = launch()` creates a blank 3D matplotlib figure and...
Read more >
Why matplotlib does not plot? - Stack Overflow
If I write these 3 lines into my python file and execute it in the command line (by typing python file_name.py ), nothing...
Read more >
Robotics Toolbox for Python - YouTube
Peter Corke and Jesse Haviland introduce the Robotics Toolbox for Python and the Swift browser-based graphical simulator.
Read more >
How to Assign Denavit-Hartenberg Frames to Robotic Arms
The D-H frames of a particular robotic arm can be classified as follows: ... The x-axis must intersect the previous z-axis (rule does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found