安装依赖
sudo apt install ros-$ROS_DISTRO-rgbd-launch ros-$ROS_DISTRO-libuvc ros-$ROS_DISTRO-libuvc-camera ros-$ROS_DISTRO-libuvc-ros
创建工作空间
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
克隆代码
git clone https://github.com/orbbec/ros_astra_camera
创建udev 规则
cd ros_astra_camera
sudo ./scripts/create_udev_rules
编译源码
cd ~/catkin_ws
catkin_make
修改astra.launch的代码
nano /catkin_ws/src/ros_astra_camera/launch/astra.launch
将以下内容添加至最后的“< /launch >”前。
<node pkg="uvc_camera" type="uvc_camera_node" name="uvc_camera" output="screen" />
<param name="width" type="int" value="320" />
<param name="height" type="int" value="240" />
<param name="fps" type="int" value="30" />
<param name="frame" type="string" value="wide_stereo" />
<param name="auto_focus" type="bool" value="False" />
<param name="focus_absolute" type="int" value="0" />
<!-- other supported params: auto_exposure, exposure_absolute, brightness, power_line_frequency -->
<param name="device" type="string" value="/dev/video2" />
<param name="camera_info_url" type="string" value="file://$(find uvc_camera)/example.yaml" />
添加环境变量后直接启动即可
source ~/catkin_ws/devel/setup.bash
roslaunch astra_camera astra.launch