Home › Forum › SoftRobots › Programming with SoftRobots › Error msg in the PneuNetGripper tutorial
Tagged: SOFA_2012, SoftRobots tutorial, Windows_10
- This topic has 4 replies, 2 voices, and was last updated 3 years, 4 months ago by Hugo.
-
AuthorPosts
-
5 June 2021 at 20:51 #19658antonio.8196Blocked
Hi, me again, I am trying to load the Pneunet tutorial (step1) but I an getting this message, I think that this has to be with the bbox values but i do not understand why is it wrong since it comes directly from the tutorial.
[ERROR] [SofaPython3::SceneLoader] RuntimeError: Unable to resize vector to match list size. Is the data type resizable ? At: step1-meshLoading.pyscn(10): createScene [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias] [INFO] [SceneCheckerVisitor] Finished validating node "root". [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 updateBBox 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
the code is just this
import Sofa import os def createScene(rootNode): rootNode.addObject('RequiredPlugin', name='SoftRobots', pluginName='SoftRobots') rootNode.addObject('RequiredPlugin', name='SofaPython3', pluginName='SofaPython3') rootNode.addObject('RequiredPlugin', name='SofaLoader', pluginName='SofaLoader') rootNode.findData('bbox').value = ["-100", "-100", "-100", "100", "100", "100"] finger = rootNode.addChild('finger') finger.addObject('MeshVTKLoader', name='loader', filename='data/mesh/pneunetCutCoarse.vtk') finger.addObject('Mesh', src='@loader', name='container') finger.addObject('MechanicalObject', name='tetras', template='Vec3d', rx='0', dz='0')
The 10th line is the rootNode.findData(‘bbox’).value line, i have tried everything
[-100, -100, -100, 100, 100, 100]
[“-100”, “-100”, “-100”, “100”, “100”, “100”]
[“-100, -100, -100, 100, 100, 100”]
-100, -100, -100, 100, 100, 100
“-100 -100 -100 100 100 100”but nothing seems to work
9 June 2021 at 05:33 #19666antonio.8196BlockedHI, soooo, I was doing all the tutorial, step by step and I could realize that bbox is commented, there are some issues with the tutorials so I continued digging into the folder and I saw that there were files with the SofaPython3 plugin so I decided to try those, I tried them and they were alright, everything seemed to work but the key controller, whem I press Ctrl + the gripper does not move at all and idk why, how couls i fix that? Keep in mind that I am using SofaPython3
Two more questions:
– Can I load an cylindrical STL file using the Mesh stl loader?? I tried that in another version of SOFA and i could not.
– How could I map the pressure applied to the cavity? I see that there is a pneumatic sensor but I do not understand how to use itThanks in advance,
16 June 2021 at 22:52 #19740HugoKeymasterStrange that the controller is not working. Did you click in the SOFA 3D view before pressing Ctrl + ?
Regarding your additional questions:
– STL format is supported in SOFA. You can design it in a dedicated software and then import it. If not, we would be curious to have the error.
– I am not sure to understand your question “How could I map the pressure applied to the cavity?“. Could you rephrase it for me?Best wishes,
Hugo
17 June 2021 at 04:57 #19742antonio.8196Blocked1 Hi @Hugo, thanks for the response, I do not know where to find the SOFA 3D view, in the view option i just have QGLViewer and OpenGL, maybe i am missing one step.
2 I have my STL file already, it just just a simple cylinder, my code is just this
import Sofa import os def createScene(rootNode): rootNode.addObject('RequiredPlugin', name='SoftRobots') rootNode.addObject('RequiredPlugin', name='SofaLoader') #rootNode.addObject('RequiredPlugin', name='CGALPlugin') #rootNode.findData finger = rootNode.addChild('finger') finger.addObject('MeshSTLLoader', name='loader', filename='../data/mesh/actuador.stl') finger.addObject('MeshTopology', src='@loader', name='container') finger.addObject('MechanicalObject', name='tetras', template='Vec3d', showObject=True, showObjectScale=True)
When i do this, i just can see the borders of the top surface (the top of the cylinder) and the borders of the bottom surface (bottom of the cylinder), then when i try to do this code from the docs
node = rootNode.addChild('node') node.addObject('MeshSTLLoader', name='mesh', filename='../data/mesh/actuador.stl') node.addObject('MeshGenerationFromPolyhedron', name='gen', template='Vec3d', inputPoints='@mesh.position', inputTriangles='@mesh.triangles', drawTetras='1', cellSize='10', facetAngle='30', facetSize='4', cellRatio='2', facegApproximation='1') node.addObject('Mesh', position='@gen.outputPoints', tetrahedra='gen.outputTetras') node.addObject('VTKExporter', filename='../data/mesh/actuador.stl', edges=0, tetras=1, exportAtBegin=1)
I get an error that says
[ERROR] [SofaPython3::SceneLoader] ValueError: Object type MeshGenerationFromPolyhedron<Vec3d> was not created The object is not in the factory.
So basically, in the first code i am just trying to follow the instructions from the tutorial and i just see dotted lines on the top and bottom surface, not the cylinder itself
3 yes i am sorry, i want to measure the pressure of the actuator when it starts to move, I have seen the fingerController.py file and i can see that the pressureValue comes from the SurfacePressureConstraint object attached to the cavity, i could even print the actual value ( if the finger could be movec with ctrl and +) and see its value, right? If my assumption is right, what would it be the unit? bar, mpa? pa?
4 July 2021 at 08:58 #19914HugoKeymaster1. To be able to detect keyboard interactions (like your Ctrl +), Qt (that we use to build the runSofa GUI) requires to first click in the view area (where the scene is displayed, e.g. where you can see your cylinder) and then use the keyboard interactions.
2. Using your code:
finger = rootNode.addChild('finger') finger.addObject('MeshSTLLoader', name='loader', filename='../data/mesh/actuador.stl') finger.addObject('MeshTopology', src='@loader', name='container') finger.addObject('MechanicalObject', name='tetras', template='Vec3d', showObject=True, showObjectScale=True)
you are loading a STL file (NOTE : STL files are only surface meshes by definition). To visualize the topology you loaded, you define the data
drawTriangles=True
in the MeshTopology:finger.addObject('MeshTopology', src='@loader', name='container', drawTriangles=True)
3. Let’s first succeed the two previous tasks before looking into this point. Note that similar topics already tackled this question: here or here
Best wishes,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.