Skip to content

Commit 2aa28be

Browse files
author
Adolfo Rodriguez Tsouroukdissian
committed
Merge pull request #47 from ros-controls/w-unused-parameter
Address -Wunused-parameter warnings
2 parents 597bc8c + 0c9e8d0 commit 2aa28be

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

include/control_toolbox/pid.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class Pid
182182
* \param i_max The max integral windup.
183183
* \param i_min The min integral windup.
184184
*/
185-
void initPid(double p, double i, double d, double i_max, double i_min, const ros::NodeHandle &node);
185+
void initPid(double p, double i, double d, double i_max, double i_min, const ros::NodeHandle& /*node*/);
186186

187187
/*!
188188
* \brief Initialize PID with the parameters in a namespace
@@ -263,7 +263,7 @@ class Pid
263263
/**
264264
* \brief Update the PID parameters from dynamics reconfigure
265265
*/
266-
void dynamicReconfigCallback(control_toolbox::ParametersConfig &config, uint32_t level);
266+
void dynamicReconfigCallback(control_toolbox::ParametersConfig &config, uint32_t /*level*/);
267267

268268
/*!
269269
* \brief Set the PID error and compute the PID command with nonuniform time

src/limited_proxy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void calcDynamics2ndorder(double &a, double &dadp, double &dadv,
122122
// occur in a first order system.
123123

124124
static void calcDynamics1storder(double &a, double &dadv,
125-
double v, double lam, double acon)
125+
double v, double lam, double /*acon*/)
126126
{
127127
a = - lam*v;
128128
dadv = - lam;
@@ -166,8 +166,8 @@ double LimitedProxy::update(double pos_des, double vel_des, double acc_des,
166166
double Ficl = abs(Ficl_); // Integral force clamp
167167
double Flim = abs(effort_limit_); // Limit on output force
168168
double vlim = abs(vel_limit_); // Limit on velocity
169-
double pmax = pos_upper_limit_; // Upper position bound
170-
double pmin = pos_lower_limit_; // Lower position bound
169+
//double pmax = pos_upper_limit_; // Upper position bound. NOTE: Unused
170+
//double pmin = pos_lower_limit_; // Lower position bound. NOTE: Unused
171171
double lam = abs(lambda_proxy_); // Bandwidth of proxy reconvergence
172172
double acon = abs(acc_converge_); // Acceleration of proxy reconvergence
173173

@@ -191,7 +191,7 @@ double LimitedProxy::update(double pos_des, double vel_des, double acc_des,
191191
double last_pos_pxy = last_proxy_pos_;
192192
double last_vel_pxy = last_proxy_vel_;
193193
double last_acc_pxy = last_proxy_acc_;
194-
double last_vel_err = last_vel_error_;
194+
//double last_vel_err = last_vel_error_;. NOTE: Unused
195195
double last_pos_err = last_pos_error_;
196196
double last_int_err = last_int_error_;
197197

src/pid.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Pid::~Pid()
6868
}
6969

7070
void Pid::initPid(double p, double i, double d, double i_max, double i_min,
71-
const ros::NodeHandle &node)
71+
const ros::NodeHandle& /*node*/)
7272
{
7373
initPid(p, i, d, i_max, i_min);
7474

@@ -256,7 +256,7 @@ void Pid::updateDynamicReconfig(control_toolbox::ParametersConfig config)
256256
param_reconfig_mutex_.unlock();
257257
}
258258

259-
void Pid::dynamicReconfigCallback(control_toolbox::ParametersConfig &config, uint32_t level)
259+
void Pid::dynamicReconfigCallback(control_toolbox::ParametersConfig &config, uint32_t /*level*/)
260260
{
261261
ROS_DEBUG_STREAM_NAMED("pid","Dynamics reconfigure callback recieved.");
262262

test/pid_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ TEST(ParameterTest, integrationWindupTest)
3737
Pid pid(0.0, 2.0, 0.0, 1.0, -1.0);
3838

3939
double cmd = 0.0;
40-
double pe,ie,de;
4140

4241
cmd = pid.computeCommand(-1.0, ros::Duration(1.0));
4342
EXPECT_EQ(-1.0, cmd);

0 commit comments

Comments
 (0)