abr / abr_control

Robotic arm control in Python
Other
417 stars 99 forks source link

AttributeError: 'MjViewer' object has no attribute 'exit' #102

Closed JackTony123 closed 1 year ago

JackTony123 commented 2 years ago

Hello everyone, I met a problem recently when I run the bar control example of jaco2 for Mujoco platform. When I run the program "position_joint_control.py", all my environment variables and configuration are right. Howver, on Pycharm, the terminal shows the problem as below:

To download mujoco stl files, you need to "pip install requests"
Creating window glfw
MuJoCo session created

Simulation starting...

Traceback (most recent call last):
  File "/home/shine/abr_control/docs/examples/Mujoco/position_joint_control.py", line 43, in <module>
    if interface.viewer.exit:
AttributeError: 'MjViewer' object has no attribute 'exit'

MuJoCO session closed...
Simulation terminated...

The simulation windows seems crash out and I didn't see anything on that. Does anyone meet the same problem? Thanks!

Additionally, I see someone came up with the same question a few years ago, I followed the suggestions but it seems doesn't work for current Mujoco or mujoco-py. That makes me feel confused.

p3jawors commented 2 years ago

Hi,

I presume you are referring to #99 . This problem comes from installing the wrong version of mujoco-py. The solution to issue 2 should resolve this. Copying here for completeness..

"This is because we have created a fork of mujoco to add a conditional exit. If you follow our steps for installing mujoco here you'll have the function that's missing."

Cheers,

Pawel