sofadefrost / stlib Goto Github PK
View Code? Open in Web Editor NEWSofa Template Library
License: GNU Lesser General Public License v3.0
Sofa Template Library
License: GNU Lesser General Public License v3.0
I am trying to build the library using cmake on windows, but I get the following error every time I try to:
cmake CMake Error at CMakeLists.txt:19 (sofa_set_python_directory): Unknown CMake command "sofa_set_python_directory".
I tried adding the SofaMacros.cmake, but with no luck.
When trying to load a scene with stlib3.scene the above error shows up. The SOFA framework version is 21.12.00 and the plugin has been downloaded from GitHub and unzipped in the SOFA plugins directory. Is there something that I am missing?
Hi,
I followed the tutorial of DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/cablegripper-tuto.md
to create my own cube&floor scene, and I figured out that the tutorial is out-dated in terms of the VisualModel.
From the Line# 54 The tutorial asked me to modify the */CableGripper/myproject/cablegripper.py file like the following:
from stlib3.visuals import ShowGrid
from stlib3.physics.rigid import Floor
from stlib3.physics.rigid import Cube
def createScene(rootNode):
"""This is my first scene"""
ShowGrid(rootNode)
Floor(rootNode,
translation=[0.0,0.0,0.0],
isAStaticObject=True)
Cube(rootNode,
translation=[0.0,0.0,0.0])
return rootNode
However, the terminal log shows that there is no such module called ShowGrid in the visuals package
[ERROR] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/home/jeremy/DefrostSofaBundle/plugins/SoftRobots/docs/sofapython3/tutorials/CableGripper/myproject/cablegripper.py'.
Python exception:
ImportError: cannot import name 'ShowGrid' from 'stlib3.visuals' (/home/jeremy/DefrostSofaBundle/plugins/STLIB/lib/python3/site-packages/stlib3/visuals/__init__.py)
Hence, I checked with the source code here and think the right expression based on the current structure of stlib3 should be like this:
from stlib3.visuals.visualmodel import VisualModel
def createScene(rootNode):
VisualModel.showGrid(rootNode)
Hope this might help. Thank you.
As in the title, once I try to launch the tripod-tutorial.py I get the following message:
[ERROR] [SofaPython3::SceneLoader] Unable to completely load the scene from file 'C:\Users*******\Desktop\aaasofa\tripod-tuto.py'.
Python exception:
ModuleNotFoundError: No module named 'stlib3'
At:
C:\Users******\Desktop\aaasofa\tripod-tuto.py(1):
(219): _call_with_frames_removed
(848): exec_module
(6):
What should I do? I checked and the stlib3 folder is where it should be (/plugins/STLIB/lib/python3/site-packages/)
Hi, when the plugin is loaded I had to add the path to stlib manually (disclaimer: I use the binary distributed by the soft robot plugin). In particular the plugin folder does not contain something like lib/python2.7/site-packages
A recent discussion I had with SOFA maintainers @hugtalbot and @epernod highlighted that some modifications may be required to the ContactHeader component.
More precisely, apparently the RuleBasedContactManager should be replaced with a CollisionResponse.
It seems simple enough that I can make a PR if you think that's relevant.
There is a problem in the new implementation of getOrientedBoxFromTransorm, it creates a bug on step3 of the TRIPOD tutorial
@damienmarchal could you have a look at it ?
euler Rotation is a vec3
rotation is a quat
Why are you mixing them ?
The good design, I think, should be to provide the user a function that transforms euler to quat...but then, inside the functions, always use quat...
The scaling is not applied to the visual model and the collision mesh. Only the 'forcefield' is scaled properly.
def createScene(rootNode):
from stlib.scene import MainHeader, ContactHeader
MainHeader(rootNode, gravity=[0.0,-981.0,0.0])
ContactHeader(rootNode, alarmDistance=15, contactDistance=10)
from stlib.scene import Scene
scene=Scene(rootNode)
from splib.objectmodel import setData
setData(scene.VisualStyle, displayFlags="showBehavior showForceFields")
from stlib.scene import Node
obj = Node(rootNode, "Mon object")
from stlib.physics.deformable import ElasticMaterialObject
eobject = ElasticMaterialObject(obj,
volumeMeshFileName="test.vtk",
poissonRatio=0.3,
youngModulus=18000,
totalMass=0.5,
surfaceColor=[0.0, 0.8, 0.7],
surfaceMeshFileName="test.stl",
scale = [3.0, 3.0, 3.0],
collisionMesh = "test.stl"
)
from stlib.physics.constraints import FixedBox
fixingBox=[-20.0,-20.0,-20.0,20.0,20.0,20.0]
FixedBox(eobject.node, atPositions=fixingBox, doVisualization=True)
return rootNode
Hello,
I am trying to follow these steps https://github.com/sofa-framework/SofaROSConnector to connect Sofa v20.06 and ROS noetic. During the cmake-gui Configuration, this error occurs:
CMake Error at applications/plugins/STLIB/CMakeLists.txt:42 (sofa_create_package_with_targets):
Unknown CMake command "sofa_create_package_with_targets".
I am using Ubuntu 20.04
Thanks for your help!
Hi
Current packaging of STLIB is not working as the python code is not included in the packaging.
In some old version of this packaging v21.06.03, in STLIB/lib/ there was a folder "python3/site-packages" that included the python code...
Is it possible to put it back ?
Hi,
Following the discussion from this issue, the way we use the properties in the prefab VisualModel is not correct.
Adding the components of the prefab from the init()
method and using the properties
results in odd behaviors due to the data callback mechanism.
We should update these prefabs:
Hello,
I am trying to build Sofa with STLIB and softrobots plugins with v20.06.
However I get the error: (running ubuntu 20.04 more output
configure_output.txt
attached)
CMake Error at /home/arthur/Documents/sofa/plugins/STLIB/CMakeLists.txt:42 (sofa_create_package_with_targets):
Unknown CMake command "sofa_create_package_with_targets".
I noticed the binaries on the softrobotic webpage were for v19.04 so I was wondering if this was an issue with the version of Sofa I am using?
Is there a version of STLIB that is compatible with v20.06? Or could this be a different kind of problem?
When trying to launch the sofiaLeg demo provided by the ModelOrderReduction plugin, the newBox
function did not work for me. I noticed that TRS_to_matrix()
does not initiate the rotation quaternion when a zero rotation is given. It can be fixed by adding the following lines:
if eulerRotation != None:
rotation = from_euler( to_radians( eulerRotation ) )
else:
rotation = [0, 0, 0, 1]
In the file STLIB/python/stlib/physics/deformable/elasticmaterialobject.py need to resolve the problem : TypeError: 'staticmethod' object is not callable
File "step0.pyscn", line 11, in createScene
Gripper(rootNode)
File "gripper.py", line 14, in Gripper
pullPointLocation=[3, 10.5, 3])
File "finger.py", line 39, in Finger
translation=translation)
File "/home/younes/travail/plugin/STLIB/python/splib/objectmodel/init.py", line 47, in call
o = self.cls(*args, **kwargs)
File "/home/younes/travail/plugin/STLIB/python/stlib/physics/deformable/elasticmaterialobject.py", line 30, in init
collisionMesh, withConstrain, surfaceColor, poissonRatio, youngModulus, totalMass, solver)
missing a 's' after constraint in step 2 code example :
from stlib.physics.constraint import FixedBox
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.