volume_manager.py 文件源码

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

项目:audio_file_player 作者: uts-magic-lab 项目源码 文件源码
def __init__(self,
                 base_set_command='amixer -c 0 sset Master playback',
                 base_get_command='amixer -c 0 sget Master playback'):
        self.base_set_cmd = base_set_command
        self.base_get_cmd = base_get_command
        self.curr_vol = 0
        rospy.loginfo("VolumeManager using base set command: '" +
                      self.base_set_cmd + "'")
        rospy.loginfo("VolumeManager using base get command: '" +
                      self.base_get_cmd + "'")

        self.sub = rospy.Subscriber('~set_volume',
                                    Int8,
                                    self.cb,
                                    queue_size=1)
        # Get volume to start publishing
        self.curr_vol = self.get_current_volume()
        self.pub = rospy.Publisher('~get_volume',
                                   Int8,
                                   latch=True,
                                   queue_size=1)
        self.timer = rospy.Timer(rospy.Duration(1.0), self.curr_vol_cb)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号