Forum Replies Created
-
AuthorPosts
-
FrancoisBlocked
Hi @jnbrunet,
I don’t get the timer output in batch mode with the default scene too. I get the other kinds of output though, like the ones you get by setting
printLog = 1
in various components.Tomorrow I’ll try to investigate if the program reaches
TimerData::print()
, which is where the timer output seems to be printed.François
FrancoisBlockedHi @jnbrunet,
Yes, I included an integer for the sampling frequency. It only prints the times when using the gui. Whenever I add
-g batch
, the times are not printed. Is it normal?Also, is
--computationTimeOutputType json
orljson
supposed to write the times in a file? I can’t find the location of these files, or rather they are created at all.Francois
FrancoisBlockedHi @wzdy4444
I’ve been working on a collision algorithm for a simulation developed at my university. I’m not certain if Sofa has an implementation of continuous collision detection, but there is ways to integrate one with the freeAnimationLoop and the free positions. The part I’ve been struggling with is the response, where I try to use the Lagrange multiplier constraints. I don’t know what you are working on and what you are trying to test. If you tell me about it I might be able to help. Let me know if you have questions.
Regards,
FrancoisFrancoisBlockedHi @hugo,
Sorry for the late reply. I didn’t work on this since July. I had not made progress in preventing objects to penetrate each others using constraints for collision response.
I’ll try to dive more into the theory and math of the solvers, Lagrange multipliers and constraints. I think I need this to understand the code. However, I’m running out of time since I’m supposed to graduate soon.
Do you know who’s familiar with this part of SOFA, and if it’s possible to discuss with them?
Thanks,
François
FrancoisBlockedHi @hugo,
I saw that that the documentation improved a lot over the last few months. Thanks for all the work on this!
So far I made a discrete collision detection algorithm based on spatial subdivision that works well with the correct numerical settings (time step, alarm and contact distance). Now, I’m trying to adapt it to handle continuous collision detection. The idea is to compute the exact time of collision during the step (using linear interpolation of the vertices positions) and then to correct the positions so that the objects don’t go through one another. I’m using the free positions as the end-of-step positions for the linear interpolation. For the collision response, I’m trying to use constraints to correct the positions. It’s mostly this last part that is not clear to me.
Best,
François
FrancoisBlockedHi @hugo,
Sorry for the late reply. It looks like I don’t receive emails anymore when my messages are answered.
I made some progress in the last few weeks. I understood some things about how the freeAnimationLoop and the free positions work. I’m using the freeAnimationLoop with the LCPConstraintSolver. However, I don’t fully understand the math behind the constraint correction and how Delta v^cor is calculated. I’m also not sure what exactly the contacts’ values sent to the contact manager need to be and what the contactDistance does with collision responses using constraints.
My continuous detection almost works, but the times of intersection I calculate seems a little off. Sometimes the intersection falls just before or after the step, letting the objects penetrate even though the point and triangle visibly pass through each other. I wonder if it’s the numerical errors that propagate in the calculations, making the time of intersection a little off. In other cases, I detect an intersection and create a contact, but the constraint correction let the point and triangle penetrate anyway.
I would love to see this continuous collision plugin. Maybe it could help me figure out what I’m doing wrong. I’m available to Skype anytime.
Thank you,
François
FrancoisBlockedHi Hugo,
Thanks for the reply. I added the relevant classes in https://github.com/FrancoisLeonard/SOFA_Custom_CollisionModels. There’s also a scene and its output in output.txt.
I’m mostly interested in solving the error:
[ERROR] [DefaultContactManager(collision response)] Contact default between ScytherPointCollisionModel and ScytherPointCollisionModel creation failed
To add some context, my colleague is working on a cutting algorithm in a library and the plugin is essentially an interface with SOFA. I need to modify the collisionModel’s topology to adapt it to our own surface mesh after it gets cut. I would also like to modify the method that build the bounding volume tree. This is why I’m trying to create my own collision models.
After the initial post, I thought that another way might be to create classes that inherit from SOFA’s PointCollisionModel and TriangleCollisionModel, override the relevant methods, and send the parent classes to the contact manager so that it can recognize them. I didn’t test it yet.
Let me know what you think.
Thanks,
FrançoisFrancoisBlockedHi Hugo,
I will try again with LocalMinDistance.
For the rest_position, I was referring to your previous suggestion to impose the displacement on the rest_position and to add a RestShapeSpringForceField, rather then using LinearMovementConstraint. With what component can I do that?
Thanks,
François
FrancoisBlockedHi @hugo,
Sorry for the late reply. Why do you not advise to use DiscreteIntersection? In my scene, many objects are very close to each other. With proximity intersections, I haven’t been able to set the contact distance small enough so that the objects are not in collision from the start and yet have realistic looking collisions.
Also, how can I impose a displacement on the rest_position?
Best,
Francois
FrancoisBlockedHi,
The displacement is only imposed on one object. I don’t understand why the other object doesn’t deform or get pushed by it. I will try the RestShapeSpringForceField to see what it does.
Meanwhile, I’ve put a simplified scene here.
Thank you,
Francois
FrancoisBlockedI tried to build the master branch, but I get several instances of
In file included from /home/franc/sofa/src/SofaGeneral/../modules/SofaDenseSolver/NewMatMatrix.h:29: /home/franc/sofa/src/modules/SofaDenseSolver/NewMatVector.h:28:10: fatal error: 'newmat/newmatio.h' file not found
I will try to cherry pick all changes in the SofaCUDA plugin.
FrancoisBlockedHi Hugo,
Thanks for the help. With the commit fixing the issue, the code compiles, but runSofa crashes when starting. Here is the trace:
########## SIG 6 - SIGABRT: usually caused by an abort() or assert() ########## -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(sofa::helper::BackTrace::dump()+0x20) [0x7f864c6874b0] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(sofa::helper::BackTrace::sig(int)+0x358) [0x7f864c687a48] -> /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f8648be64b0] -> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f8648be6428] -> /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f8648be802a] -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x99242) [0x7f8649535242] -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xa4e86) [0x7f8649540e86] -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xa4ed1) [0x7f8649540ed1] -> /usr/lib/x86_64-linux-gnu/libstdc++.so.6(__cxa_rethrow+0x49) [0x7f8649541159] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(void std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> > >::_M_construct_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> const&>(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> >*, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> const&)+0xda) [0x7f864c68ad8a] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, sofa::helper::lifecycle::Deprecated, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> > >::map(std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, sofa::helper::lifecycle::Deprecated> > const&)+0x172) [0x7f864c68a032] -> /home/franc/sofa/build/lib/libSofaHelper.so.18.12.01(+0x6f047) [0x7f85dd11b047] -> /lib64/ld-linux-x86-64.so.2(+0x106ca) [0x7f86613476ca] -> /lib64/ld-linux-x86-64.so.2(+0x107db) [0x7f86613477db] -> /lib64/ld-linux-x86-64.so.2(+0x158f2) [0x7f866134c8f2] -> /lib64/ld-linux-x86-64.so.2(+0x10574) [0x7f8661347574] -> /lib64/ld-linux-x86-64.so.2(+0x14db9) [0x7f866134bdb9] -> /lib/x86_64-linux-gnu/libdl.so.2(+0xf09) [0x7f8646700f09] -> /lib64/ld-linux-x86-64.so.2(+0x10574) [0x7f8661347574] -> /lib/x86_64-linux-gnu/libdl.so.2(+0x1571) [0x7f8646701571] -> /lib/x86_64-linux-gnu/libdl.so.2(dlopen+0x31) [0x7f8646700fa1] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(sofa::helper::system::DynamicLibrary::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x1b) [0x7f864c74eccb] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(sofa::helper::system::PluginManager::loadPluginByPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream*)+0x4a) [0x7f864c754daa] -> /home/franc/sofa/build/install/bin/../lib/libSofaHelper.so.18.12.00(sofa::helper::system::PluginManager::readFromIniFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x384) [0x7f864c753fe4] -> /home/franc/sofa/build/install/bin/../lib/libSofaGuiQt.so.18.12.00(sofa::gui::qt::SofaPluginManager::SofaPluginManager()+0x331) [0x7f8660af8631] -> /home/franc/sofa/build/install/bin/../lib/libSofaGuiQt.so.18.12.00(sofa::gui::qt::RealGUI::createPluginManager()+0x21) [0x7f8660a9ed21] -> /home/franc/sofa/build/install/bin/../lib/libSofaGuiQt.so.18.12.00(sofa::gui::qt::RealGUI::RealGUI(char const*)+0x2a4) [0x7f8660a9dae4] -> /home/franc/sofa/build/install/bin/../lib/libSofaGuiQt.so.18.12.00(sofa::gui::qt::RealGUI::CreateGUI(char const*, boost::intrusive_ptr<sofa::simulation::Node>, char const*)+0x31) [0x7f8660a9caa1] -> /home/franc/sofa/build/install/bin/../lib/libSofaGuiCommon.so.18.12.00(sofa::gui::GUIManager::createGUI(boost::intrusive_ptr<sofa::simulation::Node>, char const*)+0x73) [0x7f86605904f3] -> ./runSofa(main+0x401b) [0x414fab] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f8648bd1830] -> ./runSofa(_start+0x29) [0x4105e9] Aborted
-
AuthorPosts