ROS2 ZEDX UBUNTU 环境配置

发布于:2024-04-28 ⋅ 阅读:(17) ⋅ 点赞:(0)

一、环境要求

硬件:镭神域控 ZED X双目摄像机
ros2-foxy
zed sdk 4.0.8
cuda 11.4

二、CUDA+ZED SDK安装

安装显卡驱动以及CUDA 11.1
参考之前博文:

https://blog.csdn.net/qq_41950533/article/details/135673420?csdn_share_tail=%7B%22type%22%3A%22blog%22%2C%22rType%22%3A%22article%22%2C%22rId%22%3A%22135673420%22%2C%22source%22%3A%22qq_41950533%22%7D

安装ZED SDK ,先去官网找

https://www.stereolabs.com/developers

chmod +x ZED_SDK_Linux_*.run
./ZED_SDK_Linux_*.run 

参考:https://www.bilibili.com/read/cv11031642/

三、ROS-FOXY安装

参考fishros:

https://www.fishros.com/

wget http://fishros.com/install -O fishros && . fishros

rviz2: error while loading shared libraries: libOgreMain.so.1.12.1: cannot open shared object file: No such file or directory
source /opt/ros/foxy/setup.bash
https://blog.csdn.net/m0_58638748/article/details/137121004

四、ros zed wrapper

先构建目录,目录结构

  • ros_ws
    – build
    – lib
    –src
    —zed-ros2-wrapper
    —等等

再git

git clone https://github.com/stereolabs/zed-ros-examples.git
git clone https://github.com/stereolabs/zed-ros-interfaces
git clone  --recursive https://github.com/stereolabs/zed-ros2-wrapper.git
git clone https://github.com/ros-perception/image_common.git --branch 3.0.0

根据readme,执行

https://github.com/stereolabs/zed-ros2-wrapper

mkdir -p ~/ros2_ws/src/ # create your workspace if it does not exist
cd ~/ros2_ws/src/ #use your current ros2 workspace folder
git clone  --recursive https://github.com/stereolabs/zed-ros2-wrapper.git
cd ..
sudo apt update
rosdep install --from-paths src --ignore-src -r -y # install dependencies
colcon build --symlink-install --cmake-args=-DCMAKE_BUILD_TYPE=Release --parallel-workers $(nproc) # build the workspace
echo source $(pwd)/install/local_setup.bash >> ~/.bashrc # automatically source the installation in every new bash (optional)
source ~/.bashrc

五、启动ZED

$ ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zedx

Replace <camera_model> with the model of the camera that you are using: ‘zed’, ‘zedm’, ‘zed2’, ‘zed2i’, ‘zedx’, ‘zedxm’.

然后新启一个终端,在里面可视化:

rviz2

在rviz里通过ADD添加zed的topic

六、开机自启动服务启动不了

背景:首先写了一个shell主要内容是定义了抓取那些ros的话题写进rosbag,在写好启动ros-zed节点的服务和启动bash的服务
但是服务不启动
问题原因:服务有点问题,.service里的地址都是绝对地址,和实际对应不上。
使用指令:

journalctl -u XXX.service

来获取完整的服务日志,然后根据报错来改错

修改了service记得使用daemon-reload来重载服务

sudo systemctl daemon-reload 
sudo systemctl enable XXX.service
systemctl enable 服务名 (设置服务开机启动),对 3 (无界面)和 5 (GUI)运行级别都生效
systemctl disable 服务名 (关闭服务开机启动),对 3 (无界面)和 5 (GUI)运行级别都生效
systemctl is-enabled 服务名 (查询某个服务是否是自启动的)

参考:

https://blog.csdn.net/qq_41308872/article/details/133743091
https://blog.csdn.net/qq_41684621/article/details/117257839

七、向日葵

按照:https://sunlogin.oray.com/download下载到ubuntu上,同时移动端也要下载上一个向日葵
两个客户端同时登陆一个账号,手机就可以控制电脑了。
软件默认开机自启动+账号自动登陆,注:把设置中的客户端锁定关闭,系统sleep和screen black也关闭


网站公告

今日签到

点亮在社区的每一天
去签到