利用机器人操作系统ros对机器人进行控制,自主导航navigation输出的速度由于加速度大,会造成小车震动,需要进行速度平滑。
而实际运行时,还可以用用手柄,键盘,安卓app等对机器人进行操作,同一时刻控制小车运动,小车发生混乱,各种控制方式需要切换,因此需要用到cmd_vel_mux对多路速度进行切换,划分优先级。
键盘控制/节点node(话题topic): keyop(key_cmd_vel)
手柄控制/节点node(话题topic): joyop(joy_cmd_vel)
自主导航/节点node(话题topic): navigation(cmd_vel)
速度平滑/节点node(话题topic): velocity_smoother(cmd_vel_smooth)
http://wiki.ros.org/yocs_velocity_smoother?distro=indigo
控制方式切换/节点node(话题topic):cmd_vel_mux(cmd_vel_mux)
http://wiki.ros.org/yocs_cmd_vel_mux?distro=indigo
基座 :mobile_base
一直很疑惑到底如何切换,然后看到资料Kobuki'sControlSystem(http://wiki.ros.org/kobuki/Tutorials/Kobuki%27s%20Control%20System)。 其中这样一段话:
kobuki_node:(AKA mobile base) is actually a nodelet, which wraps the C++ driverfor communicating with Kobuki
cmd_vel_mux:is a velocity command multiplexer (or in otherwords a switch). Itmanages multiple incoming velocity commands according to theconfigured priority.
Kobuki controller: is a nodelet-based controller type - usedfor various applications; one example is thekobuki_safety_controller,which watches the bumper, cliff and wheel drop sensors and actsaccordingly. Use this to implement your own reactive controller (seethe next tutorial)
Furthermore, thereis an implementation of a velocity smoother:yocs_velocity_smoother.This tool is optional, but highly recommended to use. In case a nodepublishing velocity commands can't ensure their smoothness, put thissmoother in between thatnode and the cmd_vel_mux.
一直纠结于这句话,其中thatnode被我误解,我把cmd_vel_mux放在了keyop(key_cmd_vel)/joyop(joy_cmd_vel)/navigation(cmd_vel)下面,velocity_smoother(cmd_vel_smooth)前面,怎么样都觉得不对劲,就修改了velocity_smoother的节点源码,利用cmd_vel_mux输出的active来判别是导航还是远程控制,回看了下资料,才发现我把顺序搞反了。
欢迎大家批评,指正,交流!
联系方式:
emai: [email protected]