Forum Replies Created
-
AuthorPosts
-
DavacasBlocked
I solved it! I found that I need to use QtViewer to use this plugin because it inherits from InteractiveCamera, so I just changed the viewer to Qt with the
-gqt
flag and it worked.I’m marking the issue as solved. Thank you!
DavacasBlockedThank you and sorry for my delayed answer!
This a simplified version of my code, which replicates the error, but not the crash. It uses common SOFA plugins and meshes, so it should run on pretty much any recent SOFA version.
<?xml version="1.0" ?> <Node name="root" showBoundingTree="0" gravity="0 0 0"> <RequiredPlugin name="SofaOpenglVisual" pluginName="SofaOpenglVisual"/> <RequiredPlugin name="SofaSparseSolver" pluginName="SofaSparseSolver"/> <RequiredPlugin name="SofaExporter" pluginName="SofaExporter"/> <RequiredPlugin name="SofaValidation" pluginName="SofaValidation"/> <DefaultPipeline verbose="0" depth="6"/> <DefaultContactManager name="response" response="FrictionContact" /> <LocalMinDistance name="proximity" alarmDistance="0.1" contactDistance="0.01" angleCone="0.1" /> <BruteForceDetection name="detection" /> <LCPConstraintSolver tolerance="0.0001" maxIt="10000"/> <FreeMotionAnimationLoop/> <CarvingManager active="false" carvingDistance="1.0"/> <Node name="Test"> <EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshGmshLoader name="loader" filename="mesh/liver2.msh" translation="0 2 0"/> <MechanicalObject name="DOFs" src="@loader" /> <TetrahedronSetTopologyContainer name="Container" src="@loader"/> <TetrahedronSetTopologyModifier name="Modifier" /> <TetrahedronSetTopologyAlgorithms name="TopoAlgo" template="Vec3d" /> <TetrahedronSetGeometryAlgorithms name="GeomAlgo" template="Vec3d" /> <MeshMatrixMass name="mass" totalMass="200" topology="@Container" /> <TetrahedronFEMForceField name="FEM" youngModulus="60000" poissonRatio="0.45" method="large" /> <PrecomputedConstraintCorrection recompute="false" fileDir="./PrecomputedComplianceMatrices"/> <BoxROI name="indicesMonitor" box="0 1 0 1 2 1" computeEdges="false" computeTriangles="false" computeTetrahedra="false" drawBoxes="true"/> <FixedConstraint src="@indicesMonitor"/> <MeshExporter name="Exporter" format="vtk" exportAtEnd="1" edges="false" triangles="false" quads="false" hexas="false"/> <Node name="Collision"> <MeshTopology name="TopologiaColision" src="@../loader" /> <MechanicalObject name="DOFsColision" src="@./TopologiaColision"/> <TriangleSetTopologyContainer name="Container" /> <TriangleSetTopologyModifier name="Modifier" /> <TriangleSetTopologyAlgorithms name="TopoAlgo" /> <TriangleSetGeometryAlgorithms name="GeomAlgo" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangleCollisionModel /> <IdentityMapping input="@../DOFs" output="@./DOFsColision"/> <Monitor name="MonitorTest" template="Vec3d" listening="true" indices="@indicesMonitor.indices" sizeFactor="5" showTrajectories="true" showPositions="true" ExportPositions="true" /> </Node> <Node name="Visual"> <OglModel name="VisualModel"/> <IdentityMapping input="@../DOFs" output="@VisualModel" /> </Node> </Node> </Node>
And here is a screenshot of the call stack right before the crash on my actual scene.
Please, let me know if you need to see my full code, but it is quite a large scene that uses the SofaCarving and Geomagic plugin.
DavacasBlockedI have partially fixed this issue by adding a MeshTopology, MechanicalObject and IdentityMapping component to my collision node. I know these components are mandatory in most scenes, but I hadn’t added them because the carving examples I consulted didn’t use them.
Now I’m having a different problem, which I’ll be discussing in this entry.
14 May 2021 at 02:45 in reply to: [SOLVED] Force feedback not working correctly when using two haptic devices #19440DavacasBlockedHi, @epernod. Thank you for your fast and concise answer!
Wow, I can’t believe it was this simple! I had deleted that link because I didn’t need it back when I was testing with just one device, but by the time I integrated the second device, I had completely forgotten about it.
Thank you, @Hugo and @epernod for taking the time to answer me. I’m marking the post as solved now.
Have a great day!
20 April 2021 at 03:40 in reply to: [SOLVED] Mesh explodes when using the surfacepressureconstraint #19213DavacasBlockedThanks for the advice, @Hugo. I did make some sort of convergence analysis, but I wasn’t very rigorous about it. As I stated earlier, what really worked for me was turning down the mass, but you’re right: I shouldn’t mess with those parameters. I will try making a more rigorous convergence analysis next time.
5 April 2021 at 07:40 in reply to: [SOLVED] Mesh explodes when using the surfacepressureconstraint #19074DavacasBlockedI had a similar problem and I fixed it by reducing the amount of mass of my mesh, but you have to tune it in order to get a realistic behavior.
Hope this helps!
DavacasBlockedI know I’m over four years late, but I think I solved it and I would like to share my solution for anyone who’s having the same problem.
<?xml version="1.0" ?> <Node name="root" dt="0.05" showBoundingTree="0" gravity="0 0 0"> <RequiredPlugin name="SofaOpenglVisual"/> <RequiredPlugin name='SofaMiscCollision'/> <RequiredPlugin name="Geomagic"/> <RequiredPlugin name='SofaHaptics'/> <RequiredPlugin name="SofaCarving" /> <VisualStyle displayFlags="" /> <DefaultPipeline verbose="0" /> <BruteForceDetection name="N2" /> <DefaultContactManager name="response" response="FrictionContact" /> <MinProximityIntersection name="Proximity" alarmDistance="0.08" contactDistance="0.05" useSurfaceNormals="false"/> <LocalMinDistance name="proximity" alarmDistance="0.15" contactDistance="0.05" angleCone="0.1" /> <GeomagicDriver name="GeomagicDevice" deviceName="Default Device" scale="1" drawDevice="0" drawDeviceFrame="0" positionBase="1 0 5" orientationBase="0 0 0 1" /> <LCPConstraintSolver tolerance="0.001" maxIt="1000"/> <FreeMotionAnimationLoop/> <CarvingManager active="true" carvingDistance="0.1"/> <Node name="Tumor"> <EulerImplicitSolver name="cg_odesolver" printLog="false" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1.0e-9" threshold="1.0e-9" /> <MeshGmshLoader name="loader" filename="./Modelos/MSH/TumorLimpio500faces_2.msh" /> <MechanicalObject src="@loader" name="Volume" /> <include href="Objects/TetrahedronSetTopology.xml" src="@loader" /> <DiagonalMass massDensity="1" /> <TetrahedralCorotationalFEMForceField name="CFEM" youngModulus="360" poissonRatio="0.3" method="large" /> <FixedConstraint indices="180 200 212 148 203 215 228 155 193 232 99 134 12" /> <PrecomputedConstraintCorrection recompute="true"/> <Node name="T"> <include href="Objects/TriangleSetTopology.xml" /> <Tetra2TriangleTopologicalMapping input="@../Container" output="@Container" /> <TriangleCollisionModel tags="CarvingSurface"/> <Node name="Visual"> <OglModel name="VisualModel" color="red"/> <IdentityMapping input="@../../Volume" output="@VisualModel" /> </Node> </Node> </Node> <Node name="Omni"> <MechanicalObject template="Rigid3d" name="DOFs" position="@GeomagicDevice.positionDevice"/> <MechanicalStateController template="Rigid3d" listening="true" mainDirection="-1.0 0.0 0.0" handleEventTriggersUpdate="true"/> </Node> <Node name="Instrument" > <EulerImplicitSolver name="cg_odesolver" printLog="false" /> <CGLinearSolver iterations="25" name="linear solver" tolerance="1.0e-9" threshold="1.0e-9" /> <MechanicalObject template="Rigid3d" name="instrumentState" position="@GeomagicDevice.positionDevice" /> <UniformMass name="mass" totalMass="0.5" /> <LCPForceFeedback activate="true" forceCoef="3"/> <!-- ADDED : Compute a force-feedback for the device --> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <MeshObjLoader name="meshLoader_0" filename="mesh/dental_instrument_light.obj" translation="-0.412256 -0.067639 3.35" rotation="180 0 150" handleSeams="1" /> <OglModel name="InstrumentVisualModel" src="@meshLoader_0" /> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MechanicalObject name="Particle" position="-0.2 -0.2 -0.2" /> <PointCollisionModel name="ParticleModel" contactStiffness="2" tags="CarvingTool" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@Particle" /> </Node> </Node> </Node>
This should let you touch a tetrahedron, give some haptic feedback and almost immediately make that tetrahedron and the feedback disappear, simulating carving and touching all at once.
DavacasBlockedHello, everyone.
I think I’m having the same doubt as Sen. I have a scene where I can carve and interact with an object with my mouse, but I would like to do both things a Phantom Device, like this. At the moment, I can interact with the object and get force feedback with the Phantom device, but I don’t know how to make the carving work.
I found that you should be able to do this with the SofaCarving plugin, but I can’t find any information about it, so any pointers would be very appreciated.
To answer Hugo’s questions, yes, I can move the Phantom in the scene, I do get force feedback and I’m not getting any errors or warnings in the console.
Thanks in advance!
-
AuthorPosts