本文主要是介绍ROS 进阶学习笔记(14) - About driving your iRobot Roomba/Create,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ROS 进阶学习笔记(14) - About driving your iRobot Roomba/Create
----------------
There are several iRobot ROOMBA/CREATE drivers in ROS community, by May 2016, the newest one sholuld be thecreate_autonomy . Here we only discuss about the one used by the book " ROS by Example _ hydro _ vol1 ".
----------------
这篇文章主要介绍使用下面的Create驱动上电不能充电问题。至于另2篇介绍iRobot Roomba作底盘驱动的博客参考:
http://blog.csdn.net/sonictl/article/details/49908949
http://blog.csdn.net/sonictl/article/details/50207949
There are two important script file you may usually need to edit/check: turtlebot_node.py & create_driver.py
The turtlebot_node.py is starting a ROS node for controlling your turtlebot base, i.e, the iRobot Roomba® or iRobot Create®.
The create_driver.py is a lower-level driver for driving your iRobot Roomba® or iRobot Create®.
The are working like this:
[Your other control message/topic sending nodes] ---->> [turtlebot_node.py] ---->> [create_driver.py]
Path:
/opt/ros/hydro/lib/create_node/turtlebot_node.py
/opt/ros/hydro/lib/python2.7/dist-packages/create_driver/create_driver.py
Enjoy :)
About turtlebot_node.py, edit the set_operation_mode() function as below:
def set_operation_mode(self,req):if not self.robot.sci:rospy.logwarn("Create : robot not connected yet, sci not available")return SetTurtlebotModeResponse(False)self.operate_mode = req.modeif req.mode == 1: #passiverospy.logwarn("about to run passive mode, 1s...")rospy.sleep(1.0)self._robot_run_passive()elif req.mode == 2: #saferospy.logwarn("about to run safe mode, 1s...")rospy.sleep(1.0)self._robot_run_safe()elif req.mode == 3: #fullrospy.logwarn("about to run full mode, 1s...")rospy.sleep(1.0) #wait 1s so I can use Ctrl+C to halt it when I hope to charge my ROOMBAself._robot_run_full()else:rospy.logwarn("Requested an invalid mode.")return SetTurtlebotModeResponse(False)return SetTurtlebotModeResponse(True)
这篇关于ROS 进阶学习笔记(14) - About driving your iRobot Roomba/Create的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!