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
00021 import rospy
00022 import dynamic_reconfigure.client
00023
00024 from time import sleep
00025 roslib.load_manifest('sr_ronex_examples')
00026
00027
00028
00029 """
00030 This class demonstrate how to change the configuration parameters of a running ronex module.
00031 """
00032
00033
00034 class ChangeRonexConfigurationExample(object):
00035
00036 def __init__(self):
00037
00038 ronex_id = "test_ronex"
00039 ronex_path = "/ronex/general_io/" + ronex_id + "/"
00040 self.configure_ronex(ronex_path)
00041
00042 def configure_ronex(self, path):
00043 """
00044 In this example we are using the dynamic_reconfigure.client.
00045 It could also be done by calling the /ronex/general_io/X/set_parameters service directly (as in the c++ example)
00046 """
00047 client = dynamic_reconfigure.client.Client(path)
00048
00049
00050 params = {'input_mode_0': False, 'input_mode_1': False, 'pwm_period_0': 200, 'pwm_clock_divider': 3000}
00051 config = client.update_configuration(params)
00052
00053
00054
00055
00056
00057
00058 if __name__ == "__main__":
00059 rospy.init_node("change_ronex_configuration_py")
00060 ChangeRonexConfigurationExample()
00061
00062