CoppeliaRobotics / simROS

Other
24 stars 13 forks source link

required python version is different from default in ROS melodic #8

Closed lyh458 closed 3 years ago

lyh458 commented 3 years ago

Hi, I tried to build and this package, but have several problems and errors bother me. Here are my environments:

Question 1: can build with python 3, but run with python 2?

see the dependencies list of libPlugin, python 3.8 is required, but the default version of ROS melodic is python 2.7, and I tried to build with the default, a python 3 error showed:

CMake Error at /usr/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)

So I created a python 3 env with conda, and builded successfully. And run:

source ~/.bashrc
roscd sim_ros_interface
roscd ros_bubble_rob

roscd the two packages successfully and all is well so far.

Is that right? If so, And why two versions of python are required?

Question 2: plugin 'ROSInterface': load failed

I copied libsimExtROSInterface.so to the root folder of CoppeliaSim, create two new terminator (default ros environment, python 2) and then run:

roscore
./coppeliaSim.sh

A ros interface error showed:

...
[CoppeliaSim:loadinfo]   plugin 'ROS': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'ROSInterface': loading...
[CoppeliaSim:error]   plugin 'ROSInterface': load failed (could not load). The plugin probably couldn't load dependency libraries. For additional infos, modify the script 'libLoadErrorCheck.sh', run it and inspect the output.
...

So I tried to follow the prompt, modified and then run ./libLoadErrorCheck.sh, seem no dependency is missing, here is the log:

    linux-vdso.so.1 (0x00007f20d2758000)
    libimage_transport.so => /opt/ros/melodic/lib/libimage_transport.so (0x00007f20d0eb3000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f20d0caf000)
    libtf.so => /opt/ros/melodic/lib/libtf.so (0x00007f20d0a86000)
    libroscpp.so => /opt/ros/melodic/lib/libroscpp.so (0x00007f20d06f1000)
    librosconsole.so => /opt/ros/melodic/lib/librosconsole.so (0x00007f20d04bb000)
    libroscpp_serialization.so => /opt/ros/melodic/lib/libroscpp_serialization.so (0x00007f20d02b8000)
    librostime.so => /opt/ros/melodic/lib/librostime.so (0x00007f20d0098000)
    libboost_system.so.1.65.1 => /home/lyh/Codes/robot_ws/CoppeliaSim_Edu_V4_2_0_Ubuntu18_04/libboost_system.so.1.65.1 (0x00007f20cfe93000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f20cfc74000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f20cf8eb000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f20cf6d3000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f20cf2e2000)
    libmessage_filters.so => /opt/ros/melodic/lib/libmessage_filters.so (0x00007f20cf0dd000)
    libclass_loader.so => /opt/ros/melodic/lib/libclass_loader.so (0x00007f20ceeb6000)
    libroslib.so => /opt/ros/melodic/lib/libroslib.so (0x00007f20ceca3000)
    libboost_filesystem.so.1.65.1 => /home/lyh/Codes/robot_ws/CoppeliaSim_Edu_V4_2_0_Ubuntu18_04/libboost_filesystem.so.1.65.1 (0x00007f20cea89000)
    libtinyxml2.so.6 => /usr/lib/x86_64-linux-gnu/libtinyxml2.so.6 (0x00007f20ce875000)
    libconsole_bridge.so.0.4 => /usr/lib/x86_64-linux-gnu/libconsole_bridge.so.0.4 (0x00007f20ce670000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f20d2530000)
    libtf2_ros.so => /opt/ros/melodic/lib/libtf2_ros.so (0x00007f20ce3c1000)
    libtf2.so => /opt/ros/melodic/lib/libtf2.so (0x00007f20ce18d000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f20cddef000)
    libxmlrpcpp.so => /opt/ros/melodic/lib/libxmlrpcpp.so (0x00007f20cdbd0000)
    libcpp_common.so => /opt/ros/melodic/lib/libcpp_common.so (0x00007f20cd9c5000)
    libboost_thread.so.1.65.1 => /home/lyh/Codes/robot_ws/CoppeliaSim_Edu_V4_2_0_Ubuntu18_04/libboost_thread.so.1.65.1 (0x00007f20cd7a0000)
    libboost_chrono.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.65.1 (0x00007f20cd59b000)
    librosconsole_log4cxx.so => /opt/ros/melodic/lib/librosconsole_log4cxx.so (0x00007f20cd380000)
    librosconsole_backend_interface.so => /opt/ros/melodic/lib/librosconsole_backend_interface.so (0x00007f20cd17e000)
    liblog4cxx.so.10 => /usr/lib/x86_64-linux-gnu/liblog4cxx.so.10 (0x00007f20ccdb5000)
    libboost_regex.so.1.65.1 => /home/lyh/Codes/robot_ws/CoppeliaSim_Edu_V4_2_0_Ubuntu18_04/libboost_regex.so.1.65.1 (0x00007f20ccaad000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f20cc8a5000)
    libPocoFoundation.so.50 => /usr/lib/libPocoFoundation.so.50 (0x00007f20cc4fc000)
    librospack.so => /opt/ros/melodic/lib/librospack.so (0x00007f20cc2b9000)
    libactionlib.so => /opt/ros/melodic/lib/libactionlib.so (0x00007f20cc098000)
    libapr-1.so.0 => /usr/lib/x86_64-linux-gnu/libapr-1.so.0 (0x00007f20cbe63000)
    libaprutil-1.so.0 => /usr/lib/x86_64-linux-gnu/libaprutil-1.so.0 (0x00007f20cbc38000)
    libicui18n.so.60 => /usr/lib/x86_64-linux-gnu/libicui18n.so.60 (0x00007f20cb797000)
    libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f20cb3df000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f20cb16d000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f20caf50000)
    libboost_program_options.so.1.65.1 => /home/lyh/Codes/robot_ws/CoppeliaSim_Edu_V4_2_0_Ubuntu18_04/libboost_program_options.so.1.65.1 (0x00007f20caccf000)
    libpython2.7.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 (0x00007f20ca752000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f20ca54b000)
    libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f20ca313000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f20ca0e1000)
    libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f20c8538000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f20c8335000)

Since the required python version of CopperliaSim V4.0.0 is python 2 and same as melodic, so I copied the libsimExtROSInterface.so builded by simExtROS branch coppeliasim-v4.0.0 to the root folder of CoppeliaSim V4.2.0, and run ./, every plugins are load successfully except several warnings:

...
[CoppeliaSim:loadinfo]   plugin 'ROS': loading...
[CoppeliaSim:loadinfo]   **plugin 'ROS': load succeeded.**
[CoppeliaSim:loadinfo]   plugin 'ROSInterface': loading...
Plugin 'RosInterface': warning: replaced variable 'simROS'
Plugin 'RosInterface': warning: replaced variable 'simROS'
Plugin 'RosInterface': warning: replaced function 'simROS.subscribe@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.shutdownSubscriber@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.subscriberTreatUInt8ArrayAsString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.advertise@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.shutdownPublisher@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.publisherTreatUInt8ArrayAsString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.publish@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.serviceClient@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.shutdownServiceClient@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.serviceClientTreatUInt8ArrayAsString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.call@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.advertiseService@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.shutdownServiceServer@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.serviceServerTreatUInt8ArrayAsString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.sendTransform@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.sendTransforms@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.imageTransportSubscribe@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.imageTransportShutdownSubscriber@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.imageTransportAdvertise@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.imageTransportShutdownPublisher@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.imageTransportPublish@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.getTime@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.getParamString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.getParamInt@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.getParamDouble@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.getParamBool@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.setParamString@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.setParamInt@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.setParamDouble@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.setParamBool@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.hasParam@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.deleteParam@RosInterface'
Plugin 'RosInterface': warning: replaced function 'simROS.searchParam@RosInterface'
[CoppeliaSim:loadinfo]   **plugin 'ROSInterface': load succeeded.**
...

Do these warning matter?

Copy the devel/lib/libsimExtROS.so file to the CoppeliaSim installation folder. The plugin is now ready to be used!

It seems that no libsimExtROS.so is generated after building, but libsimExtROSInterface.so, and libsimExtROS.so can be found in the root folder of CopperliaSim in default.

Thanks.

fferri commented 3 years ago

Please use the forum for support requests.

lyh458 commented 3 years ago

Thanks your reply in the forum. I posted my question after about your reply, but it seems that the forum has no “@ someone” feature, I am no sure if you can see my later question.