Home › Forum › SOFA › Building SOFA › Error with plugins with "SofaROSConnector"
Tagged: SofaROSConnector
- This topic has 19 replies, 9 voices, and was last updated 3 years, 8 months ago by Hugo.
-
AuthorPosts
-
8 August 2019 at 15:48 #14074hitssBlocked
Hello,
I am following the instructions of the plugin “SofaROSConnector” from SofaROSConnector
I clone the three plugins as submodules
When I use CMAKE to configure it, I meet with the error as :`CMake Error at applications/plugins/SoftRobots/CMakeLists.txt:191 (find_package):
By not providing “FindROS.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “ROS”, but
CMake did not find one.Could not find a package configuration file provided by “ROS” with any of
the following names:ROSConfig.cmake
ros-config.cmakeAdd the installation prefix of “ROS” to CMAKE_PREFIX_PATH or set “ROS_DIR”
to a directory containing one of the above files. If “ROS” provides a
separate development package or SDK, be sure it has been installed.I add entry of ROS as the error shows, but it failed, there is no such files.
So what should I do now?13 August 2019 at 18:21 #14104HugoKeymaster22 August 2019 at 18:28 #14139LekanBlockedPlease see the instructions in the updated README in my git fork:
git://github.com/lakehanne/SofaROSConnector.git
The path to the cmake_modules for FindROS has to be explicitly provided for the root cmake. I sent @faichele a PR a while ago.
22 August 2019 at 19:34 #14142faicheleBlockedHello, Lekan, Shuo and Hugo!
I’m getting around to looking at your pull request only now, after returning from holidays and after the work mayhem before.
Could you please let me know:
– What ROS version(s) you are using to build the ROS connector plugin against?
– If you installed ROS from source, or from Debian/Ubuntu packages provided by the OSRF?Thanks a lot!
With best regards,
Fabian16 September 2019 at 14:11 #14242hitssBlockedHello,faichele
Sorry to reply so late.
I installed Ubuntu16.04 and ROS(kinetic) from Ubuntu package. @faichele
Thanks a lot!
Shuo10 October 2019 at 13:50 #14367hitssBlocked@Lekan
hello, I meet with the same problem”
CMake Error at applications/plugins/SofaROSConnector/ZyROSConnectionManager/CMakeLists.txt:67 (add_library):
Cannot find source file:/home/shuosun/sofa/build/applications/plugins/ZyROSConnector/ZyROSConnectionManager/ZyROS_MessageType_Instantiations.h
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
”I saw you solved the problem, could you explain it more specific?
10 October 2019 at 22:36 #14371HugoKeymasterHi @shuo
Let me poke Lekan with the correct forum nickname.
@lakehanne Hitss needs you help. Could you share us how you solved the problem?Best
Hugo
20 November 2019 at 12:11 #14619EyadBlockedHello everyone
I have encountered the same Error as hitts/@shuo, this happens when trying to generate the project.
‘CMake Error at applications/plugins/SofaROSConnector/ZyROSConnectionManager/CMakeLists.txt:70 (add_library):
Cannot find source file:/home/eyad/sofa/build/applications/plugins/ZyROSConnector/ZyROSConnectionManager/ZyROS_MessageType_Instantiations.h
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx’I am following the instructions on the ROS Connector doc, with ROS Melodic.
The Cmakelist tries to set the following as HEADER_FILES
‘${CMAKE_CURRENT_BINARY_DIR}/ZyROS_MessageType_Instantiations.h
${CMAKE_CURRENT_BINARY_DIR}/ZyROS_ServiceType_Instantiations.h’
but I couldn’t find these files anywhere within the SOFA directory.Did anyone manage to find a solution?
27 November 2019 at 17:02 #14644HugoKeymaster3 April 2020 at 20:50 #15641gdrive61BlockedI encountered the same problem with ROS melodic. Have you found a solution?
Thanks!
___________________________________________________________________________
CMake Error at applications/plugins/SofaROSConnector/ZyROSConnectionManager/CMakeLists.txt:67 (add_library):
Cannot find source file:~/sofa/sofa_v19.12/build/applications/plugins/SofaROSConnector/ZyROSConnectionManager/ZyROS_MessageType_Instantiations.h
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx6 April 2020 at 18:28 #15656HugoKeymasterI am not familiar with Fabian’s code.
But this file clearly does not appear to be here.This must be an error. @faichele, do you confirm?
In the meantime @roland-dreyfus, comment the associated lines in the CMakeLists file. Could you let me know how it runs?
Best,
Hugo
7 April 2020 at 10:00 #15664gdrive61BlockedThanks for the fast reply! I found an alternative solution to interface SOFA with ROS that works well for me. I am using the .pyscn scripts to build my scenes.
To interface them with ROS, I import the rospy module to the .pyscn scripts. This allows to access all ROS specific commands and hence directly subscribe and publish ROS topics. Make sure that the .pyscn script is either in the ROS workspace or that the path to the workspace is added to PYTHONPATH: sys.path.append(‘~/catkin_ws/src/’).
7 April 2020 at 10:54 #15665Damien MarchalBlockedHi gdrive61,
Using the python binding is what we also did in SoftRobots.
We made some easing functions in the
https://github.com/SofaDefrost/SoftRobots/tree/master/docs/examples/sofarosIt was quickly made bit as I like the API I share an example of it:
# coding: utf8 import sofaros import numpy def send(data): "This function is packing the data from the data field to stream that to ROS" return numpy.asarray(data.value[0], dtype=numpy.float32) recv(data, datafield): """Unpack the data from ros to Sofa""" t = data.tolist() datafield.value = [t[0]+1.0, t[1], t[2]] def createScene(rootNode): sofaros.init("SofaNode") rootNode.createObject("EulerImplicitSolver") rootNode.createObject("CGLinearSolver") s=rootNode.createChild("simulated") s.createObject("MechanicalObject", name="sender", position=[0.0,0.0,0.0]) s.sender.showObject=True s.sender.showObjectScale=1.0 a=rootNode.createChild("animated") a.createObject("MechanicalObject", name="receiver", position=[0.0,0.0,0.0]) a.receiver.showObject=True a.receiver.showObjectScale=1.0 # This create a Sofa component that will publish the # "s.sender.position" data field to ros sofaros.RosSender(rootNode, "/simulation/sender/position", s.sender.findData("position"), sofaros.numpy_msg(sofaros.Floats), send) # The data is received by an external ros point # and republished to the animation/receiver/position topic # the following component will receive data published to this topic # and store the result in the a.receiver.position data field. sofaros.RosReceiver(rootNode, "/animation/receiver/position", a.receiver.findData("position"), sofaros.numpy_msg(sofaros.Floats), recv) return rootNode
Damien
7 April 2020 at 11:23 #15667gdrive61BlockedThanks for sharing @damien-marchaluniv-lille1-fr! Very clean with the easing functions.
13 April 2020 at 22:21 #15705HugoKeymasterThanks @damien-marchaluniv-lille1-fr and @roland-dreyfus !
Let’s see if @faichele can also provide us some updates about the plugin.Otherwise Python option looks nice!
BestHugo
18 November 2020 at 21:05 #17725trannguyenleBlockedAny update on the ROSConnector Plugin up till this point? I tried to install the plugin today and face the same error as the thread’s owner, which is:
CMake Error at applications/plugins/SoftRobots/CMakeLists.txt:191 (find_package):
By not providing “FindROS.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “ROS”, but
CMake did not find one.I am currently using the python approach thanks to @damien but I really would like to have the ROS plugin in my workspace.
4 December 2020 at 23:08 #17940HugoKeymasterThank you for your reminder @trannguyenle.
Did you or will you have some time for an update of the ROSConnector @faichele?Hugo
4 February 2021 at 03:32 #18487nhnhanBlockedDear @hugo,
I had faced the same problems as these guys mentioned above.
Regarding the issue of “Could not find ROS package”, it might be because you are using the old version of SoftRobot plugin. Using the one from https://project.inria.fr/softrobot/ might fix it. After that, you will have similar error with @roland-dreyfus, @eyadshak
Please notify us when there is progress regarding this issue. Thank you very much
Nhan16 March 2021 at 07:31 #18481nhnhanBlockedDear @Hugo, @faichele,
I had the same problem as mentioned by @shuo, and I would like to update my progress regarding this issue. I guess this error might be because the suggested version of the Softrobot plugin in . I changed to the newest version from and this error was disappeared. However, new errors arose related to ZyRosconnecter plugin during configuration in CMake as described below:
`Adding plugin ZyROSConnector
Adding SofaROSConnector plugins.
CMake Error at SofaKernel/SofaFramework/SofaMacrosInstall.cmake:157 (message):
Missing parameter PACKAGE_NAME.
Call Stack (most recent call first):
applications/plugins/SofaROSConnector/ZySOFAControllers/CMakeLists.txt:37 (sofa_create_package)CMake Error at SofaKernel/SofaFramework/SofaMacrosInstall.cmake:157 (message):
Missing parameter PACKAGE_VERSION.
Call Stack (most recent call first):
applications/plugins/SofaROSConnector/ZySOFAControllers/CMakeLists.txt:37 (sofa_create_package)CMake Error at /snap/cmake/775/share/cmake-3.19/Modules/WriteBasicConfigVersionFile.cmake:43 (message):
No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()
Call Stack (most recent call first):
/snap/cmake/775/share/cmake-3.19/Modules/CMakePackageConfigHelpers.cmake:231 (write_basic_config_version_file)
SofaKernel/SofaFramework/SofaMacrosInstall.cmake:182 (write_basic_package_version_file)
applications/plugins/SofaROSConnector/ZySOFAControllers/CMakeLists.txt:37 (sofa_create_package)31 March 2021 at 09:33 #19029HugoKeymasterHey @nhnhang
Unfortunately @faichele is not available currently for the SOFA ROSConnector support.Note that an alternative exists: using ROS+SOFA through a python environment.
See here an example in the SoftRobot plugin: https://github.com/SofaDefrost/SoftRobots/tree/master/docs/examples/sofarosThe scene corresponding to the example is here: https://github.com/SofaDefrost/SoftRobots/blob/master/docs/examples/sofaros/test_sofaros.py
In the scene, the positions of a mechanical object (/ simulation / sender / position) are streamed to ROS then the ROS node returns towards SOFA and it is received in a second mechanical object.
The scene is still written in SofaPython2 and would need to be updated for python3, but should be trivial.
Hope it helps.
Best wishes,Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.