Forum Replies Created
-
AuthorPosts
-
bgarcialBlocked
HI @Hugo thanks for the message, no problem about it, of a progressively way we solve aspects like this verifying in deep the situation
Best Regards 🙂
bgarcialBlockedMy problem was a linked inconvenient when I call and use one SerialDriver object from ZMQClientComponent init method of ZeroMQCommunication plugin
I’ve been testing calling a new pointer Serial Driver object on the
ZMQClientComponent::init()
method, removing the search SerialDriver node search on the tree and theundefined reference to typeinfo for sofa::component::controller::SerialDriver'
persist.void ZMQClientComponent::init() { /* We get the rootContext */ sofa::simulation::Node::SPtr rootContext = static_cast<simulation::Node *>(this->getContext()->getRootContext()); cout << "rootContext: " << rootContext << endl; //getContext()->get<SerialDriverType>(&objectsSerialDriver, core::objectmodel::BaseContext::SearchDown); // Creating a SerialDriver pointer instance SerialDriver* s = new SerialDriver(); std::cout << "ZeroMQCommunication::init()" << std::endl; ZMQClientComponent z; // Connecting to Nerwork Manager z.setupConnection(); }
According to the previous situation, I think that my problem it’s related with the linked between components through of the calling of SerialComunication from ZeroMQCommunication.
I’ve decided integrate on one unique plugin the
SerialDriver
andZMQClientComponent
components, together are now, under ZeroMQCommunication plugin, and my search SerialDriver node operation on theZMQClientComponent::init()
method its works, my sofa instance has been compiled and run.bgarcialBlockedHi @hugo and @guillaumeparan
Receive you a warm greetingsI have taken the audacity to mention them with the aim of as far as possible to review this question.
I haven’t clear what can be happening here in relation to the search to SerialDriver node on the SOFA hierarchy tree.
We are conducting a search of a node that we have created ourselves and it is called
SerialDriver
.Apparently, because of the way in which SOFA is built, the methods to recover the nodes in the tree hierarchy receive a
T
object of type template, but that points towards a reference that I do not know very well how to interpret it or approach its development.What types of data should that
get()
method receive since it seems that theSerialDriverType
vector in which the existing SerialDriver objects should apparently be retrieved is not an ideal parameter and therefore the reference error toSerialDriver
is undefined.undefined reference to
typeinfo for sofa::component::controller::SerialDriver’`My apologies also for the audacity to mention them in this question
Best RegardsbgarcialBlockedHi Guillaurme, it’s true, my apologies for create a new post with the same topic.
Currently, and with your analysis about of plugin child and parent plugin, my needs are related with the first question on this topic question in where from ZMQCommunication (parent plugin), I include to SerialCommunication (child plugin)
In this way I was able to get what I wanted, which was a first step to start integrating these two plugins/components into a scene
In this ideas order my question has been solved
Thaks a lot for you for the support. 🙂
bgarcialBlockedI’ve created and builded on SOFA of a separately way these two plugins:
/applications/plugins/SerialComunication
– SerialComunication plugin
/applications/plugins/ZeroMQCommunication
– ZeroMQCommunication pluginOn my plugins/CMakeLists.txt global configuration plugins I’ve added together plugins in this way:
sofa_add_plugin(SerialComunication SerialComunication) sofa_add_plugin(ZeroMQCommunication ZeroMQCommunication ON)
Currently, I want from
SerialComunication
plugin call or include theZeroMQCommunication
In other question, @guillaumeparan was supported me in relation to this task. He told me the following:
Every SOFA plugin has to generate a MyPluginConfig.cmake file to permit others to find it with
find_package
.Then, in ZeroMQCommunication, I’ve created the
ZeroMQCommunicationConfig.cmake.in
file based on the same file in the LeapMotion pluginSo, this is my
ZeroMQCommunicationConfig.cmake.in
file:# CMake package configuration file for the ZeroMQCommunication library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) # link_directories(@LEAP_INCLUDE_DIR@) # find_package(Leap REQUIRED) if(NOT TARGET ZeroMQCommunication) include("${CMAKE_CURRENT_LIST_DIR}/ZeroMQCommunicationTargets.cmake") endif() set(ZeroMQCommunication_LIBRARIES ZeroMQCommunication) set(ZeroMQCommunication_INCLUDE_DIRS @PACKAGE_ZEROMQCOMMUNICATION_INCLUDE_DIR@)
In this way, I did make findable to
ZeroMQCommunication
plugin and from theSerialComunication/CMakeList.txt
I’ve added the following directives line variables:find_package(ZeroMQCommunication REQUIRED)
to find the ZeroMQCommunication plugin. I guess that makes this viaZeroMQCommunicationConfig.cmake.in
file created previously, I am not sure …target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ZeroMQCommunication_INCLUDE_DIRS}>")
to get access to ZeroMQCommunication plugin filestarget_link_libraries(${PROJECT_NAME} ZeroMQCommunication)
to linking with ZeroMQCommunication pluginThen my
SerialComunication/CMakeList.txt
file has been stayed complete in this way:cmake_minimum_required(VERSION 2.8.12) project(SerialComunication) set(HEADER_FILES SerialDriver.h ) set(SOURCE_FILES SerialDriver.cpp initSerial.cpp ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) # Added find_package(ZeroMQCommunication REQUIRED) # list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") # include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) # ---------------------------------------- # Added. Get access to ZeroMQCommunication plugin files: target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${ZeroMQCommunication_INCLUDE_DIRS}>") # --------------------------------------- # ---------------------------------------- # Added. Linking with ZeroMQCommunication target_link_libraries(${PROJECT_NAME} ZeroMQCommunication) # ---------------------------------------- set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SerialComunication") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") install(TARGETS SerialComunication RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
Finally, Guillerme told me that is necessary use the
sofa_create_package
directive which will handleZeroMQCommunicationConfig.cmake.in
file, or at least that’s what I understood 😛Then, until here, I’ve made findable ZeroMQCommunication from SerialComunication. Now I should call the
sofa_create_package
in theZeroMQCommunication/CMakeList.txt
which has stayed of the following way:cmake_minimum_required(VERSION 2.8.12) project(ZeroMQCommunication) set(HEADER_FILES initZeroMQCommunication.h ZMQClientComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQClientComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZEROPLUGIN") # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SERIALPLUGIN") # set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZeroMQCommunication") target_link_libraries(${PROJECT_NAME} SofaCore SofaComponentGeneral) ## Added! Install rules for the library; CMake package configurations files # sofa_create_package(${PROJECT_NAME} ${${ZEROMQCOMMUNICATION}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
When I build sofa I get this error:
λ bgarcial [sofa/build/v17.06] → make -j7 -- Install prefix: /home/bgarcial/workspace/sofa/build/v17.06/install -- Boost version: 1.58.0 -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system -- filesystem -- locale -- thread -- date_time -- chrono -- atomic -- SofaSparseSolver: metis was not found, SparseLDLSolver won't be built -- SofaSparseSolver: csparse was found, SparseLUSolver and SparseCholeskySolver will be built QGLViewer: Using Qt5 SofaGUIQt: Using Qt5 -- SofaTest: optional dependency SofaPython NOT found, Python_test won't be built Adding Plugin CImgPlugin -- CImgPlugin: Enable TIFF Image Format -- CImgPlugin: Enable JPEG Image Format -- CImgPlugin: Enable PNG Image Format Adding Plugin SerialComunication CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): By not providing "FindZeroMQCommunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ZeroMQCommunication", but CMake did not find one. Could not find a package configuration file provided by "ZeroMQCommunication" with any of the following names: ZeroMQCommunicationConfig.cmake zeromqcommunication-config.cmake Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files. If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeError.log". Makefile:1840: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1 λ bgarcial [sofa/build/v17.06] →
This
CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18
error is related when I callZeroMQCommunication
fromSerialComunication
, exactly in this linefind_package(ZeroMQCommunication REQUIRED)
Additionally, SOFA propose to me one solution and it’s related with:
Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files . If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed.
The, I’ve renamed the ZeroMQCommunicationConfig.cmake.in file to ZeroMQCommunicationConfig.cmake file.
Then I’ve searched and checked and when I perform the
cmake-gui ../../src
command In the interface I found theZeroMQCommunication_DIR
variable and I set their value to the ZeroMQCommunication folder, in which is located theZeroMQCommunicationConfig.cmake
fileAnd when I configure or build again I get this different error:
Adding Plugin SerialComunication CMake Error: Error in cmake code at /home/bgarcial/workspace/sofa/src/applications/plugins/ZeroMQCommunication/ZeroMQCommunicationConfig.cmake:3: Parse error. Expected a command name, got unquoted argument with text "@PACKAGE_INIT@". CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): find_package Error reading CMake code from "/home/bgarcial/workspace/sofa/src/applications/plugins/ZeroMQCommunication/ZeroMQCommunicationConfig.cmake". Adding Plugin ZeroMQCommunication CMake Error at applications/plugins/ZeroMQCommunication/CMakeLists.txt:39 (sofa_create_package): sofa_create_package Macro invoked with incorrect arguments for macro named: sofa_create_package Adding Application Modeler Modeler executable: Using Qt5 Modeler library: Using Qt5 Adding Application runSofa Configuring incomplete, errors occurred! See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/bgarcial/workspace/sofa/build/v17.06/CMakeFiles/CMakeError.log".
Is very very possible that something it’s wrong of my part in all these configuration and call process described above …
I’m sure there is an obvious fix for this, or unless more logic but I haven’t found it yet even despite of Guillerme support
bgarcialBlockedHi @guillaumeparan.
Again thanks for your support 🙂
Is possible that I did haven’t a clear explanation in my latest posts in this question. It’s not circular dependency, at this moment, we want a call to
ZeroMQCommunication
fromSerialCommunication
and nothing more. Of course, a circular dependency it’s definitively a bad idea.Basically, the error which we get it’s related to our firsts interactions on this question, but we cannot meet how to address it.
In this latest post on this question we are making to make
ZeroMQCommunication
findable by creating aZeroMQCommunicationConfig.cmake.in
but the error persistbgarcialBlockedMy apologies for the inconvenience
Can you give us any suggests or recommend it?In addition I was not correctly making the mention to your username profile @guillaumeparan 😛
bgarcialBlockedHi @guillaumeparan
Again, thanks a lot to you for the support. Our apologies for the late in response in relation to the progress topic.The last recommendation that you give us it’s working, finally, we can call
SerialCommunication
Plug-in fromZeroMQCommunication
, but when we can try to apply the opposite objective, CallZeroMQCommunication
fromSerialCommunication
we got the following error:CMake Error at applications/plugins/SerialComunication/CMakeLists.txt:18 (find_package): By not providing "FindZeroMQCommunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "ZeroMQCommunication", but CMake did not find one. Could not find a package configuration file provided by "ZeroMQCommunication" with any of the following names: ZeroMQCommunicationConfig.cmake zeromqcommunication-config.cmake Add the installation prefix of "ZeroMQCommunication" to CMAKE_PREFIX_PATH or set "ZeroMQCommunication_DIR" to a directory containing one of the above files. If "ZeroMQCommunication" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! See also "/home/asanchez/Universidad/Investigación/Christian/SimDesign2/build/v17.06/CMakeFiles/CMakeOutput.log". See also "/home/asanchez/Universidad/Investigación/Christian/SimDesign2/build/v17.06/CMakeFiles/CMakeError.log". Makefile:1842: recipe for target 'cmake_check_build_system' failed make: *** [cmake_check_build_system] Error 1
This is our
CmakeList.txt
ofZeroMQCommunication
plugin, in which we are including thesofa_create_package
directivecmake_minimum_required(VERSION 2.8.12) project(ZeroMQCommunication) set(${PROJECT_NAME}_VERSION 1.0) set(HEADER_FILES initZeroMQCommunication.h ZMQClientComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQClientComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZEROMQCOMMUNICATION") target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) ## Install rules for the library; CMake package configurations files sofa_create_package(${PROJECT_NAME} ${${PROJECT_NAME}_VERSION} ${PROJECT_NAME} ${PROJECT_NAME}) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
In addition, we did have to make
ZeroMQCommunication
findable by creating aZeroMQCommunicationConfig.cmake.in
file which has the following content:# CMake package configuration file for the ZMQCommunication library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) if(NOT TARGET ZeroMQCommunication) include("${CMAKE_CURRENT_LIST_DIR}/ZeroMQCommunicationTargets.cmake") endif() set(ZeroMQCommunication_LIBRARIES ZeroMQCommunication) set(ZeroMQCommunication_INCLUDE_DIRS @PACKAGE_ZEROMQCOMMUNICATION_INCLUDE_DIR@)
Thank you for your help.
bgarcialBlockedHi @guillaumeparan
At this moment my partner and I we are awaiting find us again to test this latest consideration which you gave us.Coming soon we keep you informed about it.
Thanks for being pendingbgarcialBlockedHi Guillaume, thank you so much for your help, here is the code of those files:
CMakeLists.txt of SerialCommunication
cmake_minimum_required(VERSION 2.8.12) project(SerialComunication) set(HEADER_FILES SerialDriver.h ) set(SOURCE_FILES SerialDriver.cpp initSerial.cpp ) find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) set_target_properties(${PORJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_SERIALPLUGIN") target_link_libraries(${PROJECT_NAME} SofaCore SofaComponentGeneral) install(TARGETS ${PROJECT_NAME} COMPONENT SerialComunication_libraries EXPORT SerialComunicationTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) install(DIRECTORY examples/ DESTINATION share/sofa/plugins/${PROJECT_NAME})
CMakeLists.txt of ZMQCommunication
cmake_minimum_required(VERSION 3.1) project(ZeroMQCommunication) set(HEADER_FILES initZeroMQCommunication.h ZMQServerComponent.h PointNet.h SofaTypeMessages.h ) set(SOURCE_FILES initZeroMQCommunication.cpp ZMQServerComponent.cpp PointNet.cpp SofaTypeMessages.cpp ) set(EXTRA_FILES README.md ) find_package(SofaFramework REQUIRED) find_package(SerialComunication REQUIRED) add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${EXTRA_FILES}) target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${SerialComunication_INCLUDE_DIRS}>") target_link_libraries(${PROJECT_NAME} -lzmq ${} SofaCore) target_link_libraries(${PROJECT_NAME} SerialComunication) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_ZeroMQCommunication") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") install(TARGETS ZMQCommunication RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
I really would appreciate the support that you can give me 🙂
bgarcialBlockedHi Guillaume, I don’t understand what is FindSerialComunication because the name of my plugin is SerialComunitacion. Additionally, I created SerialComunicationConfig.cmake.in but anyway the error continues.
bgarcialBlockedHi Guillaume.
I don’t understand what is FindSerialComunication because the name of my plugin is SerialComunication. Aditionally, I’ve created SerialComunicationConfig.cmake.in but anyway continues.
The structure directory of my SerialComunication plugin is:
SerialComunication
CMakeLists.txt
initSerial.cpp
SerialComunicationConfig.cmake.in
SerialDriver.cpp
SerialDriver.hand SerialComunicationConfig.cmake has the following content:
# CMake package configuration file for the LeapMotion library @PACKAGE_INIT@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} @CMAKE_MODULE_PATH@") find_package(SofaFramework REQUIRED) find_package(SofaBase REQUIRED) find_package(SofaGeneral REQUIRED) #link_directories(@LEAP_INCLUDE_DIR@) #find_package(Leap REQUIRED) if(NOT TARGET SerialComunication) include("${CMAKE_CURRENT_LIST_DIR}/SerialComunicationTargets.cmake") endif() set(SerialComunication_LIBRARIES SerialComunication) set(SerialComunication_INCLUDE_DIRS @PACKAGE_SERIALCOMUNICATION_INCLUDE_DIR@)
bgarcialBlockedHi Guillaume,
In first instance thanks for their answering
I followed the steps that you described above, in the CMakeList.txt of ZMQCommunication plugin I Include following things.
1. Create your plugin’s CMake variables:
find_package(SerialCommunication)
2. Get access to your plugin files:target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${SerialCommunication_INCLUDE_DIRS}>")
3. Link with your plugin:target_link_libraries(${PROJECT_NAME} SerialCommunication)
But When I compiled I got the next error:
Adding Plugin ZeroMQCommunication CMake Error at applications/plugins/ZeroMQCommunication/CMakeLists.txt:23 (find_package): By not providing "FindSerialComunication.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "SerialComunication", but CMake did not find one. Could not find a package configuration file provided by "SerialComunication" with any of the following names: SerialComunicationConfig.cmake serialcomunication-config.cmake Add the installation prefix of "SerialComunication" to CMAKE_PREFIX_PATH or set "SerialComunication_DIR" to a directory containing one of the above files. If "SerialComunication" provides a separate development package or SDK, be sure it has been installed.
What can I do? I tried to create
SerialComunicationConfig.cmake
and I can’t solve that problemI really would appreciate the support that you can give me.
bgarcialBlockedHi @erwandouaille, I appreciate your orientation and support in the Communication Plugin.
Recent I back to activities and I bring apologize to you for my late response.For the moment I am testing the data communications from SOFA zeromq client to External Server python of a manual way, with the order to understand some implications in relation to zmq working with sofa data and structures, like I was comment to you in previous opportunity …
In this situation, I have been dealing with the way of how to the destination entity interpret or receive some message / data and this is showed or deployed.
In the Communication plugin … how to manage you the serialization when receive messages independent of the platform or language?
This is related with the following question and the answer provided by the community.
I hope this is not an inconvenience for you 🙂
bgarcialBlockedActually no. The communication plugin is design to send sofa’s data of components. In your case :
Data<double> myparam;
Data<std::string>d_address;I have the following concern about of
Data
type component:
If one component have manyData
, 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?I say or ask this, because in our structures, some member data will be component data, but it is not in our interest to send all component data because our application is network communication and it is necessary to take into account performance, and not send irrelevant data.
In this basic diagram I will want draw the workflow
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) ?
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?I will be pending.
bgarcialBlockedIn this moment we have some C++ structures which represent some events which happen in the surgical scenario such as
cutting
,carving
,probing
andattaching
…This structs and data members are here:
As you can see, in this structs we have different data types such as
vectors
,strings
,Quat
, between others)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?
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.
Best Regards
bgarcialBlockedThere is some discussion about the communication plugin and it might be include for the next release as an experimental feature.
This sounds great!
Initially 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 …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.
bgarcialBlockedCurrently I am customize my zmq implementation with some classes and structs to receive some data from sofa about of collisions and deformation calculus
I cannot test the communication plugin in the recent time.
Can you tell me about of the latest commits in relation to matrix support.
I can see that these changes are integrated in sofa … is this really?
https://github.com/sofa-framework/sofa/commit/2d147c2Best Regards
bgarcialBlockedHi @erwandouaille I am using to c++ client basic script sample of zeroMQ website, which is too similar to you c++ clients which you show me here
My zeroMQ sockets implementation works to send C++ native data type but does not works for Sofa Data types.
For the moment I don’t need work with Sofa Data types then the clients and server in zeroMQ that I have it’s works
My problem is to send Sofa Data types via zeroMQ sockets
bgarcialBlockedFor 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/CommunicatioHi @erwandouaille, I am using the C++ client and in my question I show the process, but the response that I get is similar. Apparently the response is a string strange of the same way in pyhton client.
bgarcialBlockedI’ve changed the python client to c++ client of this way:
This c++ client is an external application out from SOFA#include <zmq.hpp> #include <string> #include <iostream> #include <time.h> #include <sys/time.h> using std::cout; using std::cin; using std::endl; using std::string; int main () { // Prepare our context and socket std::string message="Toes Server"; zmq::context_t context (1); zmq::socket_t socket (context, ZMQ_REQ); // Llamamos el proceso al cual le queremos medir el tiempo cout << "Conecct to ZMQ Server" << endl; socket.connect ("tcp://localhost:5555"); zmq::message_t request (message.length()); memcpy (request.data (), message.c_str(), message.length()); //std::cout << "Sending " << request.data() << "…" << std::endl; socket.send (request); zmq::message_t reply; socket.recv (&reply); string replyMessage = string(static_cast<char *>(reply.data()), reply.size()); cout << "Received message from server: " + replyMessage << " " << endl; return 0; }
I execute the client after the server and I receive the following output:
bgarcial@elpug ‹ master ●● › : ~/CLionProjects/zeroMQ_C++_Client-Python_Server [0] % ./client_get-time-of-day.out Conecct to ZMQ Server Received message from server: ��y����y����n?� bgarcial@elpug ‹ master ●● › : ~/CLionProjects/zeroMQ_C++_Client-Python_Server
The response from ZMQ server is an strange string or binary. I think that my response is not arrive on the client side or this should be converted, by I unknown how to do it..
bgarcialBlockedLive chat ? What is your problem with libs ? Linux ? Windows (never tested it on win) ?
Hi @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.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.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.bgarcialBlockedHi @erwandouaille I’ve separated from the constructor class the socket creation and my component with zeroMQ basics works. I include it inside of a function which I execute in the
ZMQServerComponent::init()
methodWhen I’ve add my Test.scn file sample I can create the socket, despite of some error
When I send a client message from a external client application, in my server sofa I get this:
bgarcial@elpug : ~/workspace/sofa/build/v17.06 [0] % ./bin/runSofa [ERROR] [PluginManager] Plugin loading failed (/home/bgarcial/workspace/sofa/build/v17.06/lib/libZeroMq.so): function initExternalModule() not found Creating socket zeroMQ ... Incoming message from client Hola servidor C++.
From my client application the server response and the CLI is:
bgarcial@elpug ‹ master ●● › : ~/CLionProjects/zeroMQ_C++_Client-Python_Server/Python [1] % python client.py Connecting to hello world server… Received reply b'Hello Client\x00unknown' (cnvss_tests) bgarcial@elpug ‹ master ●● › :
Do you have an idea about of
ERROR] [PluginManager] Plugin loading failed (/home/bgarcial/workspace/sofa/build/v17.06/lib/libZeroMq.so): function initExternalModule() not found
This is my libZeroMq.so which is packed into SOFA (product of build process of my plugin) but I unknown the insights of situation
[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.Thanks for your support.
bgarcialBlockedBefore, I was passing the port argument exactly as you told me.
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 argumentCurrently I have of this way:
socket.bind("tcp://*:5555");
And I don’t know the reason why the socket is created twice. I am creating the socket in my constructor class ZMQServerComponent, is possible that by some reason this be called two times?
bgarcialBlockedIn 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.I try pass just the port as a parameter of this way:
ZMQServerComponent::ZMQServerComponent(){ cout << "Creating socket zeroMQyyy ..."<<endl; socket.bind("5555"); }
And now does not try create the socket two times but, apparently my argument is not suited …
[ERROR] [PluginManager] Plugin loading failed (/home/bgarcial/workspace/sofa/build/v17.06/lib/libZeroMq.so): function initExternalModule() not found Creating socket zeroMQyyy ... terminate called after throwing an instance of 'zmq::error_t' what(): Invalid argument ########## 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) [0x7f303a2a1d53] -> /home/bgarcial/workspace/sofa/build/v17.06/lib/libSofaHelper.so.17.06.02(sofa::helper::BackTrace::sig(int)+0x19c) [0x7f303a2a209c]
-
AuthorPosts