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

[envs] Maze, sofa prefab error #12

Closed
hunoutl opened this issue Jan 10, 2023 · 3 comments
Closed

[envs] Maze, sofa prefab error #12

hunoutl opened this issue Jan 10, 2023 · 3 comments

Comments

@hunoutl
Copy link
Contributor

hunoutl commented Jan 10, 2023

Maze env outputs an error :

[ERROR]   [SofaRuntime] AttributeError: Unable to find attribute: addNewData
Traceback (most recent call last):
  File "/home/hunoutl/SOFA/SofaGym/sofagym/rpc_client.py", line 174, in <module>
    root = init_simulation(config, _startCmd, mode='simu')
  File "/home/hunoutl/SOFA/SofaGym/sofagym/simulate.py", line 49, in init_simulation
    create_scene(root,  config, mode = mode)
  File "/home/hunoutl/SOFA/SofaGym/sofagym/envs/Maze/MazeScene.py", line 201, in createScene
    tripod = Tripod(scene.Modelling)
  File "/home/hunoutl/SOFA/sofa/build/sofa_gym_v2212/lib/python3/site-packages/splib3/objectmodel/__init__.py", line 47, in __call__
    o = self.cls(*args, **kwargs)
  File "/home/hunoutl/SOFA/SofaGym/sofagym/envs/Maze/MazeScene.py", line 63, in __init__
    arm = ActuatedArm(self.node, name=name,
  File "/home/hunoutl/SOFA/sofa/build/sofa_gym_v2212/lib/python3/site-packages/splib3/objectmodel/__init__.py", line 47, in __call__
    o = self.cls(*args, **kwargs)
  File "/home/hunoutl/SOFA/SofaGym/sofagym/envs/Maze/actuatedarm.py", line 70, in __init__
    self.servomotor = ServoMotor(self.node, translation=translation, rotation=eulerRotation, indice=int(name[-1]))
  File "/home/hunoutl/SOFA/sofa/build/sofa_gym_v2212/lib/python3/site-packages/splib3/objectmodel/__init__.py", line 49, in __call__
    o.node.addNewData("Prefab type", "Infos", "","string", str(o.__class__.__name__))

This comes from sofa prefab obviously when applied to class ServoMotor(SofaObject)

@alxbilger
Copy link
Member

I think addNewData is the old SofaPython2 API, while we now use SofaPython3. Could you try to use addData instead? The doc is here: https://github.com/sofa-framework/SofaPython3/blob/master/bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_Base_doc.h#L125

@hunoutl
Copy link
Contributor Author

hunoutl commented Jan 18, 2023

I think the problem comes from splib like for issue #13. Need investigation

@alxbilger
Copy link
Member

Can you try if SofaDefrost/STLIB#92 fixes the problem?

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

No branches or pull requests

2 participants