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)
评论列表
文章目录