在Ubuntu 18.04.04上安装和配置Realsense D435i的步骤
时间: 2024-06-12 21:07:14 浏览: 246
以下是在Ubuntu 18.04.04上安装和配置Realsense D435i的步骤:
1. 下载和安装Realsense SDK:
```
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev
mkdir -p ~/realsense_ws/src
cd ~/realsense_ws/src
git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ~/realsense_ws/
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
```
2. 安装ibrealsense2:
```
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
```
3. 配置udev规则:
```
sudo cp ~/realsense_ws/src/realsense-ros/realsense2_camera/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
sudo modprobe uvcvideo
```
4. 启动camera:
```
source ~/realsense_ws/devel/setup.bash
roslaunch realsense2_camera rs_camera.launch
```
如果需要启用D435i的IMU功能,可以添加以下参数:
```
source ~/realsense_ws/devel/setup.bash
roslaunch realsense2_camera rs_camera.launch enable_imu:=true
```
5. 查看camera输入:
```
rostopic list
rostopic echo /camera/color/image_raw
rostopic echo /camera/depth/image_raw
rostopic echo /camera/infra1/image_raw
rostopic echo /camera/infra2/image_raw
rostopic echo /camera/imu
```
6. 使用rviz查看camera输入:
```
rosrun rviz rviz
```
在rviz中添加以下内容:
- Fixed Frame: camera_link
- Add -> By Topic -> /camera/color/image_raw
- Add -> By Topic -> /camera/depth/image_raw
- Add -> By Topic -> /camera/infra1/image_raw
- Add -> By Topic -> /camera/infra2/image_raw
- Add -> By Topic -> /camera/imu
阅读全文