ROS2 问题解决办法

根据官方的文档在ubunt20.04上安装ROS2后 导入环境可能会出现下面的警告:
解决方法如下:
安装RTI Connext
导入设置文件设置 NDDSHOME 环境变量

附官方文档

RTI Connext (version 5.3.1, amd64 only)
Debian packages provided in the ROS 2 apt repositories
You can install a Debian package of RTI Connext available on the ROS 2 apt repositories. You will need to accept a license from RTI.
sudo apt install -q -y \
rti-connext-dds-5.3.1 # from packages.ros.org/ros2/ubuntu
Source the setup file to set the NDDSHOME
environment variable.
cd /opt/rti.com/rti_connext_dds-5.3.1/resource/scripts && source ./rtisetenv_x64Linux3gcc5.4.0.bash; cd -
Note: when using zsh
you need to be in the directory of the script when sourcing it to have it work properly
Now you can build as normal and support for RTI will be built as well.
Official binary packages from RTI
You can install the Connext 5.3.1 package for Linux provided by RTI, via options available for
After downloading, use chmod +x
on the .run
executable and then execute it. Note that if you’re installing to a system directory use sudo
as well.
The default location is ~/rti_connext_dds-5.3.1
After installation, run RTI launcher and point it to your license file (obtained from RTI).
Add the following line to your .bashrc
file pointing to your copy of the license.
export RTI_LICENSE_FILE=path/to/rti_license.dat
Source the setup file to set the NDDSHOME
environment variable.
source ~/rti_connext_dds-5.3.1/resource/scripts/rtisetenv_x64Linux3gcc5.4.0.bash
Now you can build as normal and support for RTI will be built as well.
RTI Connext (version 5.3.1, amd64 only)
To use RTI Connext DDS there are full-suite install options available for
or you can install a libraries-only Debian package of RTI Connext 5.3.1, available from the OSRF Apt repository under a .To install the libs-only Debian package:
sudo apt update && sudo apt install -q -y rti-connext-dds-5.3.1
You will need to accept a license agreement from RTI, and will find an ‘rti_license.dat file in the installation.
Add the following line to your .bashrc
file pointing to your copy of the license (and source it).
export RTI_LICENSE_FILE=path/to/rti_license.dat
All options need you to source the setup file to set the NDDSHOME
environment variable:
cd /opt/rti.com/rti_connext_dds-5.3.1/resource/scripts && source ./rtisetenv_x64Linux3gcc5.4.0.bash; cd -
Note: the above may need modification to match your RTI installation location
If you want to install the Connext DDS-Security plugins please refer to
.RTI Connext (5.3)
If you would like to also build against RTI Connext DDS there are options available for
You also need a Java runtime installed to run the RTI code generator, which you can get
.After installing, run RTI launcher and point it to your license file.
Source the setup file to set the NDDSHOME
environment variable before building your workspace.
The setup file and path will depend on your macOS version.
# macOS 10.12 Sierra
source /Applications/rti_connext_dds-5.3.1/resource/scripts/rtisetenv_x64Darwin16clang8.0.bash
# macOS 10.13 High Sierra
source /Applications/rti_connext_dds-5.3.1/resource/scripts/rtisetenv_x64Darwin17clang9.0.bash
You may need to increase shared memory resources following https://community.rti.com/kb/osx510
If you want to install the Connext DDS-Security plugins please refer to
.Enable Connext support
To use RTI Connext DDS there are options available for
After installing, run RTI launcher and point it to your license file.
Set the NDDSHOME
environment variable:
export NDDSHOME=/Applications/rti_connext_dds-5.3.1
You may need to increase shared memory resources following https://community.rti.com/kb/osx510.
If you want to install the Connext DDS-Security plugins please refer to
.RTI Connext 5.3
If you would like to also build against RTI Connext DDS there are options available for
After installing, use the RTI Launcher to load your license file.
Then before building ROS 2, set up the Connext environment:
call "C:\Program Files\rti_connext_dds-5.3.1\resource\scripts\rtisetenv_x64Win64VS2017.bat"
Note that this path might need to be slightly altered depending on where you selected to install RTI Connext DDS, and which version of Visual Studio was selected. The path above is the current default path as of version 5.3.1, but will change as the version numbers increment in the future.
If you want to install the Connext DDS-Security plugins please refer to
.RTI Connext
To use RTI Connext DDS there are options available for
After installing, run RTI launcher and point it to your license file.
Set the NDDSHOME
environment variable:
set "NDDSHOME=C:\Program Files\rti_connext_dds-5.3.1"
If you want to install the Connext DDS-Security plugins please refer to