Closed BartlomiejKulecki closed 3 years ago
Which version of the toolbox and Swift are you ruunning? Are you installed off PyPI or from Github? Whats your Python version? Any error messages in your terminal or browser console? (Open browser console with control+shift+i)
I just reinstalled toolbox with the commands:
pip3 uninstall roboticstoolbox-python
pip3 install git+https://github.com/petercorke/robotics-toolbox-python
Python version 3.7 In terminal no errors. In browser console there is one error:
@jhavl I could reproduce the issue with latest commit 448247e in master branch here, and latest commit f2c8b98 in your swift repo. (UPDATE its not about source code. its the browser caching old version of swift javascript code causing function code mismatch. Clear the browser cache does the job!)
I tried to identify which section causing the issue and found
self.process_events()
==>events = self._send_socket('check_elements')
==> return self.inq.get()
is blocking.
If I comment out this line 158. The robot moves as expected. https://github.com/petercorke/robotics-toolbox-python/blob/448247e40e0b1225b77de70b8a6cf1f299c8a5b9/roboticstoolbox/backends/Swift/Swift.py#L158 https://github.com/petercorke/robotics-toolbox-python/blob/448247e40e0b1225b77de70b8a6cf1f299c8a5b9/roboticstoolbox/backends/Swift/Swift.py#L502
It seems the queue.get is blocking by default and waits forever until an item arrives. I can see that the communication between swift backend and the python script is heavily depends on the in/out queues. I can't simply fix this buy adding a little timeout or make it non-blocking.
----- UPDATE -----
Finally! I found that it is google chrome caching the old index.js of swift-sim after inspecting the js code in google chrome and compare with swift-sim latest commit.
steps for google chrome users:
chrome://settings/clearBrowserData
in address bar@jhavl BTW thanks for bringing the swift-sim.
@mfkenson thanks for this, browser cache is a common issue I run into. Setting no-cache is probably the best solution at least while Swift is under rapid development. I also added some basic troubleshooting tips to the common issues wiki page.
Issue When I run the test code from the tutorial (attached in the end), the 'pyplot' version works fine. But I run into the same problem as in the original issue:
@BartlomiejKulecki the browser window opens, the robot renders correctly but it doesn't move.
I have tried clearing the cache in the browser and using firefox, but the issue persists. Would greatly appreciate any tips on how I can further investigate this.
My environment OS = Ubuntu 18.04 Browser = Chrome Packages versions in pip list:
Code that I ran
import roboticstoolbox as rtb
robot = rtb.models.Panda()
print(robot)
Te = robot.fkine(robot.qr) # forward kinematics
print(Te)
from spatialmath import SE3
Tep = SE3.Trans(0.6, -0.3, 0.1) * SE3.OA([0, 1, 0], [0, 0, -1])
sol = robot.ik_LM(Tep) # solve IK
print(sol)
q_pickup = sol[0]
print(robot.fkine(q_pickup))
qt = rtb.jtraj(robot.qr, q_pickup, 50)
robot.plot(qt.q, backend='pyplot', movie='panda1.gif')
robot.plot(qt.q)
@jhavl
Hello, I am using Robotic Toolbox in Pycharm on Windows 10. When I run this example code:
the browser window opens, the robot renders correctly but it doesn't move.