Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Cool thanks for your feedback Nolwenn!
Let us know about any further difficulty or question regarding SOFA.Best regards,
Hugo
12 February 2018 at 18:13 in reply to: How can I modify the position of the Collision Object from Rigid Mechanical Obj #10492HugoKeymasterHi Andres,
It seems the path that you set in the input field of the mapping is wrong. A “@../” is missing.
Here is my version (I needed to add both the ODE and linear system solvers:
<Node name="Instrument" principalGraph="true"> <VisualStyle displayFlags="showVisual hideBehavior showCollision hideMapping" /> <!-- <EulerImplicitSolver name="cg_odesolver" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> --> <MechanicalObject template="Rigid" name="instrumentState" tags="Omni" translation="-1 4 -2" rotation="180 0 150" showObject="1"/> <UniformMass template="Rigid" name="mass" totalmass="0.05" /> <Node name="VisualModel" > <OglModel template="ExtVec3f" name="InstrumentVisualModel" fileMesh="mesh/dental_instrument.obj" material="Default Diffuse 1 1 0.2 0.2 1 Ambient 1 0.2 0.04 0.04 1 Specular 0 1 0.2 0.2 1 Emissive 0 1 0.2 0.2 1 Shininess 0 45" /> <RigidMapping template="Rigid,ExtVec3f" name="MM->VM mapping" input="@../instrumentState" output="@InstrumentVisualModel"/> </Node> <Node name="CollisionModel"> <MeshObjLoader name="loaderInst" filename="mesh/dental_instrument.obj" /> <Mesh src="@loaderInst" /> <MechanicalObject src="@loaderInst" template="Vec3d" name="Particle" position="0 0 0" /> <Point name="ParticleModel" contactStiffness="2" /> <RigidMapping template="Rigid,Vec3d" name="mapping" input="@../instrumentState" output="@Particle" /> <EnslavementForceFeedback name="forcefeedback" tags="Omni" collisionModel1="@ParticleModel" collisionModel2="" relativeStiffness="4" attractionDistance="0.3" normalsPointOut="false"/> </Node> </Node>
Let me know if it helps.
Cheers,Hugo
12 February 2018 at 11:34 in reply to: [SOLVED] Translating mechanical objects (not working c++) #10475HugoKeymasterHi Bek,
If you use a mapping, mapping the collision (slave) onto the mechanical model (master), and you change the position of the collision model, the mapping will overwrite the position since the master representation is the mechanical model.
Does this make sense?Are the meshes used for the collision and the mechanics the same mesh?
Could you send us more details about your scene and the code written to move the collision model?Best,
Hugo
HugoKeymasterPlease, carry on the discussion on the already-opened topic:
https://www.sofa-framework.org/community/forum/topic/problem-while-opening-the-sensable-example/I close this thread.
Cheers,
Hugo
HugoKeymasterAny luck with Guillaume’s advice Andres ?
12 February 2018 at 11:26 in reply to: How can I modify the position of the Collision Object from Rigid Mechanical Obj #10472HugoKeymasterDear Andres,
If you want two representations of your object (mechanical and collision) to have exactly the same positions, use the same mesh for both representations and a IdentityMapping between them.
Why don’t you use Python for your code ?
In the two pieces of code you wrote above, which one is not working?Finally, you can find a reliable example in applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn.
Let us know if this helps.
Cheers,Hugo
HugoKeymasterHey Zahra,
Why not using Python for this?
Making loop on indices while the simulation is running is possible.About MATLAB a topic was already posted there: https://www.sofa-framework.org/community/forum/topic/launching-sofa-from-matlab-script/
Hope this helps.
Best,Hugo
HugoKeymasterHi Zahra,
You can use the AttachConstraint, see the associated example in examples/Components/constraint/AttachConstraint.scn.
Best,
Hugo
HugoKeymasterHi r0m1
A short advice with SOFA : when you have such a question about a Data of a component do not hesitate to have a quick look into the source code.
For instance, I did not know and do not use the LinearVelocityConstraint. However, if I look at line 206 (and following) in the projectVelocity() function, I noticed that :
- indices: is an integer, standing for the indices of the vertices on which the constraint is applied,
- coordinates: is an integer, corresponding to the coordinate(s) x, y or z, i.e. coordinates=”0 1″ the constraint is applied only along x and y. If no coordinate is defined, the constraint is applied on all directions x,y and z.
I hope this helps you!
Cheers,Hugo
HugoKeymasterDear Kolja,
Welcome on the SOFA forum!
The approach either collision- or force-based are pretty different from one another.Collision would be possible. How do you describe the topology of your alpha-helices? If this is a group of lines, then, you can define a collision model on it with:
<Lines />Since you are interested in the geometrical output of the solution, I would also use a force field mimicking the Van der Waals forces. Such a forcefield is rather easy to implement in a new ForceField. All you need is to implement the right addForce() and addDForce() functions. Infos are available here.
If this does not help enough, let us know. We could still help you in the process.
Finally, two further options would be possible:- we can propose some training sessions (next sessions is in Feb. 26th in Paris)
- or propose a few support hours during which we could help you in the development.
A short side question, do you have your own alpha-helix model ?
Is this implemented in a plugin?Best regards,
Hugo
HugoKeymasterNice to hear !
Anytime, do not hesitate to ask again for help. And check out all the possible ways to get involved in SOFA.Best regards,
Hugo
HugoKeymasterDear Xiapoeng,
Welcome to the SOFA community!
Unfortunately, the Modeler is deprecated and is therefore not in the binary versions of SOFA anymore.
But you can find the Modeler and a separate Tutorial application available in the sources (to compile) of SOFA. You can follow the build instructions here.Best
Hugo
HugoKeymasterHi @eunkyungbae
I fixed it.
The problem was the quote you were using and I changed the MeshTopology into : one MeshObjLoader and one Mesh component.Scene below:
<Node name="springthread"> <VisualStyle displayFlags="showCollisionModels showVisual" /> <Gravity name="R_Gravity" gravity="0 0 0" /> <MeshObjLoader name="Mesh" filename="PointLine50.obj" /> <Mesh src="@Mesh" /> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.01" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <MechanicalObject template="Vec3d" name="DOFs" scale3d="1 1 1" restScale="1" src="@Mesh" translation="-1 -5.0 -2.0" rotation="320 0 0" scale="2 2 2"/> <UniformMass mass="1" /> <FixedConstraint template="Vec3d" name="default6" indices="0" /> <MeshSpringForceField name="Springs" stiffness="100000" damping="0" /> <LineBendingSprings name="BS" stiffness="10000" damping="0" /> <UncoupledConstraintCorrection /> <Point tags="tip_thread_col" /> <Line selfCollision="0" contactStiffness="10000"/> <Node name="Collision"> <EdgeSetTopologyContainer /> <EdgeSetTopologyModifier /> <MechanicalObject template="Vec3d" name="splineMapped" /> <CatmullRomSplineMapping input="@../DOFs" output="@splineMapped" SplittingLevel="1" /> <Node name="Visu"> <OglModel template="ExtVec3f" name="VisualModel" src="@../" lineWidth="6" lineSmooth="1"/> <OglTexture id="imageTex" textureFilename="textures/textureorange3569.png" textureUnit="0" repeat="1" /> <IdentityMapping input="@.." output="@VisualModel" /> </Node> </Node> </Node>
Let me know if this is what you need.
Cheers,Hugo
HugoKeymasterHi Bek,
could you please share the mesh/data with us ?
this would help to test,cheers,
Hugo
HugoKeymasterHey @sofauser3
Thanks for joining the SOFA community and welcome on our free forum!
There is indeed way of accessing the camera information in SOFA but only using the OpenGL viewer (SOFA menu View->OpenGL). There you will have an interactive camera with its position, orientation, lookAt etc.
Hope this helps.
Hugo
HugoKeymaster[Update]
All the GitHub discussion is going on here: https://github.com/sofa-framework/sofa/issues/561Best,
Hugo
HugoKeymasterAlright, I guess it can be done similarly to the Geomagic plugin if you know what kind of data you receive through the VRPN connection.
But I’m sorry I am really no expert in this field. Maybe some other devs in the community would better answer this.16 January 2018 at 19:46 in reply to: [SOLVED] How can I get a OglModel object from c++ code for a Scena? #10339HugoKeymasterGreat to hear, good luck for the next steps Andrés.
Anytime do not hesitate to post your issues.Best,
Hugo
PS: I mark your topic as resolved.
HugoKeymasterHi @gurbuz
You’re right having simple easy Tutorials on this would be nice.
To make it shorter, could you post us your error logs please?Best,
Hugo
HugoKeymasterGood idea, since this plugin is rarely used maybe a problem in the CMakeList file.
I will try to compile it on Linux to see if I can use it.Best,
Hugo
HugoKeymasterDear Sarath
I am indeed not sure to understand.
In simulations, you are computing at each step of the simulation the evolution of the state of your object. The state or degrees of freedom (e.g. positions) are stored in the MechanicalObject. The physics defined in your simulation (internal and external forces) will make the degrees of freedom change in time.
In the case you want an haptic device (e.g. Geomagic) to control (master) an object in the scene, what is done is that you have:
– a driver (GeomagicDriver) recovering the information from the device (the position in 3D space of the device)
– a Rigid point, stored into a MechanicalObject, that will have the same position than one given by the device.
Therefore we have:<!-- To load the plugin --> <RequiredPlugin pluginName="Geomagic"/> <!-- To recover the information from the device --> <GeomagicDriver name="GeomagicDevice" deviceName="Default Device" positionBase="0 0 0" orientationBase="0 0 0 1" /> <!-- a rigid particle storing the position (Rigid) of the device --> <MechanicalObject template="Rigid" name="GeomagicMO" position="@GeomagicDevice.positionDevice" />
What kind of information do you recover through VRPN ?
HugoKeymasterGreat Camille! Nice to read that you are in the open-source spirit!
I will ask a dummy question : is the library MeshSTEPLoader.dll really generated/present in your build of SOFA (i.e. in the folder build/lib/) or anywhere else in your buid
Best,
Hugo
12 January 2018 at 12:04 in reply to: [SOLVED] How can I get a OglModel object from c++ code for a Scena? #10330HugoKeymasterDear Andres,
Welcome on the SOFA forum for your first question!
I would have written it this way:sofa::helper::vector< sofa::component::visualmodel::OglModel* > list_collisionModels; this->getContext()->get< sofa::component::visualmodel::OglModel >( &list_collisionModels );
Let us know if it works.
Best,Hugo
HugoKeymasterRight Erwan, a part of it should be pass to an open-source license soon.
But not sure for now about the timing. -
AuthorPosts