required python version of simExtROS is different from default in ROS melodic

Typically: "How do I... ", "How can I... " questions
Post Reply
lyh458
Posts: 4
Joined: 29 Sep 2020, 08:00

required python version of simExtROS is different from default in ROS melodic

Post by lyh458 »

Hi,

I tried to load ros interface plugin, so I git clone and build [simExtROS](https://github.com/CoppeliaRobotics/simExtROS), but have several problems and errors bother me. Here are my environments:

- system: ubuntu 18.04
- ROS: melodic
- CoppeliaSim: V4.2.0

**Question 1:** _can build with python 3, but run with python 2?_

see the dependencies list of [libPlugin](https://github.com/CoppeliaRobotics/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:

```log
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:

```bash
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:

```bash
roscore
```

```bash
./coppeliaSim.sh
```

A ros interface error showed:

```log
...
[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:

```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)
```

- **Question 3:** _can use libsimExtROSInterface.so of V4.0.0 in V4.2.0?_

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:

```log
...
[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?

- **Tutorial correction required**

[The tutorial](https://www.coppeliarobotics.com/helpFi ... torial.htm) about how to have CoppeliaSim ROS enabled seems a little outdated

> 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
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: required python version of simExtROS is different from default in ROS melodic

Post by fferri »

lyh458 wrote: 08 Jun 2021, 04:21 Hi,

I tried to load ros interface plugin, so I git clone and build [simExtROS](https://github.com/CoppeliaRobotics/simExtROS), but have several problems and errors bother me. Here are my environments:

- system: ubuntu 18.04
- ROS: melodic
- CoppeliaSim: V4.2.0

**Question 1:** _can build with python 3, but run with python 2?_
Python 3 is a build-time dependency of libPlugin, so you are required to have Python 3 at the time of compiling simExtROS.

However other ROS-related files are generated via ROS' Python modules, which for ROS melodic are only available for Python 2. So you are required to have Python 2 and ROS Python libs at the time of compiling simExtROS. (you better off upgrading your Ubuntu to 20+ and using ROS Noetic at least; Btw, if compiling for ROS Melodic, make sure to use the 'melodic' branch of simExtROS!)

However, you don't need any Python interpreter for loading the ROS plugin.

lyh458 wrote: 08 Jun 2021, 04:21 **Question 2:** _plugin 'ROSInterface': load failed_
This usually means that some library required by the plugin cannot be loaded.

lyh458 wrote: 08 Jun 2021, 04:21 - **Question 3:** _can use libsimExtROSInterface.so of V4.0.0 in V4.2.0?_
Generally speaking, no.

There are slight API changes between every release, so chances that you can load an older plugin in a newer CoppeliaSim release are very low.
lyh458 wrote: 08 Jun 2021, 04:21 Since the required python version of CopperliaSim V4.0.0 is python 2 and same as melodic
Again, once the plugin is compiled, no Python interpreter is required.
lyh458 wrote: 08 Jun 2021, 04:21 [CoppeliaSim:loadinfo] plugin 'ROS': loading...
[CoppeliaSim:loadinfo] **plugin 'ROS': load succeeded.**
[CoppeliaSim:loadinfo] plugin 'ROSInterface': loading...
Plugin was originally named 'ROSInterface', then it has been renamed to 'ROS'.
Remove simExtROSInterface.so.

Cheers

lyh458
Posts: 4
Joined: 29 Sep 2020, 08:00

Re: required python version of simExtROS is different from default in ROS melodic

Post by lyh458 »

Thanks for your reply.
This usually means that some library required by the plugin cannot be loaded.
However, I followed the prompt, modified and then run

Code: Select all

./libLoadErrorCheck.sh
, seem no dependency is missing. The log is attached in question 2, could you help me check if any library or dependency is missing?

Thanks again!

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: required python version of simExtROS is different from default in ROS melodic

Post by fferri »

The 'ROS' plugin loads fine, what's the problem with that?

lyh458
Posts: 4
Joined: 29 Sep 2020, 08:00

Re: required python version of simExtROS is different from default in ROS melodic

Post by lyh458 »

fferri wrote: 09 Jun 2021, 09:47 The 'ROS' plugin loads fine, what's the problem with that?
Sorry, my mistake, I used to think that libsimExtROS.so and libsimExtROSInterface.so are different, but actually they are same. I just removed libsimExtROSInterface.so as you mentioned in last reply, and everything look good!

Thanks!

Post Reply