play_file_server.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:audio_file_player 作者: uts-magic-lab 项目源码 文件源码
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.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号