Ubuntu18.04安装fast-dds-python及⽤例参考##安装依赖
$ pip3 install -U colcon-common-extensions vcstool
$ sudo apt update
$ sudo apt install -y libasio-dev libtinyxml2-dev
ubuntu怎么安装python
$ sudo apt update
$ sudo apt install -y swig libpython3-dev
##构建安装
$ mkdir -p fastdds_python_ws/src
$ cd fastdds_python_ws
$ wget /eProsima/Fast-DDS-python/main/pos
$ vcs import src < pos
$ colcon build
##测试:
$ cd fastdds_python_ws/src/fastdds_python/fastdds_python_examples/HelloWorldExample
终端1
$ python3 HelloWorldExample.py -p publisher
终端2
$ python3 HelloWorldExample.py -p subscriber
系统环境问题解决:
cmake版本太低(需要下载cmake 3.13以上版本)
#下载
wget /files/v3.14/cmake-3.14.2-Linux-x86_
#解压
tar zxvf cmake-3.14.2-Linux-x86_
#移动到opt下
sudo mv cmake-3.14.2-Linux-x86_64 /opt/cmake-3.14.2
#创建软连接
sudo ln -sf /opt/cmake-3.14.2/bin/* /usr/bin/
#验证
cmake --version
error: could not find git for clone of XXX
缺少git(如不缺少可跳过)
sudo apt install git
对于缺少module(_FastDdsPythonWrapper)
$ cd fastdds_python_ws/build/fastdds_python/src/swig/
$ sudo cp _FastDdsPythonWrapper.so /usr/lib/python3.6
对于缺少module(HelloWorld; _HelloWorldWrapper)
$ cd fastdds_python_ws/build/fastdds_python_examples/HelloWorldExample $ sudo cp HelloWorld.py /usr/lib/python3.6
$ sudo cp _HelloWorldWrapper.so /usr/lib/python3.6
对于缺少module(fastdds)
$ cd fastdds_python_ws/build/fastdds_python/src/swig
$ sudo cp fastdds.py /usr/lib/python3.6

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。