robotlearn / pyrobolearn

PyRoboLearn: a Python framework for Robot Learning
Apache License 2.0
400 stars 62 forks source link

Error in force control task #40

Closed deepakraina99 closed 4 years ago

deepakraina99 commented 4 years ago

When I run Force_control_example.py, robot initially runs for few iterations, while showing end-effector forces plot. After some time, robot stops, a new black window appears and terminal shows following error:

-3.9336459877590596e-05
-1.80323431312297e-05
5.969657570434706e-06
2.6458507806909837e-05
4.270999884258811e-05
5.0823149630967465e-05
5.153522232988297e-05
4.396127642365691e-05
3.070630143922923e-05
1.3182937457178667e-05
-5.113344854462901e-06
-2.2079177359950246e-05
-3.482887550450532e-05
WARNING: QApplication was not created in the main() thread.
Exception in thread manipulator task:
Traceback (most recent call last):
  File "/home/deepakraina/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/home/deepakraina/anaconda3/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "force_control/Force_control_example.py", line 191, in manipulator_thread
    plt.show()
  File "/home/deepakraina/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py", line 269, in show
    return _show(*args, **kw)
  File "/home/deepakraina/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 413, in wrapper
    return func(*args, **kwargs)
  File "/home/deepakraina/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 3302, in show
    cls.mainloop()
  File "/home/deepakraina/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_qt5.py", line 1094, in mainloop
    signal.signal(signal.SIGINT, signal.SIG_DFL)
  File "/home/deepakraina/anaconda3/lib/python3.7/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

Please help with this. Thanks

TFLQW commented 4 years ago

@deepakraina99 hello, which system are you using, Windows or Ubuntu, I run this code on Ubuntu 18.04 is working !

deepakraina99 commented 4 years ago

@TFLQW I am running on Ubuntu 18.04.

TFLQW commented 4 years ago

@deepakraina99 Maybe I guess this link https://github.com/matplotlib/matplotlib/issues/13296 could solve your problem

deepakraina99 commented 4 years ago

@TFLQW Thanks it solved the issue.