Giter VIP home page Giter VIP logo

sofa_env's Issues

sofa_env test question

Hi, I met a problem while testing the installation python3 sofa_env/scenes/controllable_object_example/controllable_env.py
And I got out put like this

---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/yhf/sofa/build/install
---------------------------------------
Traceback (most recent call last):
  File "/home/yhf/sofa/sofa_env/sofa_env/scenes/controllable_object_example/controllable_env.py", line 65, in <module>
    env.reset()
  File "/home/yhf/sofa/sofa_env/sofa_env/scenes/controllable_object_example/controllable_env.py", line 53, in reset
    return super().reset(seed)
  File "/home/yhf/sofa/sofa_env/sofa_env/base.py", line 206, in reset
    self._init_sim()
  File "/home/yhf/sofa/sofa_env/sofa_env/base.py", line 229, in _init_sim
    self.sofa = importlib.import_module("Sofa")
  File "/home/yhf/anaconda3/envs/sofa_try/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/yhf/anaconda3/envs/sofa_try/lib/python3.9/site-packages/Sofa/__init__.py", line 140, in <module>
    import Sofa.Helper
ModuleNotFoundError: No module named 'Sofa.Helper'

What should I do to solve this problem? Thank you.

Running test error with "SIG 11 - SIGSEGV: segfault"

Hi, I`m running the test scripts with "python3 sofa_env/scenes/controllable_object_example/controllable_env.py". I can see a red ball and blue soft board. When the red ball slid off the board, the process crashed whit the SIG 11. Here is the whole log:

---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/yangyang/sofa/build/install
---------------------------------------
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Topology.Container.Constant.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.LinearSolver.Iterative.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Topology.Container.Grid.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Constraint.Lagrangian.Solver.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.SolidMechanics.FEM.Elastic.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Mapping.NonLinear.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/plugins/ArticulatedSystemPlugin/lib/libArticulatedSystemPlugin.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Collision.Detection.Intersection.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.LinearSolver.Direct.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Mass.so
[DEPRECATED] [SofaBoundaryCondition] SofaBoundaryCondition is deprecated. It will be removed at v23.06. You may use Sofa.Component.Constraint.Projective and Sofa.Component.MechanicalLoad instead.
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Constraint.Projective.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.MechanicalLoad.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/collections/SofaBoundaryCondition/lib/libSofaBoundaryCondition.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Collision.Detection.Algorithm.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Setting.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.SceneUtility.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.IO.Mesh.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Collision.Response.Contact.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.SolidMechanics.Spring.so
[DEPRECATED] [SofaEngine] SofaEngine is deprecated. It will be removed at v23.06. Use Sofa.Component.Engine.Select instead.
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Engine.Select.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/collections/SofaEngine/lib/libSofaEngine.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.ODESolver.Backward.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.AnimationLoop.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Constraint.Lagrangian.Correction.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Visual.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Constraint.Lagrangian.Model.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Collision.Geometry.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.ODESolver.Forward.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.GL.Component.Rendering3D.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Topology.Mapping.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.GL.Component.Shader.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Mapping.Linear.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.StateContainer.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/sofa/build/install/lib/libSofa.Component.Topology.Container.Dynamic.so
[WARNING] [MechanicalObject(unnamed)] Could not read value for data field showColor: 255 0 255 
[WARNING] [BoxROI(BoxROI)] No rest position yet defined. Box might not work properly. 
This may be caused by an early call of init() on the box before  
the mesh or the MechanicalObject of the node was initialized too
[WARNING] [MeshOBJLoader(unnamed)] Could not read value for data field handleSeams: None
[WARNING] [InteractiveCamera(camera)] Too many missing parameters ; taking default ...
[WARNING] [CGLinearSolver(CGLinearSolver)] denominator threshold reached at first iteration of CG  
Check the 'threshold' data field, you might decrease it

########## SIG 11 - SIGSEGV: segfault ##########
  sofa::helper::BackTrace::sig(int)
  PyErr_Fetch
  on_exit+0
  __libc_start_main
Segmentation fault (core dumped)

Is the "SIG 11 - SIGSEGV : segfault" normal? If not, what`s wrong with this process?
looking forward to your replay, thanks

[ERROR] [SofaPython3] Missing createScene function

Hello author, your work is really great, I would like to learn more about it. But when I run the sofa_env example, I get this error: [ERROR] [SofaPython3] Missing createScene function. Please help me. My system is Ubuntu 20.04, the sofa version is v23.06, and the python version is 3.8. I have no problem running some of the sofa python tutorials. Do you know why this is happening? The information output by the terminal is as follows:

[INFO]    [GUIManager] Registered qglviewer as a GUI.
[INFO]    [GUIManager] Registered qt as a GUI.
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/lib/libSofa.GUI.Qt.so
[DEPRECATED] [SofaValidation] SofaValidation is deprecated. It will be removed at v23.06. For CompareState and CompareTopology, use Sofa.Component.Playback instead.
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/SofaValidation/lib/libSofaValidation.so
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/SceneCreator/lib/libSceneCreator.so
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/CImgPlugin/lib/libCImgPlugin.so
[ERROR]   [PluginManager] Plugin not found: "MeshSTEPLoader"
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/SofaMatrix/lib/libSofaMatrix.so
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/BeamAdapter/lib/libBeamAdapter.so
[INFO]    [PluginManager] 72 plugins have been loaded from /home/znfs4090/SOFA/v23.06.00/lib/plugin_list.conf
[INFO]    [SofaPluginManager] Loading automatically plugin list in /home/znfs4090/SOFA/v23.06.00/config/loadedPlugins.ini
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/STLIB/lib/libSTLIB.so
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/CosseratPlugin/lib/libCosseratPlugin.so
[INFO]    [SofaPython3] Initializing with python version 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0]
[INFO]    [SofaPython3] Registering a scene loader for [.py, .py3, .pyscn, .py3scn] files.
[INFO]    [SofaPython3] Shared library name is 'libpython3.8m.so'
[INFO]    [SofaPython3] Initializing python
[INFO]    [SofaPython3] Added '/home/znfs4090/SOFA/v23.06.00/plugins/SofaPython3/lib/python3/site-packages' to sys.path
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/znfs4090/SOFA/v23.06.00
---------------------------------------
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/SofaPython3/lib/libSofaPython3.so
[INFO]    [PluginManager] Loaded plugin: /home/znfs4090/SOFA/v23.06.00/plugins/SoftRobots/lib/libSoftRobots.so
[INFO]    [SofaPython3] Added '/home/znfs4090/SOFA/v23.06.00/plugins/SoftRobots/lib/python3/site-packages' to sys.path
[INFO]    [PluginManager] 3 plugins have been loaded from /home/znfs4090/SOFA/v23.06.00/config/loadedPlugins.ini

gymnasium successfully imported
[ERROR]   [SofaPython3] Missing createScene function
[INFO]    [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckCollisionResponse, SceneCheckDeprecatedComponents, SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias]
[INFO]    [SceneCheckerVisitor] Finished validating node "root".
[WARNING] [Node(root)] An animation loop is required, but has not been found. Add an animation loop in the root of your scene to fix this warning. The list of available animation loop components is: [ConstraintAnimationLoop, DefaultAnimationLoop, FreeMotionAnimationLoop, MultiStepAnimationLoop, MultiTagAnimationLoop]. A component of type DefaultAnimationLoop will be automatically added for you.
[WARNING] [RealGUI] Global Bounding Box seems very small; Your viewer settings (based on the bbox) are likely invalid, switching to default value of [-1,-1,-1,1,1,1].This is caused by using component which does not implement properly the computeBBox function.You can remove this warning by manually forcing a value in the parameter bbox="minX minY minZ maxX maxY maxZ" in your root node 

Updating gym to gymnasium and cleaning some imports

Hello,

I am working a lot with Sofa in the last few years for my PhD and I have found this repository as @ScheiklP mentioned one code snapshot from it when I was struggling with a grasping simulation. I have to say that this repository is really impressive and I would be really interested to use some of the environments to train some DNN for my PhD and add some extra functionalities along with my work.

However, I came across some problem when trying to install the python package on my computer. I found the error was coming from the Gym package. As I could read at the official repository from OpenAI about Gym, they stopped maintainance on this repository on 2021. The development was moved to Gymnasium and now the recommended form of use is import gymnasium as gym. I think it will be good for new users to have this updated on the main branch. Do you want me to submit a pull request with the necessary changes?

Regards,
Mikel

Error File Repository

hi,
i have been running successfully a simulation in a new environment i have created myself... now that i have changed the meshes involved i am encountering this error though :
[ERROR] [FileRepository] File kidney-3786-0.01.comp NOT FOUND in :C:/Users/franc/anaconda3/envs/sofasource/sofa/src/share:C:/Users/franc/anaconda3/envs/sofasource/sofa/src/examples:C:/Users/franc/anaconda3/envs/sofasource/sofa/build:C:/Users/franc/anaconda3/envs/sofasource/sofa/build

actually this file is not in the right folder, but i have noticed that in C:/Users/franc/anaconda3/envs/sofasource/sofa/src/share there are the others .comp files of the previous meshes, without me having done anything.

how can i solve this problem? thanks in advance for your help

Implement CPU based offscreen rendering

Pyglet supports offscreen rendering through EGL, but PyGame does not.
The combination of RenderFramework.PYGAME and RenderMode.HEADLESS thus currently not work.

For the future, we should fallback to LLVMpipe and OSMesa for this case.

import os
import numpy as np
from PIL import Image
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.raw.osmesa import mesa as osmesa

# Use LLVMpipe for rendering
os.environ['LIBGL_ALWAYS_SOFTWARE'] = '1'
os.environ['GALLIUM_DRIVER'] = 'llvmpipe'

# create a context
ctx = osmesa.OSMesaCreateContextExt(osmesa.OSMESA_RGBA, 32, 0, 0, None)
if not ctx:
    print('Could not create OSMesa context')
    exit(1)

# create a framebuffer
width, height = 640, 480
buffer = np.zeros([height, width, 4], dtype=np.uint8)

# make the context current
if not osmesa.OSMesaMakeCurrent(ctx, buffer, GL_UNSIGNED_BYTE, width, height):
    print('Could not make the OSMesa context current')
    exit(1)

# setup viewport
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(-1, 1, -1, 1, -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

# render a red triangle
glBegin(GL_TRIANGLES)
glColor3f(1, 0, 0)  # Red color
glVertex2f(-0.5, -0.5)
glVertex2f(0.5, -0.5)
glVertex2f(0, 0.5)
glEnd()

# unbind the context before deletion
osmesa.OSMesaMakeCurrent(None, None, GL_UNSIGNED_BYTE, 0, 0)

# clean up
osmesa.OSMesaDestroyContext(ctx)

# flip the buffer vertically (origin is different in OSMesa and PIL)
buffer = np.flipud(buffer)

# convert the buffer to an image and save it
img = Image.fromarray(buffer, 'RGBA')
img.save('output.png')

Texture for deformable objects

Just wanted to know if the png files of wood in the pick and place task could be used for deformable objects. I have tried using it for rigid objects and it worked, but faced issues with deformable objects.

Installation Error: Could not find GLEW (missing: GLEW_LIBRARIES)

Hi,

I had problem installing the sofa_env with cmake code

cmake -Wno-dev \
-S $FOLDER_SRC -B $FOLDER_TARGET \
-DCMAKE_BUILD_TYPE=Release \
-DSOFA_FETCH_SOFAPYTHON3=OFF \
-DPLUGIN_SOFAPYTHON3=ON \
-DPython_EXECUTABLE=$PYTHON_EXE \
-DPython_ROOT_DIR=$PYTHON_ROOT_DIR \
-DSP3_LINK_TO_USER_SITE=ON \
-DSP3_PYTHON_PACKAGES_LINK_DIRECTORY=$PYTHON_PKG_PATH \
-DPLUGIN_SOFACARVING=ON \
-DSP3_BUILD_TEST=OFF \
-DSOFA_BUILD_TESTS=OFF
<font color="#C01C28">  Could NOT find GLEW (missing: GLEW_LIBRARIES) (found version &quot;2.2.0&quot;)</font>
<font color="#C01C28">Call Stack (most recent call first):</font>
<font color="#C01C28">  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)</font>
<font color="#C01C28">  /usr/share/cmake-3.22/Modules/FindGLEW.cmake:215 (find_package_handle_standard_args)</font>
<font color="#C01C28">  Sofa/framework/Config/cmake/SofaMacrosConfigure.cmake:382 (find_package)</font>
<font color="#C01C28">  Sofa/GL/CMakeLists.txt:7 (sofa_find_package)</font>
</pre>```

Do you have any idea how to fix it?

Thank you so much!

Regarding creation of texture objects

Hi,
I followed the how to documents to create obj and msh files, using visual gallbladder of grasp lift touch environment, then I tried to replace the cloth in tissue retraction task with the obj and msh I created. I know it is an incomplete env, but I wanted to check if the texture actually works with other stl files. But I have been getting the following output.
Screenshot from 2024-06-07 07-17-27

when I tried with vtk file instead of msh, I waited couple of hours for the output, but none appeared. Could the issue might be with the msh conversion I did ? I got no error in gmsh or blender when creating files.

Units of measurements

Hi,

I would like to ask you what units of measurement are used in these environments as I haven't found anything in the documentation;
in particular, I would like to know the unit of measurement used for Young's modulus.
Thanks

Francesco

improve texture

Hi,
i'm using a .png image texture for the objects in my simulations, but the image doesn't wrap around the mesh like i want and there's always a marked line that creates problems. There is a way to solve my problem in Sofa? or maybe to import the information about the texture mapping from another program?
thanks a lot

No output for tissue retraction environment scene description

Hi,
I am trying to run scene_description.py file for tissue retraction environment, however I am getting following error for runSofa
[ERROR] [FileRepository] File tissue-1479-0.01.comp NOT FOUND in :/home/saketh/SOFA/v23.06.00/share/sofa:/home/saketh/SOFA/v23.06.00/share/sofa/examples:/home/saketh/SOFA/v23.06.00/share/sofa:/home/saketh/SOFA/v23.06.00/share/sofa/examples
I am running it it 23.06.00 , is the version of sofa a potential problem ?
Screenshot from 2024-05-25 23-00-54

sofa_env test

hi everyone, i installed sofa_env but i get issues while installing the pyDNS. I have read that it does not work with python3, so i tried to install pip3DNS... but when i try to launch the test file, like it is said on the github page, i receive this error, although i can guarantee you that i installed it
Traceback (most recent call last):
File "C:\Users\franc\anaconda3\envs\sofa\sofa_env-main\sofa_env\scenes\controllable_object_example\controllable_env.py", line 62, in
env.reset()
File "C:\Users\franc\anaconda3\envs\sofa\sofa_env-main\sofa_env\scenes\controllable_object_example\controllable_env.py", line 49, in reset
return super().reset()
File "c:\users\franc\anaconda3\envs\sofa\sofa_env-main\sofa_env\base.py", line 149, in reset
self._init_sim()
File "c:\users\franc\anaconda3\envs\sofa\sofa_env-main\sofa_env\base.py", line 187, in init_sim
self.sofa = importlib.import_module("Sofa")
File "C:\Users\franc\anaconda3\envs\sofa\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'Sofa'

Thanks in advance for your help

Run mr_env error

Hi, It`s me again. When I run the mcr_env.py with "python sofa_env/scenes/magnetic_continuum_robot/mcr_env.py" it came out the following error:

(sofa23_12) yangyang@yangyang-pc:~/conda_env/sofa_env/sofa_env$ python sofa_env/scenes/magnetic_continuum_robot/mcr_env.py 
---------------------------------------
Checking SOFA_ROOT and SOFAPYTHON3_ROOT
Using environment variable SOFA_ROOT: /home/yangyang/conda_env/SOFA_v23.12.01_Linux
---------------------------------------
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/lib/libSofa.GL.Component.Shader.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/lib/libSofa.Component.Visual.so
[WARNING] [InteractiveCamera(camera)] Too many missing parameters ; taking default ...
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/plugins/STLIB/lib/libSTLIB.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/plugins/SoftRobots/lib/libSoftRobots.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/plugins/BeamAdapter/lib/libBeamAdapter.so
[INFO]    [SofaPython3] Initializing with python version 3.10.14 (main, Mar 21 2024, 16:24:04) [GCC 11.2.0]
[INFO]    [SofaPython3] Added '/home/yangyang/conda_env/SOFA_v23.12.01_Linux/plugins/SofaPython3/lib/python3/site-packages' to sys.path
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/plugins/SofaPython3/lib/libSofaPython3.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/lib/libSofa.Component.AnimationLoop.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/lib/libSofa.Component.Constraint.Lagrangian.Solver.so
[INFO]    [PluginManager] Loaded plugin: /home/yangyang/conda_env/SOFA_v23.12.01_Linux/lib/libSofa.Component.Collision.Response.Contact.so
[ERROR]   [SofaRuntime] ValueError: Object type CollisionPipeline<> was not created  
The object 'CollisionPipeline' is not in the factory.  
But the following exits:  
                      : CollisionResponse (64% match)  
                      : RayCollisionModel (64% match)  
                      : CubeCollisionModel (62% match)  
                      : LineCollisionModel (62% match)  
                      : PointCollisionModel (61% match)  

Traceback (most recent call last):
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/scenes/magnetic_continuum_robot/mcr_env.py", line 268, in <module>
    env.reset()
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/scenes/magnetic_continuum_robot/mcr_env.py", line 146, in reset
    super().reset(seed)
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/base.py", line 206, in reset
    self._init_sim()
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/scenes/magnetic_continuum_robot/mcr_env.py", line 259, in _init_sim
    super()._init_sim()
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/base.py", line 280, in _init_sim
    self.scene_creation_result = getattr(self._scene_description_module, "createScene")(self._sofa_root_node, **self.create_scene_kwargs)
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/scenes/magnetic_continuum_robot/scene_description_3d.py", line 141, in createScene
    mcr_simulator.Simulator(root_node=root_node)
  File "/home/yangyang/conda_env/sofa_env/sofa_env/sofa_env/scenes/magnetic_continuum_robot/mcr_sim/mcr_simulator.py", line 52, in __init__
    self.root_node.addObject("CollisionPipeline", draw="0", depth="6", verbose="1")

It seems that the CollisionPipeline object was not created. I think maybe there are something wrong with the CollisionPipeline in the sofa framework, but i don`t know how to fix it. Looking forward to your reply . Thanks

SOFA_ZOO Observation Space Type Assertion Error

python ~/sofa/sofa_zoo/sofa_zoo/envs/reach/ppo.py

I ran the code above and ended up with an Assertion Error.

image

It seemed that type(env.observation_space) = <class 'gymnasium.spaces.box.Box'>, which is not gym.spaces.Box that the code required.

image

Do you know how to fix this problem?
I really appreciate any help you can provide.

CANNOT build SOFA

I'm installing the SOFA environment following this link https://github.com/ScheiklP/sofa_env/blob/d0d197d4bda74338e8b6aa1e5a72a9c715f7f73e/docs/source/setting_up_sofa.rst

Follow the instructions from top to bottom until the build SOFA in the Compile SOFA part. I received a thousand lines of error.


Environment

Context

  • System: Ubuntu 18.04.5 LTS
  • Version of SOFA: master branch at commit d0d197d

Command called

cmake --build $FOLDER_TARGET -j --target install

I will show you a first few lines of the error messages.

In file included from /bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.cpp:22:0:
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:28:23: error: variable 'sofa::helper::visual::SOFA_EXPORT_DYNAMIC_LIBRARY sofa::helper::visual::Transformation' has initializer but incomplete type
 class SOFA_HELPER_API Transformation
                       ^~~~~~~~~~~~~~
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:30:1: error: expected primary-expression before 'public'
 public:
 ^~~~~~
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:30:1: error: expected '}' before 'public'
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:30:1: error: expected ',' or ';' before 'public'
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:32:5: error: 'SReal' does not name a type
     SReal   scale[3];
     ^~~~~
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:33:5: error: 'SReal' does not name a type
     SReal   rotation[4][4];
     ^~~~~
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:34:5: error: 'SReal' does not name a type
     SReal   objectCenter[3];
     ^~~~~
/bigdata/users/kleelakunwet/sofa/src/Sofa/framework/Helper/src/sofa/helper/visual/Transformation.h:36:21: error: expected constructor, destructor, or type conversion before ';' token
     Transformation();
                     ^

cmake error

I am following the instructions to install SOFA and SofaPython3. When i`m building sofa with "cmake --build $FOLDER_TARGET -j --target install " it came out "make: *** No rule to make target 'install'. Stop." how to deal with it?

Problems with Python3.8

Hi @ScheiklP,

I have been trying the repository in the last few days, and I saw that you have update the minimum required python version to 3.8. Even though the tests pass using this verion and the simple scene controllable_object_example would work, people will experience problems in other scenes. For example, if you try running environment deflect_spheres, an error will raise regarding the impossibility of performing the bitwise OR (|) operator between defaultdict and dict. This is coming from line 290 on deflect_spheres_env.py.

self.reward_amount_dict = defaultdict(float) | reward_amount_dict

This was solved in Python3.9 on PEP 584. Not sure if you were aware about this, but it may lead to some confusion for future users. Maybe it will be a good idea to talk with the people from SOFA so they update the binaries with a newer version of Python to solve this issue and have full compatibility with this repository. Another solution would be to create a Docker Image to self contain the requirements to run this repository from any computer. I hope his comment helps.

Best,
Mikel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.