twist_controller_config.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004 #
00005 # Licensed under the Apache License, Version 2.0 (the "License");
00006 # you may not use this file except in compliance with the License.
00007 # You may obtain a copy of the License at
00008 #
00009 #   http://www.apache.org/licenses/LICENSE-2.0
00010 #
00011 # Unless required by applicable law or agreed to in writing, software
00012 # distributed under the License is distributed on an "AS IS" BASIS,
00013 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 # See the License for the specific language governing permissions and
00015 # limitations under the License.
00016 
00017 
00018 import rospy
00019 from dynamic_reconfigure.client import Client
00020 from cob_twist_controller.cfg.TwistControllerConfig import *
00021 
00022 '''
00023 Available keys for the dynamic_reconfigure update call
00024 '''
00025 NUM_FILT = 'numerical_filtering'
00026 DAMP_METHOD = 'damping_method'
00027 DAMP_FACT = 'damping_factor'
00028 LAMBDA_MAX = 'lambda_max'
00029 W_THRESH = 'w_threshold'
00030 SLOPE_DAMPING='slope_damping'
00031 BETA = 'beta'
00032 EPS_DAMP = 'eps_damping'
00033 EPS_TRUNC = 'eps_truncation'
00034 
00035 SOLVER = 'solver'
00036 PRIO = 'priority'
00037 K_H = 'k_H'
00038 
00039 CONSTR_JLA = 'constraint_jla'
00040 PRIO_JLA = 'priority_jla'
00041 K_H_JLA = 'k_H_jla'
00042 ACTIV_THRESH_JLA = 'activation_threshold_jla'
00043 ACTIV_BUF_JLA = 'activation_buffer_jla'
00044 CRIT_THRESH_JLA = 'critical_threshold_jla'
00045 DAMP_JLA = 'damping_jla'
00046 
00047 CONSTR_CA = 'constraint_ca'
00048 PRIO_CA = 'priority_ca'
00049 K_H_CA = 'k_H_ca'
00050 ACTIV_THRESH_CA = 'activation_threshold_ca'
00051 ACTIV_BUF_CA = 'activation_buffer_ca'
00052 CRIT_THRESH_CA = 'critical_threshold_ca'
00053 DAMP_CA = 'damping_ca'
00054 
00055 SIGMA_UJS = 'sigma_ujs'
00056 SIGMA_SPEED_UJS = 'sigma_speed_ujs'
00057 DELTA_POS_UJS = 'delta_pos_ujs'
00058 SIGMA_SPEED_UJS = 'delta_speed_ujs'
00059 
00060 KEEP_DIR = 'keep_direction'
00061 ENF_POS_LIM = 'enforce_pos_limits'
00062 ENF_VEL_LIM = 'enforce_vel_limits'
00063 ENF_ACC_LIM = 'enforce_acc_limits'
00064 TOL = 'limits_tolerance'
00065 MAX_VEL_LIN_BASE = 'max_vel_lin_base'
00066 MAX_VEL_ROT_BASE = 'max_vel_rot_base'
00067 
00068 KIN_EXT = 'kinematic_extension'
00069 EXT_RATIO = 'extension_ratio'
00070 
00071 '''
00072 Class inherits from dynamic_reconfigure.client.Client and implements some wrapper methods
00073 '''
00074 class TwistControllerReconfigureClient(Client):
00075 
00076     def __init__(self, timeout = None):
00077         super(TwistControllerReconfigureClient, self).__init__('twist_controller', timeout)
00078         self._current_config = {}
00079         self._update_config = {}
00080 
00081     def init(self):
00082         self._current_config = self.get_configuration()
00083         self._update_config.clear()
00084 
00085     def set_config_param(self, cfg_key, cfg_value):
00086         if cfg_key in self._current_config:
00087             self._update_config[cfg_key] = cfg_value
00088         else:
00089             rospy.logerr('Cannot update config with key {0}! Not available in current config.'.format(cfg_key))
00090 
00091     def update(self):
00092         self.update_configuration(self._update_config)
00093         self._update_config.clear()


cob_twist_controller
Author(s): Felix Messmer , Marco Bezzon , Christoph Mark , Francisco Moreno
autogenerated on Thu Jun 6 2019 21:19:26