Jetson TX2 Jetpack4.2.3 Ubuntu18.04 D435i SDK及ROS安装

一、安装librealsense

1、依赖库安装

sudo apt-get install libudev-dev pkg-config libgtk-3-dev
sudo apt-get install libusb-1.0-0-dev pkg-config
sudo apt-get install libglfw3-dev
sudo apt-get install libssl-dev

安装libgtk-3-dev的时候可能会报错
在这里插入图片描述

2、下载安装SDK

git clone https://github.com/jetsonhacks/installRealSenseSDK.git

在文件夹下运行 ./installLibrealsense.sh
出现无权限错误:运行 chmod 777 ./installLibrealsense.sh
在运行 ./installLibrealsense.sh,完成安装
连接相机,在终端运行 realsense-viewer

二、在Ubuntu18.04下安装Ros-melodic

参考连接:官网连接
ROS包:https://github.com/IntelRealSense/realsense-ros
Ros-melodic安装: http://wiki.ros.org/melodic/Installation/Ubuntu

1.1配置Ubuntu存储库

1.2设置sources.list

sudo sh -c'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)main"> /etc/apt/sources.list.d/ros-latest.list'

1.3 set up your keys:添加密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

1.4 Installation更新

sudo apt update

1.5 桌面完整安装

a: Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception:

sudo apt install ros-melodic-desktop-full

若此时运行出错: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

sudo apt --fix-broken install

b: Desktop Install: ROS, rqt, rviz, and robot-generic libraries

sudo apt install ros-melodic-desktop

c: ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

sudo apt install ros-melodic-ros-base

d: Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

sudo apt install ros-melodic-PACKAGE

e.g.

sudo apt install ros-melodic-slam-gmapping

1.6 Environment setup:环境变量

a: If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

b: If you just want to change the environment of your current shell, instead of the above you can type:

source /opt/ros/melodic/setup.bash

c: If you use zsh instead of bash you need to run the following commands to set up your shell:

echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
source ~/.zshrc

1.7 Dependencies for building packages:

sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential

1.8 Initialize rosdep:

sudo apt install python-rosdep
sudo rosdep init
rosdep update

在这里插入图片描述
运行出错sudo rosdep init
解决:

#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133  raw.githubusercontent.com

1.9 测试

在终端运行

roscore

三、安装realsense-ros

realsenseV2.35.2 对应realsense-ros 2.2.14
官网:https://github.com/IntelRealSense/realsense-ros
下载安装:下载realsense相对应的realsense-ros版本,连接:https://github.com/IntelRealSense/realsense-ros/releases

git clone https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git

a: Create a catkin workspace Ubuntu

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/

b:

'catkin_ws/src/'
git clone https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
# 

在这里插入图片描述
在这里插入图片描述
c:编译

cd ~/catkin_ws 
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install

编译出错:catkin_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp:363:14: error: ‘using element_type = class ddynamic_reconfigure::DDynamicReconfigure {aka class ddynamic_reconfigure::DDynamicReconfigure}’ has no member named ‘registerVariable’
ddynrec->registerVariable(

原因:IntelRealSense-Ros上缺少DDynamic_reconfigure(被intel删掉了),因此需要安装DDynamic_reconfigure
解决办法:

sudo apt-get install ros-kinetic-ddynamic_reconfigure 

(没有效果)
下载源码ddynamic_reconfigure,将源码放到catkin_ws/src/下重新catkin_make

d:Ubuntu

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

e:启动相机节点

roslaunch realsense2_camera rs_camera.launch

f:查看节点

rostopic list

e: rviz查看結果

rviz

没有安装的话就安装一下

sudo apt-get install rviz

四、验证
b: 打开2个终端,输入

#终端1
roslaunch realsense2_camera rs_camera.launch
#终端2
rostopic list
rviz

此时并不能看到什么结果.
左上角 Displays 中 Fixed Frame 选项中,下拉菜单选择 camera_link
这是主要到Global Status变成了绿色
点击该框中的Add -> 上方点击 By topic -> /depth_registered 下的 /points 下的/PointCloud2
在这里插入图片描述

点击该框中的Add -> 上方点击 By topic -> /color 下的 /image_raw 下的image

1.http://wiki.ros.org/melodic/Installation/Ubuntu
2.https://github.com/IntelRealSense/realsense-ros
3.https://my.oschina.net/u/4412486/blog/4685555
4.https://github.com/jetsonhacks/installRealSenseSDK.git
5.git clone https://github.com/pal-robotics/ddynamic_reconfigure.git

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
要在Jetson Nano上安装ROS,可以按照以下步骤进行操作: 1. 首先,更新系统软件包列表,可以使用以下命令: ``` sudo apt update ``` 2. 接下来,根据你的需求选择不同的ROS版本进行安装。如果你的存储空间较大,建议安装完整桌面版,可以使用以下命令进行安装: ``` sudo apt install ros-melodic-desktop-full ``` 3. 安装完成后,需要将ROS的环境变量添加到你的bashrc文件中,这样每次打开终端时都会自动加载ROS环境。可以使用以下命令将环境变量添加到bashrc文件中: ``` echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc ``` 4. 最后,安装一些ROS的依赖包,可以使用以下命令进行安装: ``` sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential ``` 5. 初始化rosdep,可以使用以下命令进行初始化: ``` sudo rosdep init rosdep update ``` 这样,你就成功在Jetson Nano上安装ROS。请注意,以上步骤是基于Ubuntu 18.04的安装过程。如果你使用的是其他版本的Ubuntu,请参考ROS官方文档进行相应的安装步骤。\[1\]\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [Jetson-nano-Ubuntu18.04-安装ROS](https://blog.csdn.net/maijiayong/article/details/109910366)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [步骤一:Jetson Nano安装ROS步骤,及相关错误分析](https://blog.csdn.net/m0_60254369/article/details/126469198)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值