Robotics StackExchange | Archived questions

Unable to set RMW_IMPLEMENTATION variable in ROS2

I installed ROS2 from source. Also installed RTICONNEXT before building. I set up the envionment for RTICONNEXT as well call "C:\Program Files\rti_connext_dds-5.3.1\resource\scripts\rtisetenv_x64Win64VS2017.bat" . Now if I try to run the demo nodes with rti connext. I set the rmw_implementation = rmw_connext_cpp. But while running the demo nodes I get an error : Expected RMW implementation identifier of 'rmw_connext_cpp' but instead found 'rmw_fastrtps_cpp', exiting with 102. This clearly states that the support for rti_connext is not installed. But specifically for this purpose I installed ROS2 again from source.

My question is how can I install the RTI_connext support ?

EDIT 1:

I again tried to install ROS2 from source. called the batch file for connext and now I have a build error :

    Starting >>> rosidl_generator_dds_idl
--- stderr: connext_cmake_module
CMake Error at cmake/Modules/FindConnext.cmake:235 (list):
  list GET given empty list
Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)


CMake Error at C:/dev/ros2/install/ament_cmake_core/share/ament_cmake_core/cmake/core/normalize_path.cmake:28 (message):
  normalize_path() the path '' must neither be empty nor contain semicolons
Call Stack (most recent call first):
  CMakeLists.txt:12 (normalize_path)


---
Failed   <<< connext_cmake_module       [ Exited with code 1 ]
Aborted  <<< rosidl_generator_dds_idl
Aborted  <<< rosidl_generator_c
Aborted  <<< poco_vendor

EDIT 2 :

I tried to print the local variables in FindConnext.cmake as follows :

  message("First variable:'${Connext_LIBRARIES}'")
  message("Second variable:'${_last_index}'")
  message("Third variable:'${_last_lib}'")
  list(GET Connext_LIBRARIES ${_last_index} _last_lib)

And this is the output I get before the build fails :

First variable:''
Second variable:'-1'
Third variable:''
CMake Error at cmake/Modules/FindConnext.cmake:238 (list):
list GET given empty list

Basically It is not finding any connext libraries.

I have already reproduced this on 3 different machines. Not sure what am I doing wrong.

EDIT 3:

Now I am trying to debug this code and printed some other local variables:

After line 190 and 191, I printed the optimized as well as the debug library name and the library path and it finds these libraries :

optimised library names :'nddsc.lib;nddscore.lib;nddscpp.lib;rticonnextmsgcpp.lib'
optimised library path :'"C:/PROGRA~1/rti_connext_dds-5.3.1/"/lib'
debug library names :'nddscd.lib;nddscored.lib;nddscppd.lib;rticonnextmsgcppd.lib'
debug library path :'"C:/PROGRA~1/rti_connext_dds-5.3.1/"/lib'

That means it is looking into the right path and finding the right libraries.

What I dont understand is, in line 213, why is ConnextLIBRARIES being set to "" ? Could this be a problem as after this, it does not enters the next 2 loops i.e. `if(foundalloptimizedlibraries)andif(foundalldebug_libraries)because we have already set it to""` in line 213.

Recommendations please ?

EDIT 4 :

Here is a summary of the steps I followed :

Installed Prerequistes

Additional Prerequisites

Getting the source code

Building the ROS2 code

Asked by aks on 2018-06-25 03:26:22 UTC

Comments

@Dirk Thomas : I found this script and it is entering in the first NOT condition. Not sure why.

Asked by aks on 2018-06-25 11:03:32 UTC

Without know what exact version you are trying to compile the line number aren't helpful. Please include the hash of the rmw_connext / rosidl_typesupport_connext repo you are using.

Asked by Dirk Thomas on 2018-06-25 11:21:20 UTC

@Dirk Thomas : I am using the latest-release version from here. I guess it is #259

Asked by aks on 2018-06-25 11:36:47 UTC

The error msg suggests that Connext_LIBRARIES is empty. The logic above (https://github.com/ros2/rmw_connext/blob/57a849992ae4229a798f936b52f54b9d705553a5/connext_cmake_module/cmake/Modules/FindConnext.cmake#L209-L235) doesn't seem to allow that to be the case.

Asked by Dirk Thomas on 2018-06-25 12:16:47 UTC

Please add message("...") statements above cmake/Modules/FindConnext.cmake:235 to output the various local variables how this happens.

Asked by Dirk Thomas on 2018-06-25 12:17:18 UTC

@Dirk Thomas : I have reproducd this issue on 3 different machines. If possible, could you please check at your end if things are working fine at your end ?

Asked by aks on 2018-06-26 08:43:38 UTC

Is the NDDSHOME environment variable set? Does it contain a space? https://community.rti.com/kb/my-nddshome-environment-variable-has-space-path-why-aren%E2%80%99t-shipped-examples-compiling

Asked by sloretz on 2018-06-26 09:33:08 UTC

Yes, NDDSHOME variable is already set. This is the output of SET command on windows: NDDSHOME=C:\Program Files\rti_connext_dds-5.3.1. Do you mean the space between Program Files ? @sloretz

Asked by aks on 2018-06-26 09:39:11 UTC

@sloretz : no this is not the problem as I replaced it with PROGRA~1 and it is still the same. I also printed some other local variables which I will update in the question.

Asked by aks on 2018-06-26 10:14:24 UTC

@sloretz @Dirk Thomas could you please have a look at it ? I am somehow unable to crack it

Asked by aks on 2018-06-26 15:47:59 UTC

To get more help you will probably need to fully describe how you have setup your workspace and all the commands that you're running. I'd suggest starting from the beginning and copying all your terminal outputs into a gist that you can share so we can understand what you're doing.

Asked by tfoote on 2018-06-26 15:53:51 UTC

@tfoote : although I followed the instructions here but still I have updated the question with all the steps I followed.

Asked by aks on 2018-06-27 01:54:09 UTC

@Dirk Thomas @sloretz @tfoote : Could you please have a look at it and let me know if I am making some common mistake or the FindConnext.cmake file has really some bug ?

Asked by aks on 2018-06-28 02:14:53 UTC

The double quotes in the middle of your library paths look suspicious. Maybe those are causing problems. I would suggest to continue debugging more until it is clear why the variables get the values they have (fully tracing the flow of the execution).

Asked by Dirk Thomas on 2018-07-27 18:50:23 UTC

Answers