Home › Forum › SOFA › Programming with SOFA › Oriented Sliding Constraint/Actuator
Tagged: 64_bits, Plugin_SoftRobots, SOFA_1906, Windows_10
- This topic has 5 replies, 2 voices, and was last updated 4 years, 8 months ago by Hugo.
-
AuthorPosts
-
26 February 2020 at 15:19 #15242BenjaminModerator
Hi,
I currently using Sofa in python. I would like to create an oriented sliding actuator. Indeed, I thought that the frame used to defined the direction of the constraint of the actuator was the associated frame, defined by the index, but It seems to be the main frame.
The following code define two frames. The constraint free direction is the X of the main frame, which is not i wanted, not the direction x of the frame associated to the frame 1.
MecaModelNode.createObject('Mesh', edges=['1 0']) MecaModelNode.createObject('MechanicalObject', template='Rigid3d', showObject='true', position=[' 0.0 0.0 0.0 0 0 0 1', ' 69.282 -40.0 0.0 0.0 0.0 0.9848054 0.1736614']) MecaModelNode.createObject('BeamInterpolation', name='interpolation', crossSectionShape='circular', radius='0.125', dofsAndBeamsAligned='false', defaultYoungModulus='70e8' , DOF0TransformNode0=[' 0.0 0.0 0.0 0 0 0 1 '], DOF1TransformNode1=[' 42.9230 -25.7996 0.0 0.0 0.0 0.9636117 0.2673061']) MecaModelNode.createObject('PartialFixedConstraint', indices='1', fixedDirections='0 1 1 1 1 1') MecaModelNode.createObject('SlidingActuator', template='Rigid3d', indices='1', direction='1 0 0 0 0 0') MecaModelNode.createObject('AdaptiveBeamForceFieldAndMass', massDensity=0.000155, name='LinkForceField', interpolation='@interpolation')
I tried several things but it did not work. Is it possible to define the constraint free direction in the direction of the link or should i use something like the ArticulatedSystemMapping.scn example (example/components/mapping) ?
Kind regards,
Benjamin3 March 2020 at 17:03 #15273HugoKeymasterHi @benjamin
If I understand you correctly, you have two rigid frames. And you would like them to only move along one axis? is this correct?
I guess you already took a look at the Sliding constraint?
What is your actuator supposed to do?
Best
Hugo
20 March 2020 at 18:58 #15515BenjaminModeratorHi @hugo,
My apologies for the late answer. It is exactly the case yes. However, the axis need to be orientated in the space.
I took a look at the sliding constraint example. However, I did not succeed to constraint the point of my solid to the line, as in the example. I tried to understand why.
The sliding constraint take in parameters two Vec3d. I created one object from the <i>rootNode</i> (the line) and another from my <i>MechanicalModelNode</i> (the sliding point). It seemed that the field <i>UncoupledConstraintCorrection</i> is essential for the sliding constraint but I did not succeed to use it. The <i>UncoupledConstraintCorrection</i> is link to the mass of the object but the mass compute by the <i> AdaptiveBeamForceFieldAndMass </i> is not recognised as such.The actuator is supposed to push or pull a object in a straight line. The orientation of this line is not colinear to the world frame axis.
Kind regards,
Benjamin24 March 2020 at 17:45 #15544HugoKeymasterHi @benjamin
Further to discussion, it seems that the class SlidingActuator that you presented in your first post above is the one you should be using. This component of the SoftRobots plugin allows you to define the “direction” made up of: the position x,y,z and the orientation.
By specifying the proper origin (x,y,z) of your sliding constraint and its orientation with Euler angles, it should be working.
Let me know if this unclear.
Best,Hugo
26 March 2020 at 10:12 #15568BenjaminModeratorHi @Hugo,
Thank you for your response.
The class SlidingActuator, using a Ridif3d template, has a direction component but all the values inside need to be 0 or 1 (0.7017 working sometimes).
Using a Vect3d template, it seems that the direction can only take three parameters (not limited to 0 or 1).
So I tried to use the Vect3d template but I get another problem. Sofa tell me that this node (indice 1 in my MecaModelNode) did not have any mechanical state associated.
The given advise is to create another mechanical object. Is this object could be used as a boundary condition for the beam interpolation or linked to the current point ?I have another question about what you mean by sliding contraint in your response. Do you mean that inside the sliding actuator there is already a sliding constraint or must I remplace the partialFixedConstraint by a SlidingConstraint ?
Kind Regards,
Benjamin31 March 2020 at 10:57 #15592HugoKeymasterHi @benjamin
I don’t have access to the class SlidingActuator itself, but looking at the tripod script here in the SoftRobot plugin, the rotation (Euler angles) are indeed between 0 and 1 (see cos and sin functions used). But normalization should not be an issue.
For the pb of template, without the actual C++ class I can not help really further.
Again without the code of the SlidingActuator, hard to tell but yes I would write the scene with the SlidingConstraint alone.
I am sorry not to be able to help you more. Maybe another round with the Defrost guys would be more efficient.
Best,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.