1.项目介绍
项目整合了Tensorflow和ROS,通过这个项目可以实现手写数字识别、目标识别以及目标检测。
Github地址: https://github.com/cong/ros_tensorflow
下面直接开车!
2.环境要求
Ubuntu
Install ROS with catkin build. 创建工作空间
Install Tensorflow
Install CUDA 6.5 for NVIDIA TK1 (按需安装)
3.下载Git包
cd [CATKIN_WS]/src
git clone https://github.com/cong/ros_tensorflow.git
4.编译
通过以下命令编译ROS包:
cd [CATKIN_WS]
catkin_make
5.运行
手写数字识别 mnist:
# 首先,打开一个终端,输入:
roscore
# 其次,另外打开一个新终端,输入:
# (请提前安装"usb_cam" 节点)
roslaunch usb_cam usb_cam-test.launch
# 最后,再打开一个新终端,输入:
roslaunch ros_tensorflow ros_tensorflow_mnist.launch
# 输出"/result_ripe"话题
rostopic echo /result_ripe
识别/分类:
# 前两步同 mnist
# 最后,再打开一个新终端,输入:
roslaunch ros_tensorflow ros_tensorflow_classify.launch
# 输出"/result_ripe"话题
rostopic echo /result_ripe
目标检测(object detection):
# 前两步同 mnist
# 最后,再打开一个新终端,输入:
roslaunch ros_tensorflow ros_tensorflow_detect.launch
# 通过"image_view"观察结果
rosrun image_view image_view image:=/result_ripe
6.ROS 话题
话题发布名称 : /result_ripe
话题订阅名称 : usb_cam/image_raw
参考:
Tensorflow Object detection API
ROS Tutorials