Jetson AGX Orin 下 ZED SDK安装和卸载,及zed-ros2安装

0、本机基础环境:

CUDA:11.4        Jetpack:5.1.2        L4T:35.4.1        Ubuntu:20.04 focal   camera:zedm

因此,在官网下载安装包:ZED SDK 4.2 - Download | Stereolabs
选择对应的版本,同时SDK 版本与zed-ros2版本有对应关系,这点需要注意一下。
本文下载的是ZED_SDK_Tegra_L4T35.4_v4.1.2.zstd.run; 即SDK4.1.2版本
需要注意的:根据安装的SDK版本来选择对应的zed-ros2版本。

1、ZED SDK安装

参考官方安装步骤:How to Install ZED SDK on NVIDIA® Jetson - Stereolabs
按照提示安装即可;

chmod +x ZED_SDK_Tegra_L4T35.4_v4.1.2.zstd.run
./ZED_SDK_Tegra_L4T35.4_v4.1.2.zstd.run     

2、 ZED SDK卸载
步骤也很简单,主要是找到安装位置;

cd /usr/local
sudo rm -rf zed

3、zed-ros2 安装

参考官方指导:Getting Started with ROS 2 and ZED - Stereolabs
官方代码仓库地址:https://github.com/stereolabs/zed-ros2-wrapper/tree/humble-v4.1.4?tab=readme-ov-file

然后按照官方步骤就可以安装

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 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

其中的rosdep update 出现错误,rosdep update一直显示超时; 网上有不同的解决办法,但是本文采用了 @鱼香ROS 的方法(感谢小鱼)

sudo pip install rosdepc  
sudo pip3 install rosdepc

安装好rosdepc后,然后运行下面代码:

sudo rosdepc init
rosdepc update

同理,在本文用到的rosdep 指令统统改为rosdepc
这样的话就可以顺利完成安装,如果安装过程中出现报错,基本是没有安装对应的包,然后从网上找一下安装步骤即可;由于安装时间有一段时间,记不清楚了哪些问题。可以参考这些github上的问题:

https://github.com/stereolabs/zed-ros2-wrapper/issues/272
https://github.com/stereolabs/zed-ros2-wrapper/issues?page=2&q=is%3Aissue+is%3Aclosed

 这样的话就安装成功啦,连上相机,运行一下指令:

ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zedm

这里有个小插曲,我的jetson安装了conda,base环境的python是3.9版本,导致运行不成功。我切换到另一个环境,python是3.8版本,然后就可以了。我也很奇怪,后面解决了再贴上。

python3.9运行错误:

(base) nvidia@nvidia-desktop-o:~$ ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zedm
[INFO] [launch]: All log files can be found below /home/nvidia/.ros/log/2024-11-27-10-10-49-012063-nvidia-desktop-o-19829
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure('executed command failed. Command: xacro /home/nvidia/ros2_ws/install/zed_wrapper/share/zed_wrapper/urdf/zed_descr.urdf.xacro camera_name:=zed camera_model:=zedm custom_baseline:=0.0')>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 2 more times]
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 444, in execute
    self._perform_substitutions(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/actions/node.py", line 399, in _perform_substitutions
    evaluated_parameters = evaluate_parameters(context, self.__parameters)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 164, in evaluate_parameters
    output_params.append(evaluate_parameter_dict(context, param))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 71, in evaluate_parameter_dict
    evaluated_value = perform_substitutions(context, list(value))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 232, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/command.py", line 116, in perform
    raise SubstitutionFailure(f'executed command failed. Command: {command_str}')
launch.substitutions.substitution_failure.SubstitutionFailure: executed command failed. Command: xacro /home/nvidia/ros2_ws/install/zed_wrapper/share/zed_wrapper/urdf/zed_descr.urdf.xacro camera_name:=zed camera_model:=zedm custom_baseline:=0.0

python3.8环境:然后这样就可以啦。

(base) nvidia@nvidia-desktop-o:~$ conda activate yolox
(yolox) nvidia@nvidia-desktop-o:~$ ros2 launch zed_wrapper zed_camera.launch.py camera_model:=zedm
[INFO] [launch]: All log files can be found below /home/nvidia/.ros/log/2024-11-27-10-11-56-866813-nvidia-desktop-o-19844
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [19847]
[INFO] [zed_wrapper-2]: process started with pid [19849]
[robot_state_publisher-1] Parsing robot urdf xml string.
[robot_state_publisher-1] Link zed_camera_center had 2 children
[robot_state_publisher-1] Link zed_left_camera_frame had 1 children
[robot_state_publisher-1] Link zed_left_camera_optical_frame had 0 children
[robot_state_publisher-1] Link zed_right_camera_frame had 1 children
[robot_state_publisher-1] Link zed_right_camera_optical_frame had 0 children
[robot_state_publisher-1] [INFO] [1732673517.173597079] [zed.zed_state_publisher]: got segment zed_camera_center
[robot_state_publisher-1] [INFO] [1732673517.173732568] [zed.zed_state_publisher]: got segment zed_camera_link
[robot_state_publisher-1] [INFO] [1732673517.173747608] [zed.zed_state_publisher]: got segment zed_left_camera_frame
[robot_state_publisher-1] [INFO] [1732673517.173756728] [zed.zed_state_publisher]: got segment zed_left_camera_optical_frame
[robot_state_publisher-1] [INFO] [1732673517.173763736] [zed.zed_state_publisher]: got segment zed_right_camera_frame
[robot_state_publisher-1] [INFO] [1732673517.173769752] [zed.zed_state_publisher]: got segment zed_right_camera_optical_frame
[zed_wrapper-2] [INFO] [1732673517.242533520] [zed.zed_node]: ********************************

Jetson AGX Orin是一款强大的嵌入式计算平台,可以轻松安装ROS 2以实现机器人及其他自动化系统的开发运行。以下是使用300字中文回答Jetson AGX Orin安装ROS 2的步骤注意事项。 首先,确保Jetson AGX Orin已经正常运行,并且您已经完成了基本的设置配置。 接下来,从ROS 2官方网站(https://index.ros.org/doc/ros2/Installation/Foxy/Linux-Install-Debians/)下载适用于您的Jetson AGX OrinROS 2发行版,建议选择最新版本Foxy Fitzroy。下载完成后,将.deb文件保存到您的Jetson AGX Orin的本地存储中。 然后,在Jetson AGX Orin的终端中打开一个新的命令行窗口,以便在系统中进行安装。使用以下命令导航到.deb文件的目录: cd /path/to/deb/file 然后,使用以下命令安装ROS 2: sudo apt install ./ros-foxy-*.deb ROS 2安装过程可能会花费一些时间,具体取决于您的Jetson AGX Orin的性能网络连接速度。在安装过程中,请耐心等待,直到安装完成。 安装完成后,您需要设置ROS 2的工作环境。使用以下命令执行此操作: source /opt/ros/foxy/setup.bash 现在,您可以开始使用ROS 2Jetson AGX Orin上进行开发运行机器人应用程序了。请查阅ROS 2的文档教程,以了解更多关于ROS 2Jetson AGX Orin上的使用方法功能。 总结一下,安装ROS 2Jetson AGX Orin的过程包括下载适用于该平台的ROS 2发行版,并使用apt命令进行安装安装完成后,使用source命令设置ROS 2的工作环境。最后,您就可以开始使用ROS 2Jetson AGX Orin上进行开发运行机器人应用程序了。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值