Forum Replies Created
-
AuthorPosts
-
ErwanDouailleBlocked
Thanks for the explanation.
ErwanDouailleBlockedI tested the solution 1 and it works like a charm !
As I understood,
sofa::simulation::getSimulation()->animate(root.get(), 0.01);
may works correctly. But something is not well initialize, right ?
Just trying to understand what is wrong with the animate call.
I will add the solved flag since it works.Thanks !
ErwanDouailleBlockedI’m using a recent one maybe not the latest version (2/3 weeks old).
Here is the source code I’m using :std::stringstream scene1 ; scene1 << "<?xml version='1.0' ?> \n" "<Node name='root'> \n" " <RequiredPlugin name='Communication' /> \n" " <ServerCommunicationZMQ name='zmqSender' job='sender' port='6000' refreshRate='1000'/> \n" " <CommunicationSubscriber name='sub1' communication='@zmqSender' subject='/test' source='@zmqSender' arguments='x'/>" "</Node> \n"; Node::SPtr root = SceneLoaderXML::loadFromMemory ("testscene", scene1.str().c_str(), scene1.str().size()) ; root->init(ExecParams::defaultInstance()); for(unsigned int i=0; i<100; i++) { sofa::simulation::getSimulation()->animate(root.get(), 0.01); }
And here is the result :
[ RUN ] Communication_testZMQ.checkArgumentCreation
[INFO] [PluginManager] Loaded plugin: /home/douaille/SOFA/build-communication-Desktop_Qt_5_9_2_GCC_64bit-Debug/lib/libCommunication_d.so
[WARNING] [DAGSimulation(Simulation)] ERROR in Simulation::animate(): AnimationLoop expected at the root node
[WARNING] [DAGSimulation(Simulation)] ERROR in Simulation::animate(): AnimationLoop expected at the root node*100 didn’t copy everything.
Am I doing something wrong ?
ErwanDouailleBlockedup.
I need help 🙂ErwanDouailleBlockedHey @CamilleK,
I did a fix yesterday about it. Can you try it and let us know if it fix your problem ?
https://github.com/sofa-framework/sofa/issues/561
Edit: Sorry, bad link. Here is the correct one : https://github.com/sofa-framework/sofa/pull/564Thanks in advance for your feedback 🙂
ErwanDouailleBlocked@Hugo, @rOm1, AFAIK some part of this plugin is (or will be) release.
ErwanDouailleBlocked@bgarcial just to let you know than I just fixed the zmq problem we had during the visio.
Let me know if you succeed compiling it and if it works
ErwanDouailleBlockedI have the following concern about of Data type component:
If one component have many Data, is possible concatenate them and send them in only request send? This is of a selective way in one request ZMQ communication socket operation?Or
When the send request is performed, all the Data component are sent without select which of them I would like sent?
You have to select which data you have to send. I will show you this afternoon, it´s easy, and it´s the way we design the plugin.
In this basic diagram I will want draw the workflow
My team is also doing some communication between different sofa, that´s the reason why we design this plugin.
I appreciate your availability …
This will be great. Just a small inconvenient ..
My english language (listening skills) are basic …
Is possible combine the possibility of chat and talk about it?Same for me, don´t worry 😉
ErwanDouailleBlockedHey,
With the communication plugin (this is something that you has been talk to me in all previous messages) we have send these different struct data types from SOFA? Even … We can send struct objects?
Actually no. The communication plugin is design to send sofa’s data of components. In your case :
Data<double> myparam;
Data<std::string>d_address;But we can create on runtime the equivalent of your struct as datas. I guess … We need to test it.
It’s great that you can support me in the install and test process of Communications Plugin. I was slow to respond to this message, but if you want and have availability we can interact via Skype the Tuesday or any day and try perform the installation and test the use.
Your welcome, the more we share/use/critics the communication plugin, better it will be.
Ok, for tuesday 19 3pm UTC ? Hangout (douailleerwan[at]gmail.com) ?
ErwanDouailleBlockedInitially we want send from SOFA the following data characterization:
– Data about of instrument position
In this sense I will think that floats and/or doubles data type is suited …– Data about of collision of instrument user with the simulation scenario.
In this sense, we send information in some vector/array in three dimensions according to x,y,z axes in relation to 3D object models nature.– Haptic feedback
This feedback too with vector/array in three dimensions– Topological changes
Arrays of int type, in relation to id’s of each change in the mesh, in where each id is mapped to x,y,z axes …We did it exactly for the same reasons/objectives.
I know that this questions I already made to you … But, the documentation about of how to use Communication plugin is not clear for me … Can I help in detail the documentation if you want, although is possible that the inconvenient may be just of me and nothing more …
I would like can test the Communication plugin, is just that there is somethings (after of the installation) which I haven’t clear for the moment.
Ok I will be glad to help you, and give github access to the repository as well. Can we organize a skype or whatever call to help you in the communication installation/test/question … ?
I will be available this monday and tuesday. UTC time ?
Thanks for helping
ErwanDouailleBlockedHey,
Sorry I just had a look on this topic for delete it.
It looks like I didn’t use the fullMatrix correctly. I just made it works.you try to implement a matrix on what ?
What is the objectif of the new Champs, the new tenseur, the new space normative you want to build ?
Is it this your FullMatrix ?I tried to implement matrix support for a communication plugin for sofa.
I used fullmatrix for creating new datafield in case the datafield does not exist.You can have a look on the plugin here : https://github.com/sofa-framework/sofa/pull/534
Thanks for helping 😉
ErwanDouailleBlockedHey,
There is some discussion about the communication plugin and it might be include for the next release as an experimental feature.
For the matrix support, as few as i tested it works well.
What kind of information do you need ? 🙂ErwanDouailleBlockedThanks Sarath !
@Hugo, another protocol we could include/merge in sofa communication plugin.ErwanDouailleBlockedSorry didn’t see this answer.
That’s weird. Did you try using my C++ client + the server ?
Just to ensure my cpp files are working well on your machine ?
If both works perfectly together, let me know I will investigate your code in details.ErwanDouailleBlockedHi @bgarcial,
I just did some work around matrix support. Did you try the communication plugin or make progress on your zmq imlpementation ?
ErwanDouailleBlockedHi @erwandouaille, are problems about of libs and configuration settings in my Ubuntu laptop.
I will have to update my sources repositories in relation to install the requirements packages.Most of recent ubuntu release have the libs in their repository. Which ubuntu version are you running ?
Additionally, I am testing and learning how to create a component, associate it a scene and send data components from SOFA. For this last thing I’m using ZMQ.
Of this way I want know a few more of SOFA and ZMQ initially.Cool !
You know about of ZMQ and leverage this, I take the audacity of ask to you the following:
Could you please support me in this inconvenience in relation to send data component via zockets ZWQ.IMO, some part of the answer is in : https://www.sofa-framework.org/community/doc/programming-with-sofa/start-coding/create-your-plugin/
For the received message you have to change the way you convert the message, i guess. But i didn´t use python with zmq so i can´t help you more than this.
Otherwise, there is an already existing c++ client here : https://github.com/SofaDefrost/sofa/tree/sofaCommunication/applications/plugins/Communication/examples/ZMQ/primitives/SenderJust compile it and change the port you want to listen on.
ErwanDouailleBlockedSorry didn´t your latest post.
ERROR] [PluginManager] Plugin loading failed (/home/bgarcial/workspace/sofa/build/v17.06/lib/libZeroMq.so): function initExternalModule() not found
It crashed because you didn´t properly describe your plugin. As I understand from this error message. Ensure your plugins looks like this : https://www.sofa-framework.org/community/doc/programming-with-sofa/start-coding/create-your-plugin/
[OffTopic]
I am try build the SOFACommunication plugin to know more about it and test the samples, but I am setup the environment libs due to I have some problems installing them
Live chat ? What is your problem with libs ? Linux ? Windows (never tested it on win) ?
ErwanDouailleBlockedI want test the Communications plugin samples, How to can I do it?
I mean, in the README.md says some considerations.In relation to them … I have my own local SOFA instance. I will download the SOFA plugin Communications structure directory and I will add in my sofa instance (/applications/plugins/…) and compile it.
Some additional considerations to test some basic samples in which I can test send/receive data from a SOFA scene?
The samples may works well. Ensure you get the good versions of libs. As I already said, I never test it on windows. So maybe you will have to change some cmake stuff. If so, let us know. We will grant you write access to the communication branch.
In the samples there is some cpp files. You just need to compile it to make the related scene works. Or you can send data by yourself on the scene´s protocol port.
– Data about of instrument position
In this sense I will think that floats and/or doubles data type is suited …Works
– Data about of collision of instrument user with the simulation scenario.
In this sense, we send information in some vector/array in three dimensions according to x,y,z axes in relation to 3D object models nature.Works. Actually a vector(should be matrix). Or you can send a non matrix message with x y z parameters and store it in corresponding x y z component parameters
– Haptic feedback
This feedback too with vector/array in three dimensionsNeed the matrix support
– Topological changes
Arrays of int type, in relation to id’s of each change in the mesh, in where each id is mapped to x,y,z axes …Same as collision IMO.
However, beyond all this I want test the communication plugin to know more about it, and can think in use and why not collaborate just in case …
Sure, it will be great for the communication plugin. The more we will be involved in it, better it will be. If you need some live help let ne know.
ErwanDouailleBlockedsocket.bind("5555");
to :
socket.bind("tcp://*:5555");
ErwanDouailleBlockedI’ve add the <RequiredPlugin name=’ZeroMq’ /> directive and the scene Test.scn is loaded without errors from SOFA. Thanks for it ?
Cool !
Apparently the plugin or the scene enter to my ZMQServerComponent constructor two times …
Well, this is another history or anecdote`
bgarcial@elpug : ~/workspace/sofa/build/v17.06/bin
[0] % ./runSofa[ERROR] [PluginManager] Plugin loading failed (/home/bgarcial/workspace/sofa/build/v17.06/lib/libZeroMq.so): function initExternalModule() not found
Creating socket zeroMQ …
Creating socket zeroMQ …
terminate called after throwing an instance of ‘zmq::error_t’
what(): Address already in use########## SIG 6 – SIGABRT: usually caused by an abort() or assert() ##########
-> /home/bgarcial/workspace/sofa/build/v17.06/lib/libSofaHelper.so.17.06.02(sofa::helper::BackTrace::dump()+0x23) [0x7f5a09015d53]`It looks like you are creating two sockets by reading
Creating socket zeroMQ ... Creating socket zeroMQ ...
In your component constructor you create a socket on port
socket.bind("tcp://*:5555");
For the first instance, everything works well. But for the second one, it gonna try to bind on port 5555 but it´s already bind by the first instance. Then it crash.
Try to create only one or fix the bind issue like giving the port as an argument.[Off topic]
Cool, we want to share and improve this plugin. Let us know if you want to code in it 😉ErwanDouailleBlockedDoes your plugin is loaded ?
+ <RequiredPlugin name='ZeroMq' />
You can also check in runsofa, there is a menu named plugins.[Off topic]
May I can know the reason why you try to implement zmq instead of using the Communication plugin ? 🙂ErwanDouailleBlockedI see that in this file they call the libraries, among them Izmq
https://github.com/SofaDefrost/sofa/blob/sofaCommunication/applications/plugins/Communication/CMakeLists.txt#L34Exactly, it´s maybe not the best cmake code ever. But it´s still a WIP project. I only tested it on linux.
I see you have worked the plugin so that from a scene can send and receive data from it via zeroMQ, is that correct?
Correct ! The main objective is to be more user friendly and add the ability to easily add communication´s part in the scenes. You can plug in it (subscribe) to differents data´s component.
Give a try to the examples, quite fast to use. There is cpp files associated to sofa´s scene. By default the communication plugin is turned on by cmake.
In this sense, for the moment, one of ours objectives is send the position of user instrument in relation with the simulation scenario.
Initially, I am configuring the zeroMQ library, and our task after, will be setup the communication of scene data via zeroMQ sockets. In this sense, I have a question which can seem obvious or not and also more according to our needs …Can I reuse the SofaCommunication plugin in relation to zeroMQ functionalities and not reinvent the wheel in relation to configurations libraries and implement communication data?
In my opinion yes. The limitation is if your datas are matrix. (I didn´t find a correct sofa type for it).
What kind of data would you like to send ? Any speed requirements/limitations ?One more thing. This plugin is not sync with the sofa thread. Meanings you can receive a lot of datas between each steps of sofa.
ErwanDouailleBlockedHi @bgarcial,
We (Defrost team) were working on something close to your need.
I just created a PR available on : https://github.com/sofa-framework/sofa/pull/534Let us know if it fits your needs. I started to write a documentation : https://github.com/SofaDefrost/sofa/tree/sofaCommunication/applications/plugins/Communication
Actually there is a lack of matrix support but you can send data such as float/double … there is also some examples in the project directory.
26 September 2017 at 12:11 in reply to: [SOLVED] Error with test scene, Required plugins error #9996ErwanDouailleBlockedHey,
I just tried SofaPython and it works. Then why my plugin works with runsofa and not for this test ? Is there any option for tests ?
Edit : delete past message, my bad. SofaPython was not build.
ErwanDouailleBlockedThanks @jnbrunet and @Vincent !
Your answers are well completing the documentation about templates (https://www.sofa-framework.org/community/doc/programming-with-sofa/components-api/components-and-datas/)Thanks
-
AuthorPosts