Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases #428

Open
3 of 4 tasks
psh9002 opened this issue Aug 9, 2022 · 6 comments

Comments

@psh9002
Copy link

psh9002 commented Aug 9, 2022

Description:

There is a TypeError when I type 'python panda_pick_and_place.py'.
I tried both Stable and Nightly.

Steps to reproduce

  1. Install Ignition Gazebo (Fortress) from source https://gazebosim.org/docs/fortress/install_ubuntu_src
  2. Install gym-ignition from https://robotology.github.io/gym-ignition/master/installation/nightly.html

Additional context

TypeError
TypeError_anaconda

Traceback (most recent call last):
  File "panda_pick_and_place.py", line 7, in <module>
    import gym_ignition_environments
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition_environments/__init__.py", line 8, in <module>
    from . import models, randomizers, tasks
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition_environments/randomizers/__init__.py", line 5, in <module>
    from . import cartpole, cartpole_no_rand
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition_environments/randomizers/cartpole.py", line 8, in <module>
    from gym_ignition import randomizers, utils
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition/randomizers/__init__.py", line 5, in <module>
    from . import abc, gazebo_env_randomizer, model, physics
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition/randomizers/abc.py", line 7, in <module>
    import gym_ignition.base.task
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition/base/__init__.py", line 6, in <module>
    from . import runtime, task
  File "/home/bak/venv/lib/python3.8/site-packages/gym_ignition/base/runtime.py", line 11, in <module>
    class Runtime(gym.Env, abc.ABC):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Environment

  • OS: Ubuntu 20.04
  • GPU: Nvidia GeForce 1080
  • Python: 3.8.10 from 'virtualenv' and 3.9.13 from 'anaconda'
  • Version: Nightly
  • Channel:
    • Stable
    • Nightly
  • Installation type:
    • User
    • Developer
@psh9002
Copy link
Author

psh9002 commented Aug 10, 2022

I fix the problem by modifying runtime.py and gazebo_env_randomizer.py.

In runtime.py, I changed
class Runtime(gym.Env, abc.ABC): to class Runtime(gym.Env, abc.ABCMeta): and, added @abc.abstractmethod above def timestamp(self) -> float:.

In gazebo_env_randomizer.py, I added
class GazeboEnvRandomizer_Meta(type(gym.Wrapper), type(TaskRandomizer)): pass
and changed
class GazeboEnvRandomizer(gym.Wrapper, TaskRandomizer, abc.ABC): to
class GazeboEnvRandomizer(gym.Wrapper, TaskRandomizer, metaclass=GazeboEnvRandomizer_Meta):

@psh9002
Copy link
Author

psh9002 commented Aug 10, 2022

However, there is another issue.

[Err] [Conversions.cc:1757] Tried to convert SDF [world] into [plugin]
[Err] [Joint.cpp:756] The active joint control mode does not accept a velocity target
[Err] [Model.cpp:1259] Failed to set force of joint 'panda_joint1'
Traceback (most recent call last):
  File "/home/bak/Projects/ignition-robot/examples/manipulation.py", line 268, in <module>
    add_panda_controller(panda=panda, controller_period=gazebo.step_size())
  File "/home/bak/Projects/ignition-robot/examples/manipulation.py", line 52, in add_panda_controller
    assert panda.set_joint_velocity_targets(panda.joint_velocities())
AssertionError

Gazebo Gui window was opened but, there is only empty space. It is also the same on the pendulum example at ScenarIO.

empty_gui

@giu950
Copy link

giu950 commented Feb 9, 2023

Hello @psh9002,
I'm having the same issue, do you have any tips to solve it?

@psh9002
Copy link
Author

psh9002 commented Feb 21, 2023

Hello @giu950 ,
Unfortunately no. Now, I'm not using Gazebo

@DanielePucci
Copy link

CC @diegoferigo

@diegoferigo
Copy link
Collaborator

Hi everyone, thanks for the feedback. I described the current status of the project in #430 in case someone wants to start addressing the major problems affecting the current status of the project.

Unfortunately there have been major changes of our main dependencies (both Ignition Gazebo and OpenAI Gym), and my research focus on the past 2 years shifted towards solutions providing parallelization on hardware accelerators like GPUs and TPUs. I'm not sure if there is anyone in AMI interested in the short term to pick up what's left, for sure in the close future I don't think I will find enough bandwidth for a proper upstream alignment, but I'd be happy to provide all the needed support and guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants