Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 import roslib; roslib.load_manifest('sr_ronex_examples')
00021 import rospy
00022 import dynamic_reconfigure.client
00023
00024 from time import sleep
00025
00026
00027
00028 """
00029 This class demonstrate how to change the configuration parameters of a running ronex module.
00030 """
00031 class ChangeRonexConfigurationExample(object):
00032
00033 def __init__(self):
00034
00035 ronex_id = "test_ronex"
00036 ronex_path = "/ronex/general_io/" + ronex_id + "/"
00037 self.configure_ronex(ronex_path)
00038
00039 def configure_ronex(self, path):
00040 """
00041 In this example we are using the dynamic_reconfigure.client.
00042 It could also be done by calling the /ronex/general_io/X/set_parameters service directly (as in the c++ example)
00043 """
00044 client = dynamic_reconfigure.client.Client(path)
00045
00046
00047 params = { 'input_mode_0' : False, 'input_mode_1' : False, 'pwm_period_0' : 200 , 'pwm_clock_divider' : 3000}
00048 config = client.update_configuration(params)
00049
00050
00051
00052
00053
00054
00055 if __name__ == "__main__":
00056 rospy.init_node("change_ronex_configuration_py")
00057 ChangeRonexConfigurationExample()
00058
00059