UNABLE TO RUN TUTORIAL CODES AND THEREFORE PROCEED FURTHER AND RUN MY OWN CODE PLEASE HELP #5021
Replies: 6 comments 13 replies
-
Hi @discreet26 A lot for the components of your scene seems to be deprecated (MeshObjLoader, DefaultPipeline, DefaultContactManager all renamed) missing RequiredPlugin. What is your SOFA version please? Could detail your issue please? |
Beta Was this translation helpful? Give feedback.
-
Which tutorial can't you run? |
Beta Was this translation helpful? Give feedback.
-
`# -*- coding: utf-8 -*-
import os
import finger
from finger import finger
def gripper(parentNode=None):
gripper = parentNode.addChild("gripper")
f1 = finger(gripper, "finger1",
rotation=[0, 0, 105],
translation=[20.0, 0.0, 0.0],
fixingBox=[-20, -10, 0, 20, 10, 15],
pullPointLocation=[3, 10.5, 3])
f2 = finger(gripper, "finger2",
rotation=[180, 0, 65],
translation=[-10.0, 0.0, -4.0],
fixingBox=[-20, -10, -30, 20, 10, 0],
pullPointLocation=[3, 10.5, -7])
f3 = finger(gripper, "finger3",
rotation=[180, 0, 65],
translation=[-10.0, 0.0, 34.0],
fixingBox=[-20, -10, 0, 20, 10, 50],
pullPointLocation=[3, 10.5, 31.5])
gripper.addObject(GripperController([f1, f2, f3]))
return gripper
def createScene(rootNode):
"""To test the content of this file, try:
>>> runSofa gripper.py
"""
from stlib3.scene import MainHeader, ContactHeader
MainHeader(rootNode, gravity=[0.0, -981.0, 0.0], plugins=["SoftRobots"])
ContactHeader(rootNode, alarmDistance=4, contactDistance=3, frictionCoef=0.08)
rootNode.VisualStyle.displayFlags = "showBehavior showCollisionModels"
gripper(rootNode)
return rootNode ##hello @damienmarchal thank you so much for the reply. I am new to coding so these errors might be silly for you. Here is the updated code and here is the new error [ERROR] [SofaPython3::SceneLoader] Unable to completely load the scene from file '/home/discreet/My-SOFA/build/bin/gripper.py'.
Python exception:
ImportError: cannot import name 'finger' from 'finger' (/home/discreet/My-SOFA/build/bin/finger.py)
At:
/home/discreet/My-SOFA/build/bin/gripper.py(4): <module>
<frozen importlib._bootstrap>(219): _call_with_frames_removed
<frozen importlib._bootstrap_external>(848): exec_module
<string>(6): <module> |
Beta Was this translation helpful? Give feedback.
-
@damienmarchal wanted to ask if the pneunetgripper-tuto.md file has been updated? this one https://github.com/SofaDefrost/SoftRobots/blob/master/examples/tutorials/PneunetGripper/pneunetgripper-tuto.md. and can i go ahead and follow this? thanks in advance |
Beta Was this translation helpful? Give feedback.
-
another question is how do i save the data that is collected during the simulation? where is it stored and how to access it? |
Beta Was this translation helpful? Give feedback.
-
@alxbilger @damienmarchal @hugtalbot @bakpaul how can I analyse data from the simulations? please help. i made a simple scene with a box falling from a height on the floor and now i want to find the force it applies on the floor when it hits it. where is the data stored? and how do i find all types of data such as velocity at every instant of the falling box and direction of fall and graphs of the same? please help. |
Beta Was this translation helpful? Give feedback.
-
@alxbilger @hugtalbot @bakpaul here is the code in question, please guide
Beta Was this translation helpful? Give feedback.
All reactions