ROS2 | RTI Connext DDS Issue - Solution | Creating first package tutorial
Channel: Soft illusion
Date: 30/08/2020

Wish to get started with ROS2 and create a package? Or are you stuck with an initial Connext warning?
Glimpse of the problem we are aiming to solve in the video.
[connext_cmake_module] Warning: Neither the location at which Connext was found when the workspace was built [[/opt/rti.com/rti_connext_dds-5.3.1]] nor the NDDSHOME environment variable [[/opt/rti.com/rti_connext_dds-5.3.1]] point to a valid directory. Support for Connext will not be available.

Soft_illusion Channel is back with a new video to teach you how to get started with ROS2, including the installation, creating a package and finally a solution to the [connext_cmake_module] Warning.

#ROS2_errors #connext #RTI

To get started with ROS2; you will have to first install it. If you are using Ubuntu 20.04, you can install ROS2-foxy.
Following is the link to install the same:
https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Binary/

The instructions are very simple. Do follow it and let us know if you face any issues.

Once you have installed ros2, you can make your own repository using the following commands.
 1. mkdir -p ros2_ws/src
  2. cd ros2_ws/src
Next you can create your own package using the command below using which you can make and build your own project.
  3. ros2 pkg create ros2_new_pkg --build-type ament_cmake
  4. cd ..
ROS lovers will know that a catkin_make is required to build your ROS repository. 
On similar lines in ROS2 we have:
  5. colcon build
As shown in the video, you can see a successful build happening with the package created above.
This creates the folders: build, install, log along with the existing src folder. In ROS the catkin_make used to give us the build and the devel folder. 
Next as everyone well equipped with ROS will know, a source is needed on the setup.bash script. For this we used to run: source devel/setup.bash.
On similar lines in ROS2 we have:
  6. source install/setup.bash
Once the source is complete, most of you will face the following issue:
[connext_cmake_module] Warning: Neither the location at which Connext was found when the workspace was built [[/opt/rti.com/rti_connext_dds-5.3.1]] nor the NDDSHOME environment variable [[/opt/rti.com/rti_connext_dds-5.3.1]] point to a valid directory. Support for Connext will not be available.
This issue has a simple quick fix with this command.
7. sudo apt-get install ros-foxy-rmw-connext-cpp
After this when you do a source again (run command 6), you will be happy to see that the error has disappeared.

The above is actually just a warning and you can get away without solving it. But here's the reason why it happens because it's best to live a life with minimum warnings.
ROS2 uses DDS to communicate between nodes, several DDS libraries are available and supported by ROS2, 'Connext' is one of them which seems not to be available on your computer so ROS2 is using the default DDS instead (eProsima Fast RTPS). Hence when you run command 7 which installs ros-foxy-rmw-connext-cpp library, the warning doesn't appear any longer. :)

Facebook link to the Intro Video Artist, Arvind Kumar Bhartia:
https://www.facebook.com/arvindkumar.bhartia.9

Comment if you have any doubts on the above video. 
Do let us know if face any other issues with ROS2.
Also do make suggestions if you need a tutorial on any other project topics.
Do Share so that I can continue to make many more videos with the same boost. :)
Happy Coding. :)