安装ros2的性能测试工具

1.安装前提

  1. 安装ROS2(省略)
  2. Cyclone DDS到**/opt/cyclonedds**
  3. 安装performance_test工具

2.安装Cyclone DDS

参考教程:https://github.com/eclipse-cyclonedds/cyclonedds
安装DDS需要以下条件:

C compiler (most commonly GCC on Linux, Visual Studio on Windows,   
Xcode on macOS); 
Optionally GIT version control system; 
**CMake**, version 3.16 or later; 
Optionally **OpenSSL**, preferably version 1.1;  
Optionally **Eclipse Iceoryx** version 2.0 for shared memory and   
zero-copy support; 
Optionally **Bison parser generator**. A cached source is checked into the repository.

我的电脑里自带的CMake及OpenSSl版本正好对应上了,就没装,直接装的Eclipse IceoryxBison parser generator,参考教程:https://iceoryx.io/latest/getting-started/installation/

2.1安装 Eclipse Iceoryx

安装依赖的工具包

sudo apt install gcc g++ cmake libacl1-dev libncurses5-dev pkg-config

通过git获得iceoryx

git clone https://github.com/eclipse-iceoryx/iceoryx.git

生成build文件

cd iceoryx
cmake -Bbuild -Hiceoryx_meta
# when you have installed external dependencies like ncurses you have to add them
# to your prefix path
cmake -Bbuild -Hiceoryx_meta -DCMAKE_PREFIX_PATH=$(PWD)/build/dependencies/

使用cmake编译源码

cmake --build build

安装到系统

sudo cmake --build build --target install

2.3 安装Bison parser generator

apt install bison

2.4 安装Eclipse Cyclone DDS

git获取文件

git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
cd cyclonedds
mkdir build

接下来比较坑,对应原文的

这上面是要配置的一些参数(不配置下面生成的DDS生成会出现一些问题)每个配置的命令格式为(用第一个举例子) cmake -DBUILD_EXAMPLES=ON ..
但会有几个有特例,第二个命令cmake -DBUILD_TESTING=ON ..在运行之前要在电脑上安装CUnit,参考文章CUnit,然后第三个命令不要运行(cmake --DBUILD_IDLC=NO ..),这个命令要是运行了,后面的都运行不了(在我电脑是这样的),如果运行了可以把NO变成ON运行,后面的参数按照上面的格式依次运行,这个 --DBUILD_IDLC一直等于NO就可以(后面没啥影响)。
配置build路径,运行

cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/cyclonedds/ ..
cmake --build .

安装

cmake --build . --target install

安装成功后会在/opt/cyclonedds/下出现

/opt/cyclonedds/lib
/opt/cyclonedds/bin
/opt/cyclonedds/include/ddsc
/opt/cyclonedds/share/CycloneDDS

看到出现这个DDS应该安装的差不多

3.安装performance_test

先启动ros2服务(如果装的是foxy版本或者其他版本,将rolling变成foxy)

source /opt/ros/rolling/setup.bash
mkdir -p ~/perf_test_ws/src
cd ~/perf_test_ws/src
git clone https://gitlab.com/ApexAI/performance_test.git
cd ..
# At this stage, you need to choose which middleware you want to use
# The list of available flags is described in the middleware plugins section
# Square brackets denote optional arguments, like in the Python documentation.
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DPERFORMANCE_TEST_CYCLONEDDS_ENABLED=ON
source install/setup.bash

这里colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DPERFORMANCE_TEST_CYCLONEDDS_ENABLED=ON会出现问题,是因为终端没有代理,即使网页有代理终端也不会有代理,参考我发的文章即可。
在运行source install/setup.bash时,也会出现问题,如./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory,这里需要找到你所缺少的libraries: xxx.so.0,在linux里搜索这个文件,找到他所属的路径,然后将这个路径加到/etc/ld.so.conf里,具体参考文章:https://blog.csdn.net/vitaminc4/article/details/78707198

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值