美文网首页
04-Dynamic Reconfigure入门-python节

04-Dynamic Reconfigure入门-python节

作者: joey_zhou | 来源:发表于2016-12-12 12:08 被阅读76次

编码

mkdir nodes
vim server.py

#!/usr/bin/env python
import rospy

from dynamic_reconfigure.server import Server
from dynamic_tutorials.cfg import TutorialsConfig

def callback(config, level):
    rospy.loginfo("""Reconfigure Request: {int_param}, {double_param},\ 
      {str_param}, {bool_param}, {size}""".format(**config))
    return config

if __name__ == "__main__":
    rospy.init_node("dynamic_tutorials", anonymous = True)

    srv = Server(TutorialsConfig, callback)
    rospy.spin()

chmod +x nodes/server.py

运行测试

sudo apt-get install ros-indigo-rqt-reconfigure
rosrun dynamic_tutorials server.py
rosrun rqt_gui rqt_gui -s reconfigure

相关文章

网友评论

      本文标题:04-Dynamic Reconfigure入门-python节

      本文链接:https://www.haomeiwen.com/subject/vzfndttx.html