Home › Forum › SOFA › Using SOFA › [SOLVED] Sensable Plugin Example Problems
Tagged: 64_bits, SOFA_1512, Windows_10
- This topic has 12 replies, 4 voices, and was last updated 8 years, 1 month ago by Hugo.
-
AuthorPosts
-
1 March 2016 at 11:51 #5996KorcanBlocked
Hi,
I compiled sensable plugin and trying to run examples in Sensable/Examples folder.
But when i tried to run im getting
FROM SOFA [OUT] >> [INFO] [PluginManager] Loaded plugin: C:/Users/RoketWorks Korcan/Desktop/sofa/master/src/build/bin/Release/Sensable.dll FROM SOFA [OUT] >> [INFO] [PluginManager] Loaded plugin: C:/Users/RoketWorks Korcan/Desktop/sofa/master/src/build/bin/Release/SofaCarving.dll FROM SOFA [OUT] >> [WARNING] [DAGNode] ERROR parsing Link "": empty path. FROM SOFA [ERR] >> [ERROR] FROM SOFA [OUT] >> [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] Creation of EnslavementForceFeedback CollisonListener failed because no Collision Model links are found: "" and "" [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] Creation of EnslavementForceFeedback CollisonListener failed because no Collision Model links are found: "" and "" [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] Creation of EnslavementForceFeedback CollisonListener failed because no Collision Model links are found: "" and "" [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] ERROR parsing Link "": empty path. [WARNING] [DAGNode] Creation of EnslavementForceFeedback CollisonListener failed because no Collision Model links are found: "" and "" FROM SOFA [ERR] >> [DAGNode "CollisionModel"] Object type "EnslavementForceFeedback" creation Failed [ERROR] [DAGNode "CollisionModel"] Object type "EnslavementForceFeedback" creation Failed FROM SOFA [OUT] >> [WARNING] [InteractiveCamera] Too many missing parameters ; taking default ... FROM SOFA [ERR] >> LOAD ERROR: Node initialization failed. Sofa exited safely.
How can i test haptic device ?
Best Wishes,
1 March 2016 at 15:37 #6005KorcanBlockedAlso im using openhaptics 3.4
1 March 2016 at 19:48 #6008KorcanBlockedHey,
I think i found a solution. When you tried to compile NewOmniDriver.cpp it gives you
” NewOmniDriver: GNode cannot access protected member” Error.
I made changes on topic based on remibessard’s reply.
But when i debugged it gives me error on this line on NewOmniDriver.cpp
if (parentRoot->getFirstParent()) parentRoot = dynamic_cast<sofa::simulation::tree::GNode*>(parentRoot->getFirstParent());
2 March 2016 at 08:16 #6012GuillaumeKeymasterHi Korcan,
Glad you found some track in NewOmniDriver topic by yourself.
About your new error, what is the error exactly ?
Did you check the return value of the dynamic_cast ?parentRoot
may be NULL.EDIT : I just tried to replace
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ if (parentRoot->getFirstParent()) parentRoot = dynamic_cast<sofa::simulation::tree::GNode*>(parentRoot->getFirstParent());
and it went well π
Cheers,
Guillaume.2 March 2016 at 10:40 #6022KorcanBlockedHi Guillaume,
I have touch 3d stylus model. I tried open haptics sdk and it works well. Which open haptics sdk you are using ?
Edit:
ParentRoot looks NULL
http://prntscr.com/aa74x9parent variable is not null but after casting Gnode* parentRoot looks null.
Best Wishes,
Korcan2 March 2016 at 14:27 #6025GuillaumeKeymasterI just installed Open Haptics SDK 3.4.0 to help in this topic but since I am not programming with Haptics I just tested building Sensable plugin.
If parentRoot is NULL, is is apparently not a GNode (that’s weird).
Are you working with DAGNode ?Here is a more generic way to do the omniVisu Node creation :
parent = dynamic_cast<simulation::Node*>(this->getContext()); //sofa::simulation::tree::GNode *parentRoot = dynamic_cast<sofa::simulation::tree::GNode*>(this->getContext()); sofa::simulation::Node *parentRoot = parent; //if (parentRoot->getFirstParent()) // parentRoot = dynamic_cast<sofa::simulation::tree::GNode*>(parentRoot->getFirstParent()); if (parentRoot && parentRoot->getFirstParent()) parentRoot = dynamic_cast<sofa::simulation::Node*>(parentRoot->getFirstParent()); nodePrincipal= parentRoot->createChild("omniVisu "+deviceName.getValue());
2 March 2016 at 16:40 #6030KorcanBlockedIt works π
Right now different parts of newomnidriver creating exceptions π
When i click animate button i am getting this error.
http://prntscr.com/aabbgbAlso i have to change :
hHDVector[i] = hdInitDevice(autreOmniDriver[i]->deviceName.getValue().c_str());
to
hHDVector[i] = hdInitDevice(HD_DEFAULT_DEVICE);
Otherwise it’s not initializing device. And i have only 1 device for that reason i can use default device constant.
Edit :
sofa::helper::WriteAccessor<sofa::core::objectmodel::Data<VecCoord> > x = *DOFs->write(this->setRestShape.getValue() ? sofa::core::VecCoordId::restPosition() : sofa::core::VecCoordId::position()); sofa::helper::WriteAccessor<sofa::core::objectmodel::Data<VecCoord> > xfree = *DOFs->write(this->setRestShape.getValue() ? sofa::core::VecCoordId::restPosition() : sofa::core::VecCoordId::freePosition()); unsigned int index = 0; x [index].getCenter()=world_H_virtualTool.getOrigin(); xfree[index].getCenter()=world_H_virtualTool.getOrigin(); x [index].getOrientation()=world_H_virtualTool.getOrientation(); xfree[index].getOrientation()=world_H_virtualTool.getOrientation();
Problem in this line
xfree[index].getCenter()=world_H_virtualTool.getOrigin();
I am going to update this post
When you comment out xfree lines it works fine π But it must be caused somethink else. im searching.
3 March 2016 at 14:38 #6040NguyenBlockedI know this problem.
You have to set free_position in the MechanicalObject in your scene file. This MechanicaObject is mapped to your haptic via tagging i.e. using the same tag as OmniDriver.
In old version, sofa initialize free_position for you, now it doesnt.
4 March 2016 at 04:03 #6043KorcanBlockedThanks again but still im getting same error. Can you share your carving example if you have a time ?
4 March 2016 at 18:31 #6045NguyenBlockedsomething like this:
<EulerImplicit name="cg odesolver" printLog="false" rayleighStiffness="0.01" rayleighMass="1"/> <CGLinearSolver iterations="100" name="linear solver" threshold="1e-20" tolerance="1e-20" /> <MechanicalObject template="Rigid3d" name="instrumentState" position="10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1" free_position="10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1 10 10 10 0 0 0 1"/> <UniformMass template="Rigid3d" name="mass" totalmass="0.1" /> <LCPForceFeedback activate="true" tags="Omni1" forceCoef="0.5" />
29 March 2016 at 14:17 #6391GuillaumeKeymasterThanks for your help here @tuanthienbk π
Any progress on your side @Korcan ?
Do not hesitate to submit some patches if you fixed stuff in Sensable plugin, it would be highly appreciated !Cheers,
Guillaume.29 March 2016 at 14:27 #6392KorcanBlocked@Guillaume i could’nt find enough time to investigate. I solved some of problems but still i have errors. At this point actually im learning how sofa works on code side π
i think i push some patches next week about sensable plugin.
7 November 2016 at 17:38 #7744HugoKeymasterDear Korcan,
As announced previously, we just released a Geomagic plugin dedicated to latest haptic devices Geomagic:
- pull this new plugin by updating your SOFA
- find the plugin on GitHub: sofa/applications/plugins/Geomagic/
- refer to the associated commits (747d720 and b945d51)
This plugin is compatible for both Linux and Windows.
Please, give us feedback about it!
Hope this will help you in your work,Cheers,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.