00001 #!/usr/bin/env python 00002 00003 import rospy 00004 import dynamic_reconfigure.client 00005 import time 00006 00007 class ResizedImageClient(): 00008 def __init__(self, node, x=0.1, y=0.1, mps=1.0): 00009 self.client = dynamic_reconfigure.client.Client(node) 00010 self.resize_scale_x = x 00011 self.resize_scale_y = y 00012 self.msg_par_second = mps 00013 00014 def update(self): 00015 params = { 'resize_scale_x' : self.resize_scale_x, 'resize_scale_y' : self.resize_scale_y, 'msg_par_second' : self.msg_par_second} 00016 rospy.loginfo("update config \nresized_scale_x : %s \nresized_scale_y : %s \nmsg_par_second : %s", self.resize_scale_x, self.resize_scale_y, self.msg_par_second) 00017 config = self.client.update_configuration(params) 00018 00019 00020 if __name__ == '__main__': 00021 rospy.init_node('resized_image_client_sample') 00022 ric = ResizedImageClient('/head_resized') 00023 while True: 00024 ric.update() 00025 time.sleep(1) 00026