Forum Replies Created
-
AuthorPosts
-
SarathBlocked
Hi Hugo,
Sorry to confuse you, But the basic Idea is We recover the information from the Device ( the geomagic/Omni/hapticdevice) , the same 3D position information as we do for geomagic plugin , from VRPN instead ( this is because the device is not local to the machine). VRPN transmits this information in realtime through TCP/IP , The deprecated VRPN plugin doesn’t have the required code for doing this, however it does have the basic structure to implement VRPN in sofa. The process looks like this
(VRPN)
Local Machine ——————> Computing grid (This is one way scenario)
(Haptic Device)_________________(SOFA software)The 2 way scenario is quite complex and it probably require some code on the local machine as well to sync the feed back to the haptic device . But this is the basic idea. Hope this illustrates the problem a bit.
SarathBlockedHi hugo,
Great it works!. I am a bit surprised as I thought it might need some lines of code for the mouse to be engaged. I say this because I was hoping I could find the related lines and implement the same for the Haptic device . Now, I guess I will look into the Geomagic example but my issue is that I am not using the geomagic locally , I would be using it over vrpn , and I see that no code has been developed for it so that this could be achieved ( i.e. using the haptic device locally and sofa on a remote desktop). I will try to develop something, but I have a small doubt in this regard, as far as I can understand the Mechanical state controller is what drives mechanical objects in sofa , I see these used in the geomagic example as well, as shown below :
(taken from Geomagic-FEMliver.scn)
<!-- ADDED: the Mechanical state Controller gathers events from the Omni driver and populates the Mechanical state --> <Node name="Omni"> <MechanicalObject template="Rigid" name="DOFs" position="@GeomagicDevice.positionDevice"/> <MechanicalStateController template="Rigid" listening="true" mainDirection="-1.0 0.0 0.0" handleEventTriggersUpdate="true"/>
Could you may be in brief explain the usage of this and how it would access the drivers of geomagic?.
I do have an example in the deprecated SofaVRPNCLient , but its not related to haptic device , it is related to something called VRPN imager which deals with image transmission over VRPN, it looks something like this (which is kind of similar to the Mechanical state controller).
(taken from VRPNImagerRigidPhysics.scn (Deprecated))
<Node name="tracking"> <VRPNImager name="imageData" template="Rigid" listening="true" serverName="192.170.207.244" serverPort="3883" deviceName="TestImage" /> </Node> <Node name="proxy"> <!--<TransformEngine name="transform" template="Rigid" rotation="0 0 0" translation="0.42 0.095 0" scale="1.0 1.0 1.0" input_position="@../tracking/imageData.rigidPosition"/> <MechanicalObject name="mechCenterTool" template="Rigid" position="@[-1].output_position" debugViewIndices="true" />-->
I hope I am not confusing you, I am just trying to understand how geomagic is implemented so I could do something similar with vrpn , write some code if needed in this regard. My hope is that I might have to do something like this :
<Node name="tracking"> <VRPNButton name="Phantom" template="Rigid" listening="true" serverName="192.170.xxx.xxx" serverPort="3883" deviceName="Phantom0" /> </Node>
But I am not sure of this. Let me know your thoughts on this .
Thank you.
SarathBlockedHi Hugo,
I tried to implement the above scene but for some reason my mouse is not being associated with the sphere , is it because of some driver issue? or is there a way in the software to assign the object to the mouse?. I forgot to mention I am running sofa remotely on a computing grid is that why this is happening ? . If anyone has done this before please let me know .
Thank you.
SarathBlockedUpdate,
I am still haven’t found any useful info anywhere , it would be of great help if anyone could post some relevant info on this .
Thank you.
SarathBlockedHi Hugo,
Great News, we were finally able to build and load the SofaVRPNClient . We were able to establish connection with a Server as well. We loaded the example that was available called VRPNImagerRigidPhysics1.scn, it established connection with our local machine. While we don’t exactly and fully know what the example is about and we don’t know how these xml or scn scenes work, we are studying sofa and trying to use these examples, a well documented User manual would really help speed the process. We are now working in the direction of establishing a working connection with a haptic device while sofa runs on a grid . As per your suggestion we would place a pull-request soon on Git, for anyone who is planing on using sofavrpn, I believe this would be really helpful .
Thank you.
SarathBlockedHi Hugo,
Thanks this is what we need , i think. We will try to edit this FindVRPN.cmake and add it and then configure and see what happens .
Thank you.
SarathBlockedHi hugo,
We built vrpn before, infact we already have the built vrpn but not in the same directory,
the question here is dose VRPN needs to be built along with sofa or should we just simply copy the built folder into the sofa build directory, even if we do this there is no vrpn_quat directory , there is however a quat directory within vrpn build it has a libquat.a . I will try your suggestion and build vrpn again within the sofa build and let you know if i will get any error .Thank you.
SarathBlockedHi Hugo,
I believe the library project does not exist , i tried to search for vrpn_quat in the build there was nothing by that name. We are thinking it needs to be built, but how ? and what is the source for these library project.
Thank you
SarathBlockedHii Hugo,
We have some good news, we were almost able to build the plugin, we discoverd what was causing the error default type as mentioned before
[100%] Building CXX object applications/plugins/SofaVRPNClient/CMakeFiles/SofaVRPNClient.dir/VRPNImager.cpp.o In file included from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.inl:34, from /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.cpp:34: /project/rcc/sofa2/src/sofa-15.12/applications/plugins/SofaVRPNClient/VRPNImager.h:139: error: \u2018defaulttype\u2019 was not declared in this scope
This error was caused because the defaulttype belongs to the namespace sofa , hence it should be sofa::defaulttype instead in the code,also there were minor corrections regarding the namespace sofavrpn, all these changes were made in the VRPNImager.h, we also resolved other issues related to openGL coming from VRPNImager.inl. However we are stuck with the only one issue which stems from the cmakelist of the plugin(SofaVRPNClient)
target_link_libraries(${PROJECT_NAME} SofaCore SofaSimulationCommon vrpn_quat vrpn_client) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SOFAVRPNCLIENT")
here you see that vrpn_quat and vrpn_client are metioned , sofa is unable to link those target libraries because they are not present in the plugin src folder , we dont exactly know what they are (are they libraries? , headers? or folders?) . We just need to know what they are and how to obtain them so that sofa can link them and build the plugin
Once we build the plugin we will post the changes made in the VRPNImager.h and VRPNImager.inl and also pull-request on github, this is the only issue left so please provide a fix at the earliest (we are currently assuming that the actual vrpn needs to be built parallel with sofa from which these vrpn_quat and client will be detected and linked).Awaiting your response .
Thank you.
SarathBlockedHii Hugo,
We have a little update regarding the VRPN plugin, So we think that the error while trying to build the plugin stems from the VRPNImager.h Specifically from the line 141(and 143),
extern template class SOFA_SOFAVRPNCLIENT_API VRPNImager<defaulttype::Vec3dTypes>;
the defaulttype needs a sofa:: infront of it
extern template class SOFA_SOFAVRPNCLIENT_API VRPNImager<sofa::defaulttype::Vec3dTypes>;
However this causes another error because of the SOFA_SOFAVRPNCLIENT_API template. We are not sure how to resolve this.
There is another plugin called Flexible, and in it there is a header file called FlexibleTetrahedronFEMForceField.h
it is almost same as this VRPNimager.h. The Flexible plugin builds perfectly and we are able to use it . We want to know how was this plugin built, so that we could use the same proceedure for this VRPN as they both seem very similar . As an example a line from that FlexibleTetrahedronFEMForcField.h
extern template class SOFA_Flexible_API FlexibleTetrahedronFEMForceField<defaulttype::Vec3fTypes>;
Could you provide some details on how plugins were written , how they access the sofa core libraries, what type of namespaces and templates were created and how they were used , specifically for this flexible and vrpn plugin (we already tried the Myplugin tutorial it is not that relevant to this problem i believe ).
Thankyou.
SarathBlockedHi Hugo,
We are on Scientific Linux.Yeah we tried the NO_BOOST_CMAKE., in that document we mentioned that, but after config and generating in Cmake , we had problem while making(building) , the error was from Fileinfo.h.
[ 8%] Building CXX object SofaKernel/SofaFramework/SofaHelper/CMakeFiles/SofaHelper.dir/StateMask.cpp.o In file included from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/Message.h:38, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/MessageDispatcher.h:30, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/Messaging.h:81, from /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/LCPcalc.cpp:24: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:57: error: function definition does not declare parameters /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:58: error: function definition does not declare parameters /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfo::FileInfo(const char*, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:59: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018filename\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:59: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018line\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfo::FileInfo()\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:62: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018filename\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:62: error: class \u2018sofa::helper::logging::FileInfo\u2019 does not have any field named \u2018line\u2019 /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfoOwningFilename::FileInfoOwningFilename(const char*, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:71: error: \u2018filename\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:72: error: \u2018line\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In constructor \u2018sofa::helper::logging::FileInfoOwningFilename::FileInfoOwningFilename(const std::string&, int)\u2019: /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:78: error: \u2018filename\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h:79: error: \u2018line\u2019 was not declared in this scope /project/rcc/sofa/v17.06/src/SofaKernel/framework/sofa/helper/../../sofa/helper/logging/FileInfo.h: In destructor \u2018sofa::helper::logging::FileInfoOwningFilename::~FileInfoOwningFilename()\u2019:
it seems internal, i will try to compare it with the older version which compiled well , maybe notice some differences .
SarathBlockedI am not sure if you check the link , we also have problems with the sofa build itself (not the plugin), i am just pasting the link again
https://docs.google.com/document/d/1xDNJW5Wz1vedRQYqwbUhjOELk8Sbgf6kmI8l0V0o7TU/edit
Thank you.
SarathBlockedHi Hugo,
Thank you so much for replying. We had problems building SOFA itself with the newer version (V17.06 release). So we resorted to using the older versions. Also my understanding is the plugin named SofaVRPNClient is DEPRICIATED so it may not be compatible with newer builds. Now that you have suggested us to use the latest , we tried to build it again. Building v17.06 linux
This was the procedure we followed . Could you let us know where we went wrong .
Thank you .
-
AuthorPosts