-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added dynamic reconfigure for PID gains #1
Changes from all commits
d5f9923
e2020db
1ec720c
3ed065a
8f83f74
712f2aa
04f11ae
90ab218
88d6bc8
c17668d
d30b816
76761cd
17e41b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#! /usr/bin/env python | ||
#********************************************************************* | ||
#* Software License Agreement (BSD License) | ||
#* | ||
#* Copyright (c) 2013, Open Source Robotics Foundation | ||
#* All rights reserved. | ||
#* | ||
#* Redistribution and use in source and binary forms, with or without | ||
#* modification, are permitted provided that the following conditions | ||
#* are met: | ||
#* | ||
#* * Redistributions of source code must retain the above copyright | ||
#* notice, this list of conditions and the following disclaimer. | ||
#* * Redistributions in binary form must reproduce the above | ||
#* copyright notice, this list of conditions and the following | ||
#* disclaimer in the documentation and/or other materials provided | ||
#* with the distribution. | ||
#* * Neither the name of the Open Source Robotics Foundation | ||
#* nor the names of its contributors may be | ||
#* used to endorse or promote products derived | ||
#* from this software without specific prior written permission. | ||
#* | ||
#* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
#* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
#* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
#* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
#* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
#* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
#* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
#* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
#* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
#* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
#* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
#* POSSIBILITY OF SUCH DAMAGE. | ||
#*********************************************************************/ | ||
|
||
# Author: Dave Coleman | ||
# Desc: Allows PID parameters, etc to be tuned in realtime using dynamic reconfigure | ||
|
||
|
||
PACKAGE='control_toolbox' | ||
|
||
from dynamic_reconfigure.parameter_generator_catkin import * | ||
|
||
gen = ParameterGenerator() | ||
|
||
# Name Type Level Description Default Min Max | ||
gen.add( "p_gain" , double_t, 1,"Proportional gain.", 10.0 , 0 , 1000) | ||
gen.add( "i_gain" , double_t, 1,"Integral gain.", 10.0 , 0 , 100) | ||
gen.add( "d_gain" , double_t, 1,"Derivative gain.", 10.0 , 0 , 100) | ||
gen.add( "i_clamp_min" , double_t, 1,"Min bounds for the integral windup", 10.0 , 0 , 100) | ||
gen.add( "i_clamp_max" , double_t, 1,"Max bounds for the integral windup", 10.0 , 0 , 100) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe dynamic_reconfigure interacts with the parameter server; it may be useful to give these the same names and defaults and their matching parameters. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you mean the full path of the parameters on the parameter server, the If you mean we should name the gains "p", "i", and "d" - I tried that and wasted a lot of time debugging why it wasn't working. There is a bug that disallows you to name a dynamic reconfigure parameter "i" ros/dynamic_reconfigure#6 I documented the issue on the tutorial in the red box. |
||
# PkgName #NodeName #Prefix for generated .h include file, e.g. ParametersConfig.py | ||
exit(gen.generate(PACKAGE, "control_toolbox", "Parameters")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be ${Boost_INCLUDE_DIR} or ${Boost_INCLUDE_DIRS} ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did some googling but I couldn't find anything conclusive about which one is right... I think they both work? I searched through the my ROS workspace and lots of code uses the singular
_DIR
include: