Write a read-only position vector #4510
Replies: 6 comments 9 replies
-
Hey @ISIR-GuillaumeS thanks for posting! The error should be related to the fact that the state data of the Mechanical should be write-accessed with accessors. An example is available here: example-forcefield.py However, I doubt it's the best way to do it. Is it correct to say that you want your cables to progressively get closer to the thebackbone? |
Beta Was this translation helpful? Give feedback.
-
Hi @ISIR-GuillaumeS, have you tried this kind of modification |
Beta Was this translation helpful? Give feedback.
-
Thanks for answering ! However, Hugo is right, I want to move dynamically the cable positions. I tried to change 'position' by 'res_Position' but that did not changed anything. Let me clean the scene I am working on and I will push it as soon as I can. |
Beta Was this translation helpful? Give feedback.
-
I believe I may have misunderstood your question earlier. Are you looking to move the cable sideways? Given that your cable is attached to fixed points along which it slides, moving one part may affect the others. Let's schedule a video call tomorrow to discuss this further, and then we can provide an update here. Thanks, @hugtalbot, for the clarification. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hi !
I have a SOFA scene based on the Cosserat plugin and SofaPython. The idea is to create a continuum manipulator driven by cables (see below).
Here is the code I use to add cables to the manipulator :
And then, in my CreateScene function I have
The thing I am trying to perform is to change dynamically the position of the cables pulling point during my control loop. For exemple, I would like the cables to get closer of 1mm of thebackbone at every step of the contol loop. To do that, I tried to overite the position of the pulling point by writing
self.proto.stemNode.CosseratBase.rigidBase.cosseratInSofaFrameNode.cable1Node.cable_mecha1Node.PullingCable.MechanicalObject.position.value[13][0] = 0.70
Or
self.proto.stemNode.CosseratBase.rigidBase.cosseratInSofaFrameNode.cable1Node.cable1Pos.position.value[13][0] = 0.70
However, it gave me the same error in both cases :
Do you have any idea on how to do it ?
Thanks for helping !
Beta Was this translation helpful? Give feedback.
All reactions