Skip to content

Changing Controller Gains

muralivnv edited this page Dec 28, 2017 · 3 revisions

Changing Gains

The dynamic-reconfigure-server for modifying the gains of the controller is written and will be running inside the backstepping_controller_node and a client node located at /asl_gremlin_pkg/src/controller/src/controllerGainSet_client.cpp is written to interface with the server.
Three types of gains can be changed, for position in x-direction, for position error in y-direction and for heading angle error. The following command line flags(any one) was expected by the client to change the controller gains.

controllerGainSet_client Flags

-lx : to change
-ly : to change
-lth : to change

Syntax

rosrun controller controllerGainSet_client <Gain-Flag> <data> <Gain-Flag> <data> ... 

Example

rosrun controller controllerGainSet_client -lx 0.65 -ly 0.2
rosrun controller controllerGainSet_client -lth 2.3 -lx 0.2
rosrun controller controllerGainSet_client -lth 2.3

Using Bash-Script

As typing in the command rosrun ... is too tedious, a bash-script called set_controller_gains.sh is written which would give the same functionality as mentioned above. Same flags(-lx, -ly, -lth) as mentioned above can be provided to the bash-script to change the gains.

set_controller_gains.sh -lx 0.65 -ly 0.2
set_controller_gains.sh -lth 2.3 -lx 0.2
set_controller_gains.sh -lth 2.3

Note: f in need of any help provide flag -h to the bash-script as follows

set_controller_gains.sh -h

Saving Gains

Once the gains were set, to load the current gain settings for the next subsequent runs use the bash-script save_controller_gains.sh to save them. Once this script is run, the current gains were saved automatically and will be used as default for the next runs.
If need to reset the current saved gains to default value, pass the flag default to the bash-script save_controller_gains.sh as follows

save_controller_gains.sh default

<<PrevPage | NextPage>>