Home › Forum › SOFA › Using SOFA › [SOLVED] Unable to create ‘BilateralInteractionConstraint’
- This topic has 6 replies, 3 voices, and was last updated 4 years, 5 months ago by Hugo.
-
AuthorPosts
-
20 May 2020 at 22:09 #16330OwenBlocked
Hello SOFA community,
I encountered a problem when I was trying to use
BilateralInteractionConstraint
to attach one soft actuator to another. The error shown in the command line is below:[ERROR] [PythonScript] RuntimeError: Unable to create 'BilateralInteractionConstraint' of type 'BilateralInteractionConstraint' in node 'root'. Object type BilateralInteractionConstraint<Vec3d> was not created The object is in the factory but cannot be created. Requested template: Vec3d(Vec3d) Available templates: Rigid3d, Vec3d, File "Ex3Ex3.pyscn", line 165, in createScene rootNode.createObject('BilateralInteractionConstraint', template = "Vec3d", object1 = "@pneu1/Constraint/points", object2 = "@pneu2/Constraint/points", first_point = "1", second_point = "0")
In addition, the collision model doesn’t seem to work in my scene. I wonder if this is caused by the failure of using BilateralInteractionConstraint.
This is the link to my codes and CAD file:
https://drive.google.com/open?id=14upVfy_OBgSgKFw9lSF3u5NzMG8ZBI_AThe actuator is controlled by pressing “ctrl”+”-” and “ctrl”+”=” on the keyboard. After running the scene, the error should be easy to notice. I have spent a whole day on this issue… So any advice would be greatly appreciated!
Best,
Owen24 May 2020 at 10:37 #16348HugoKeymasterHi @qwe12050
it took me some time to found because it’s very simple!
Check the case of your node “constraint” one is a “c” another is a “C”Best
Hugo
24 May 2020 at 12:51 #16352BineshBlockedHi @qwe12050
I checked your python codes and i think there is a problem in your code,
for creation of bilateral Interaction Constraint, you have to create a mechanical state same as bilateral template
i cannot see any mechanical state in your “rootNode”,
i think you must create a mechanical state in Vec3 TemplateBest,
Behnam Binesh
25 May 2020 at 14:31 #16363OwenBlockedHi @secretdevil
Thank you for your reply!
I have corrected the case of “Constraint” as Hugo suggested, and then I don’t have this error anymore. I am sorry that my code is a bit messy… Even though I don’t fully understand how the templates work, I think the mechanical state was created in the children of rootNote. Like in Line 126
pneu2.createObject('MechanicalObject', name='tetras', template='Vec3d', showObject='0', showObjectScale='1')
etc.I guess for now I will move on since the error disappears. If I encounter similar problems again, I will examine my code and find where Vec3d is missing.
Best wishes,
Owen25 May 2020 at 14:43 #16364HugoKeymasterNice @qwe12050
By the way it starts being a nice complicated scene, good to see that!
Good luck in the next steps and forum remains at your disposal!Best,
Hugo
25 May 2020 at 15:11 #16365OwenBlockedHi @hugo,
I feel kinda stupid to waste your time on fixing this tiny error… However, I have one more question to ask about
BilateralInteractionConstraint
if you don’t mind. I found this page explaining the Args: https://sofacomponents.readthedocs.io/en/latest/_autosummary/_autosummary/sofacomponents.ConstraintSet.BilateralInteractionConstraint.htmlBut I still don’t understand what first_point and second_point represent. For example, in my case, I want to combine two objects so I created two points on the body of each object. What would my first_point and second_point be?
Best,
Owen25 May 2020 at 17:59 #16372 -
AuthorPosts
- You must be logged in to reply to this topic.