ZebraDevs / robot_controllers

Robot control infrastructure
92 stars 80 forks source link

Member variable updated after return statement #21

Closed cpitts1 closed 8 years ago

cpitts1 commented 8 years ago

I was looking through robot controllers and was trying to understand the code contained in the file pid.cpp. I found that the member variable errorlast was updated after a return statement:

https://github.com/fetchrobotics/robot_controllers/blob/indigo-devel/robot_controllers/src/pid.cpp#L161

This seemed like a problem to me unless there is a C++ trick that I don't know about

mikeferguson commented 8 years ago

No magic -- this is just plain wrong. A quick look through repos shows that this isn't actually being used anywhere quite yet:

As such, we can fix it without much issue -- go ahead an open a PR when you get a chance.

mikeferguson commented 8 years ago

https://github.com/fetchrobotics/robot_controllers/pull/22