def __init__(self):
rospy.loginfo("Initializing AudioFilePlayer...")
self.current_playing_process = None
self.afp_as = SimpleActionServer(rospy.get_name(), AudioFilePlayAction,
self.as_cb, auto_start=False)
self.afp_sub = rospy.Subscriber('~play', String, self.topic_cb,
queue_size=1)
# By default this node plays files using the aplay command
# Feel free to use any other command or flags
# by using the params provided
self.command = rospy.get_param('~/command', 'play')
self.flags = rospy.get_param('~/flags', '')
self.feedback_rate = rospy.get_param('~/feedback_rate', 10)
self.afp_as.start()
# Needs to be done after start
self.afp_as.register_preempt_callback(self.as_preempt_cb)
rospy.loginfo(
"Done, playing files from action server or topic interface.")
play_file_server.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录