Forum Replies Created
-
AuthorPosts
-
AryaBlocked
Hello @c4rs200, I have worked on a very similar bot with 3 cable actuators. I would love to see your code to solve your problem better, I assume you are manipulating the length of the cable actuator by changing the
CableConstraint
value. You can considerCableConstraint
as the value of your Cable length since the value ofCableConstraint
is basically derived from it being a mechanical object withindices=range(len(cableGeometry))
.Note that all changes to be made to your
CableConstraint.value
need to be made in a function within theSofa.PythonScriptController
for them to reflect in your simulation dynamically.Cheers!
AryaBlocked@hugo Why is it that you suggested the compliance be set to 1/vertexMass, Can you please explain the theory behind this, as to my understanding the compliance*lagrange-multipliers just defines the corrective part of the constraint violation equation.
In my scene I have a deformable object and a STLIB floor and I have made the STLIB floor a child node of the deformable object but kept it as a seperate collision group in that body, So what I also wanted to know is that will the Solvers and ConstraintCorrectors I use for my deformable body also be used for the child node? And upon setting the compliance in UncoupledConstraintCorrection as 1/vertexmass, the compliance for me comes to around 7000, My scene crashes when doing so..Can you give me some clarity on how this may be tackled?
AryaBlockedHey @hugo, I am having an issue with using boxROI indices in the Rigidify function of STLIB/physics/mixedmaterial. I am trying to rigidify a certain part of my deformable body using this rigidify function and I am using boxROI to insert indices into groupIndices of the rigidify function. Although I am not able to extract indices values from boxROI, I am doing this in python and have tried to get indices using the following forms and all of them give seperate errors :
groupIndices = [“@boxROI.indices”]
groupIndices = [eobject.getObject(‘boxROI’).findData(‘indices’).value]
groupIndices = [“@”+BoxROI2.getPathName()+’.indices’]
groupIndices = [np.array(eobject.getObject(‘boxROI’).findData(‘indices’).value)]I tried to print the values of the indices in the onBeginAnimationStep() but I don’t get any output and when I print them in my deformable body class, I get an output of : [[0]]
Also on using the rigidify function with the groupIndices as the above I get errors like :
“TypeError: ‘in <string>’ requires string as left operand, not int
File “rigidifywakrabot.pyscn”, line 92, in createScene
Wakraedge(rootNode, translation=[1.0, 0.0, 0.0])
File “rigidifywakrabot.pyscn”, line 73, in Wakraedge
Rigidify(wakraedge, eobject, groupIndices = [“@”+BoxROI2.getPathName()+’.indices’], frames=None, name=”rigidbody”, frameOrientation=None)
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 86, in Rigidify
selectedPoints = mfilter(groupIndices[i], allIndices, sourcePoints)
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 78, in mfilter
if i in si:
” ;“TypeError: unhashable type: ‘list’
File “rigidifywakrabot.pyscn”, line 91, in createScene
Wakraedge(rootNode, translation=[1.0, 0.0, 0.0])
File “rigidifywakrabot.pyscn”, line 73, in Wakraedge
Rigidify(wakraedge, eobject, groupIndices = [eobject.getObject(‘boxROI2’).findData(‘indices’).value], frames=None, name=”rigidbody”, frameOrientation=None)
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 111, in Rigidify
Kd.update({v: [1, k] for k, v in enumerate(selectedIndices)})
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 111, in <dictcomp>
Kd.update({v: [1, k] for k, v in enumerate(selectedIndices)})
“;“TypeError: unhashable type: ‘numpy.ndarray’
File “rigidifywakrabot.pyscn”, line 92, in createScene
Wakraedge(rootNode, translation=[1.0, 0.0, 0.0])
File “rigidifywakrabot.pyscn”, line 74, in Wakraedge
Rigidify(wakraedge, eobject, groupIndices = np.array([np.array(eobject.getObject(‘boxROI2’).findData(‘indices’).value)]), frames=None, name=”rigidbody”, frameOrientation=None)
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 111, in Rigidify
Kd.update({v: [1, k] for k, v in enumerate(selectedIndices)})
File “/home/aryak/Downloads/SOFA_v19.06.99_custom_Linux_v5.1/plugins/STLIB/python/stlib/physics/mixedmaterial/rigidification.py”, line 111, in <dictcomp>
Kd.update({v: [1, k] for k, v in enumerate(selectedIndices)})
“AryaBlockedHey @hugo I tried doing a reinstallation of both SOFA and Python3, I made Python3.7.1 as my python3 default verison. After reinstalling SOFA V_20.12 I added SofaPython3 and STLIB in the plugin manager, I am still getting this error:
ImportError: cannot import name ‘Node’ from ‘stlib3.scene’ (/home/administrator/Downloads/SOFA_v20.12.02_Linux/plugins/STLIB/lib/python3/site-packages/stlib3/scene/__init__.py)
At:
step5.py3scn(2): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(728): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>Can you provide a solution?
AryaBlockedHey, @hugo That helped, now I can atleast open .pyscn files,
They still have error messages and fail to load in the GUI.
The error messages are like:
[ERROR] [SofaPython3::SceneLoader] SyntaxError: positional argument follows keyword argument (step5.pyscn, line 26)At:
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(791): source_to_code
<frozen importlib._bootstrap_external>(860): get_code
<frozen importlib._bootstrap_external>(724): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>and
:
[ERROR] [SofaPython3::SceneLoader] ModuleNotFoundError: No module named ‘stlib3’At:
step1.pyscn(7): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(728): exec_module
<frozen importlib._bootstrap>(677): _load_unlocked
<frozen importlib._bootstrap>(696): _load
/usr/lib/python3.7/imp.py(171): load_source
/usr/lib/python3.7/imp.py(234): load_module
<string>(3): <module>Is this because I need to add STLIB and SoftRobots in the plugin manager too?
Or is there a problem with Python3.7?AryaBlockedYes, @hugo, I have tried that, I added libSofaPython3.so and it gives me the following error:
Plugin loading failed (/home/administrator/Downloads/SOFA_v20.12.02_Linux/plugins/SofaPython3/lib/libSofaPython3.so): libpython3.7m.so.1.0: cannot open shared object file: No such file or directoryAryaBlocked@hugo According to me the problem is in not having SofaPython3 in my pluginmanager in my GUI, As the Documentation suggested I added SofaPython3 NO_VERSION to my lib/plugin_list.conf, but the SofaPython3 plugin still doesn’t show up in my GUI plugin manager, Can you tell me how can I permenantly add SofaPython3 as a plugin, I think that might solve the problem of handling .pyscn files.
AryaBlockedDear @hugo none of the .pyscn files in the SoftRobots plugin are working and I am getting the same error of extension (pyscn) not handled. I suppose the pyscn files in SoftRobots/docs/tutorials are SofaPython2, but I noticed that the new binaries version has a SofaPython3 folder in every tutorial for eg. Tripod which has all the step*.pyscn files in SofaPython3 I think, even these are not being recognized by the GUI and runSofa gives the handle error. Is there not a way to make both sofapython2 and sofapython3 files run with runSofa with the same binaries version
AryaBlockedThank you @olivier-goury for that concise answer. I will surely try this out and let you know. Although I currently have the Binary version of Sofa, So I guess getting the source code version is essential in order to get these components and examples.
AryaBlockedRedarding point 2,
Changing the step-size of the actuator, I found doing that is possible by just changing the value of self.stepsize in the controller file of any SoftRobot tutorial. So just posting this incase anyone else has the same doubt.
AryaBlockedDear @hugo,
1. Thanks for that info, I do see a lot of data available in the the MechanicalDofs folder of the GUI after a simulation, I am actually interested in exporting this data from the simulation, can you please point me to a code/example that shows how that is done, also regarding the data that is available. I also wanted to know what exact points in the Mechanical object this vector3 for eg free_position data represents and is there a way to select multiple points on the mechanical model for which I can get this data?
3. Actually I am talking incase of tutorials, like if I change colour or gravity in the root node file Defaultvisualmanagerloop, it doesn’t reflect in the simulation only changes through GUI actually execute in the simulation, it doesn’t show any error message just runs the animation as per what the original conditions were.
-
AuthorPosts