Realsense d435i SDK 和 ROS wrapper 安装以及相机imu和分别率参数更改
一、SDK参考官方网站
1.Register the server’s public key:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
2.Add the server to the list of repositories:
sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
3.Install the libraries (see section below if upgrading packages):
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
4.Optionally install the developer and debug packages:
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
二、ROS wrapper安装
官方网站按照方法二进项安装
这样做的目的是保证SDK和ROS wrapper的版本是统一的,应该都是最新的
1.新建工作空间,名字随意
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
- Clone the latest Intel® RealSense™ ROS from here into ‘catkin_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 ..
3.编译
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
三、测试
1.测试sdk
realsense-viewer
相机ros命令
roslaunch realsense2_camera rs_camera.launch
使用带有pointcloud2类型话题的相机命令,话题为 /camera/depth_registered/points
roslaunch realsense-ros rs_rgbd.launch
四、相机参数修改
- 输出imu信息
在include/nodelet.launch.xml 修改 unite_imu_method=‘copy’ 话题为camera/imu
rs_rgb.launch 分别输出两个不相关流 gyro, accel, 也可改为true,不过上述可以代替这两个话题
- 修改相机分辨率 640x480, rs_rgbd.launch
depth_width: 640
depth_height:480
depth_fps = 15
color_width: 640
color_height:480
color_fps = 15
fps 更改还是很重要的,为了更改分辨率我几乎把所有的.launch文件都改了 但是都不行,后来自己摸索这把fps一起更改了就ok了