Forum Replies Created
-
AuthorPosts
-
BEKBlocked
Hi @Hugo
Thank you for your reply.1. okey, I will build the latest version of SOFA(v19.06) and
try to compile SofaCUDA plugin again2. (at SOFA v17.06 branch)
After I applied the plugin SofaCUDA,
“UncoupledConstraintCorrection” or “PrecomputedConstraintCorrection” components doesn’t work in the scene.error message:
[ERROR] [DAGNode “Liver”] Object type “PrecomputedConstraintCorrection” creation Failed
[ERROR] [DAGNode “Liver”] Object type “UncoupledConstraintCorrection” creation Failed3. I use <TriangleModel template=”CudaVec3f”/>, it works!
Thank you!BEKBlockedHi @Binesh
Finally, it works perfectly!
Now I can close this topic.
Thank you!!Best,
BaeBEKBlockedI got some update. I solved one and got another problem.
As @Binesh said, the problems happened on handleTopologyChanged() for UncoupledConstraintCorrection.
I still not sure what is compliance Data (and why the size of compliance Data is zero when I remove points), so I blocked that part as a temporary measure.
Then, the first/last point is removed very well when I put the uncoupledConstraint.
Anyway, the problem was solved temporarily.Secondly, I put IdentityMapping on the thread for visual model mapping, it works little strange way.
This is video link: https://www.dropbox.com/s/3xko0gi9zl8ntzo/RemovingAdding%20Point_withMapping.mp4?dl=0This is changed thread scn:
<Node name="beamsprings"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.01" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <MeshGmshLoader name="meshLoader" filename="knot_/PointLine10gmesh.msh" createSubelements="true" /> <include href="Objects/EdgeSetTopology.xml" src="@meshLoader" /> <MechanicalObject translation="1 0 2"/> <UniformMass mass="1" /> <FixedConstraint name="FixedConstraint" indices="0 1" /> <UncoupledConstraintCorrection /> <MeshSpringForceField name="Springs" stiffness="100000" damping="0" /> <Line tags="thread GraspingSurface" /> <Point /> <Node name="Visual"> <OglModel name="VisualModel" src="@../meshLoader" lineWidth="6" lineSmooth="1"/> <IdentityMapping input="@.." output="@VisualModel" /> </Node> </Node>
It seems like the last index didn’t update.
Now, I will check handleTopologyChange() in IdentityMapping.inl.Give me advice.
Thank you all!Best Wishes,
BaeBEKBlockedThank you @Binesh
I will check uncoupledConstraintcorrection.
Best,
BaeBEKBlockedThank you for comments
I can’t solve this problem yet.
As epernod mentioned, the problem happened only when I remove the first/last element with uncoupledConstraint.
I also deleted FixedConstraint but it has still same crash.I tired to look at uncoupledconstraintcorrection now (but difficult).
I attached my gmsh file -> https://www.dropbox.com/s/hr2imbxnpc3yfsp/PointLine10gmesh.msh?dl=0This is error message
Before Edge : 9 Before Point : 10 removeItemsFromLineModel2() [ERROR] [vector] in vector<double> cfc3ad80 size 0 : invalid index -1 61: sofa::helper::BackTrace::dump - 0x7ffa3b65896060: sofa::helper::vector_access_failure - 0x7ffa3b8fa35059: sofa::helper::vector<double,sofa::helper::CPUMemoryManager<double> >::operator[] - 0x7ffa135ef87058: sofa::component::constraintset::UncoupledConstraintCorrection<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3,double>,sofa::defaulttype::Vec<3,double>,double> >::handleTopologyChange - 0x7ffa1397b1a057: sofa::core::objectmodel::BaseObject::handleTopologyChange - 0x7ffa1b4138d056: sofa::simulation::TopologyChangeVisitor::processTopologyChange - 0x7ffa3dcd12e055: sofa::simulation::Visitor::for_each<sofa::simulation::TopologyChangeVisitor,sofa::simulation::Node,sofa::simulation::Node::Sequence<sofa::core::objectmodel::BaseObject,1>,sofa::core::objectmodel::BaseObject> - 0x7ffa3dcd1ca054: sofa::simulation::TopologyChangeVisitor::processNodeTopDown - 0x7ffa3dcd13f053: sofa::simulation::graph::DAGNode::executeVisitorTopDown - 0x7ffa5765a35052: sofa::simulation::graph::DAGNode::doExecuteVisitor - 0x7ffa57659b7051: sofa::simulation::Node::executeVisitor - 0x7ffa3dbc6e7050: sofa::component::topology::PointSetTopologyModifier::propagateTopologicalChanges - 0x7ffa10cf021049: sofa::component::topology::EdgeSetTopologyModifier::removeEdgesProcess - 0x7ffa10b24d1048: sofa::component::topology::EdgeSetTopologyModifier::removeEdges - 0x7ffa10b2732047: sofa::AsanManager::component::collision::CuttingTopologicalChangeManager::removeItemsFromLineModel2 - 0x7ffa35cc1b6046: sofa::AsanManager::component::collision::CuttingTopologicalChangeManager::removeItemsFromCollisionModel - 0x7ffa35cc0c7045: sofa::AsanManager::component::collision::CuttingTopologicalChangeManager::removeItemsFromCollisionModel - 0x7ffa35cc0bc044: sofa::AsanManager::component::collision::CuttingManager::doCut_test - 0x7ffa35c7c00043: sofa::AsanManager::component::collision::CuttingManager::handleEvent - 0x7ffa35c7a3a042: sofa::simulation::PropagateEventVisitor::processObject - 0x7ffa3dcbc39041: sofa::simulation::Visitor::for_each<sofa::simulation::PropagateEventVisitor,sofa::simulation::Node,sofa::simulation::Node::Sequence<sofa::core::objectmodel::BaseObject,1>,sofa::core::objectmodel::BaseObject> - 0x7ffa3dcbc46040: sofa::simulation::PropagateEventVisitor::processNodeTopDown - 0x7ffa3dcbc31039: sofa::simulation::graph::DAGNode::executeVisitorTopDown - 0x7ffa5765a35038: sofa::simulation::graph::DAGNode::doExecuteVisitor - 0x7ffa57659b7037: sofa::simulation::Node::executeVisitor - 0x7ffa3dbc6e7036: sofa::simulation::Node::propagateEvent - 0x7ffa3dbcb3a035: sofa::gui::qt::viewer::qgl::QtGLViewer::keyPressEvent - 0x7ffa18ccaa8034: QGestureEvent::~QGestureEvent - 0x7628328633: QGLFunctions::glUniform3iv - 0x505136cf32: QGestureEvent::~QGestureEvent - 0x7628328631: QGestureEvent::~QGestureEvent - 0x7628328630: QBitArray::size - 0x756ad92b29: QBitArray::size - 0x756ad92b28: QGestureEvent::~QGestureEvent - 0x7628328627: QGestureEvent::~QGestureEvent - 0x7628328626: QGestureEvent::~QGestureEvent - 0x7628328625: QGestureEvent::~QGestureEvent - 0x7628328624: QBitArray::size - 0x756ad92b23: QBitArray::size - 0x756ad92b22: QOpenGLFunctions_4_2_Core::glProgramUniform1d - 0x7ffa0ed63cd521: QOpenGLFunctions_4_2_Core::glProgramUniform1d - 0x7ffa0ed63cd520: QOpenGLFunctions_4_2_Core::glProgramUniform1d - 0x7ffa0ed63cd519: qt_plugin_query_metadata - 0x7ffa0e3366db18: QBitArray::size - 0x756ad92b17: CallWindowProcW - 0x7ffa7c3e680016: DispatchMessageW - 0x7ffa7c3e64c015: QBitArray::size - 0x756ad92b14: qt_plugin_query_metadata - 0x7ffa0e3366db13: QBitArray::size - 0x756ad92b12: QBitArray::size - 0x756ad92b11: QBitArray::size - 0x756ad92b10: QOpenGLFunctions_4_2_Core::glProgramUniform1d - 0x7ffa0ed63cd59: QGestureEvent::~QGestureEvent - 0x762832868: sofa::gui::qt::RealGUI::mainLoop - 0x7ffa188d81707: sofa::gui::GUIManager::MainLoop - 0x7ffa3f482a706: main - 0x7ff75b6e42205: invoke_main - 0x7ff75b70f8504: __scrt_common_main_seh - 0x7ff75b70f6203: __scrt_common_main - 0x7ff75b70f6002: mainCRTStartup - 0x7ff75b70f8a01: BaseThreadInitThunk - 0x7ffa7c8a30200: RtlUserThreadStart - 0x7ffa7cb61410Assertion failed: i < size, file D:\RMX\sofa\v17.06\src\SofaKernel\framework\sofa\helper\vector.cpp, line 45
Thank you.
BaeBEKBlockedDear. Erik @epernod
Thank you for your comments.
I tried to test several ways. I think half was successful.1. Following your advice, I rewrite scn
<Node name="beamsprings-pointset"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.01" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <EdgeSetTopologyContainer name="Container" points="0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0" edges="0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9" /> <EdgeSetTopologyModifier name="Modifier" /> <EdgeSetTopologyAlgorithms template="Vec3d" name="TopoAlgo" /> <EdgeSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1"/> <MechanicalObject name="DOFs" template="Vec3d" translation="1 0 2" src="@Container" /> <UniformMass mass="1" /> <FixedConstraint name="FixedConstraint" indices="0 1" /> <!-- <MeshSpringForceField name="Springs" stiffness="100000" damping="0" /> --> <!-- <LineBendingSprings name="BS" stiffness="100" damping="0" /> --> <!-- <UncoupledConstraintCorrection /> --> <Line tags="thread GraspingSurface" /> <Point /> <OglModel name="VisualModel" color="red" /> --> <IdentityMapping input="@." output="@VisualModel" /> --> </Node>
However, the problem occurred the same as previous results.
It’s clear that the problem of topology visitor.
I also remove MeshSpringForceField and UncoupledConstraintCorrection on scn file
but, still has same problems.
I don’t know how to fix it, now..So, I look up the examples of sofa (in Components\topology\TopologicalModifiers)
and I think I need msh file for point-line model.
The structure to change topology looks like that three elements needed.
– MeshGmshLoader /with msh file
– EdgeSetTopology.xml src from name of MeshGmshLoader
– MechanicalObject src from name of MeshGmshLoaderSo I made msh file consist of 9 lines and 10 points (same as I made above) using Gmsh program.
2. Design new msh model using MeshGmshLoader
This is my new scn code:<Node name="beamsprings"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.01" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <MeshGmshLoader name="meshLoader" filename="knot_/PointLine10gmesh.msh" createSubelements="true" /> <include href="Objects/EdgeSetTopology.xml" src="@meshLoader" /> <MechanicalObject name=DOFs translation="1 0 2"/> <UniformMass mass="1" /> <FixedConstraint name="FixedConstraint" indices="0 1" /> <MeshSpringForceField name="Springs" stiffness="100000" damping="0" /> <UncoupledConstraintCorrection /> <Line tags="thread GraspingSurface" /> <Point /> <OglModel name="VisualModel" color="red" /> <IdentityMapping input="@." output="@VisualModel" /> <Node />
1) Deleting the last index
Without UncoupledConstraintCorrection, then it works. Yeah. lol
video. https://www.dropbox.com/s/86umn0zmxs7r1wf/180803_DeleteLastIndex.mp4?dl=0But as I know Uncoupledconstraintcorrection should be needed when I use Phantom Omni at the same scn.
So I solve the problem one and have another new problem (T.T)
How can I modify the Uncoupledconstraintcorrection to handle topolocial changes?2) Deleting middle index
Deleting middle of edge index is working with/without Uncoupledconstraintcorrection, MeshSpringForceField
But edge is removed but mesh spring forcefield isn’t (same as previous results). It linked across the edges.
video. https://www.dropbox.com/s/c66wbgo7ffs3kes/180803_DeleteMiddelIndex.mp4?dl=0Is that related Comp file? next, I will try this way.
Give me more advice to me!
Thanks!Best Wishes,
BEK2 August 2018 at 10:15 in reply to: [SOLVED] Collision problems in grasping using Phantom omni #11630BEKBlockedOh, I solved the problems to add “Bilateral interaction constraints” between two collision models. I changed the states.
Thanks.
BEKBlockedHi all,
I got this problem from metheme. I applied the advice that @Binesh , @epernod said. sadly, it doesn’t work.I tried some experiments using simple point-line model (back to the basic…)
This is scn code that I tested:
<Node name="beamsprings"> <EulerImplicitSolver rayleighStiffness="0.01" rayleighMass="0.01" /> <CGLinearSolver template="GraphScattered" iterations="20" threshold="1e-008" tolerance="1e-5" /> <Mesh name="lines" points="0 0 0 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 9 0 0" lines="0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9" /> <MechanicalObject name="DOFs" template="Vec3d" translation="1 0 2" src="@lines" /> <UniformMass mass="1" /> <FixedConstraint name="FixedConstraint" indices="0 1" /> <MeshSpringForceField name="Springs" stiffness="100000" damping="0" /> <!-- <LineBendingSprings name="BS" stiffness="100" damping="0" />--> <UncoupledConstraintCorrection /> <EdgeSetTopologyContainer name="Container" src="@lines" tags=" " /> <EdgeSetTopologyModifier name="Modifier" /> <EdgeSetTopologyAlgorithms template="Vec3d" name="TopoAlgo" /> <EdgeSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" drawEdges="1"/> <Line tags="thread" /> <Point /> <OglModel name="VisualModel" color="red" /> <IdentityMapping input="@." output="@VisualModel" /> </Node>
Number of Points: 10
Number of Edges: 9Removing edge code are almost same as above.
std::set< unsigned int > items; items.insert(8); //delete Edge index 9, which is last edge sofa::helper::vector<unsigned int> vitems; vitems.reserve(items.size()); vitems.insert(vitems.end(), items.rbegin(), items.rend()); sofa::component::topology::EdgeSetTopologyModifier* topoMod; topo_curr->getContext()->get(topoMod); if (topoMod) { topoMod->removeItems(vitems); //topoMod->removeEdges(vitems, true, true); topoMod->notifyEndingEvent(); topoMod->propagateTopologicalChanges(); return true; }
Firstly, I set a deleted edge 8, which is last index of edge.
https://www.dropbox.com/s/jxgnoihiki7e1eg/edge_remove.jpg?dl=0I got error message.
https://www.dropbox.com/s/19rvpg6ti3hssgs/edge_remove_error.jpg?dl=0I tried to debug code but I couldn’t understand exactly due to lack of knowledge.
I guess, This problem occurred in propagateTopologicalChanges(), EdgeSetTopologymodifier.cpp, in line 277.
As I understand, vertex linked the edges should be removed after edge removal but it doesn’t work due to interrupt propagateTopologicalChanges().
In propagateTopologicalChanges(), the problem is related ExecuteVisitor.Secondly, I set a deleted edge 6, which is middle edge index.
It works without error because any of point was not to set removed.
By the way, the spring is linked across the disconnected edge, it didn’t separate.
https://www.dropbox.com/s/wv9ts510xm9mlth/edge_remove2.jpg?dl=0I looked up “RemovePrimitivePerformer, InciseAlongPathPerformer”, but those are about the deleted triangle using TrianglesetTolopogyModifier.
Could you give some advice?
Thank you..Best wishes,
BEK21 February 2018 at 03:26 in reply to: [SOLVED] Translating mechanical objects (not working c++) #10554BEKBlockedsorry for late reply.
Thank you Hugo.
As you said, because of mapping, I should move mechanical model instead of collision model.
I solve that problems using BaseMechanicalState.
Thank you for your help!
Best,BEK
7 February 2018 at 12:04 in reply to: [SOLVED] Translating mechanical objects (not working c++) #10467BEKBlockedThank you Weng Bin.
I also has similar problems to translate object in C++, your comment was very helpful.For me, I usually access using tags from collision models.
LIKE this,<PointModel tags="Tool"/>
this code is in the child node.and tried to move this collision model to certain positions using MechanicalObject.
But it doesn’t works.. (looks like back to the initial position)
Should I access parent node to move object?BEKBlockedDear @Hugo
Sorry to late reply.
I tried to asscess c++ code to control self-collision, but I don’t knot how to change or add.This is my thread model I used.
model(PointLine50.obj) only consist of point and line.
I tag on point collision model for control by other tool.<Node name=”springthread”> <Gravity name=”R_Gravity” gravity=”0 0 0″ /> <EulerImplicitSolver rayleighStiffness=”0.01″ rayleighMass=”0.01″ /> <CGLinearSolver template=”GraphScattered” iterations=”20″ threshold=”1e-008″ tolerance=”1e-5″ /> <MeshTopology name=”Mesh” fileTopology=”PointLine50.obj” /> <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>
-
AuthorPosts