Skip to content
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

Minor errors #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion C++/pid_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PIDControl (float kp, float ki, float kd, float sampleTimeSeconds, float minOutp
float maxOutput, PIDMode mode, PIDDirection controllerDirection)
{
controllerDirection = controllerDirection;
mode = mode;
this->mode = mode;
iTerm = 0.0f;
input = 0.0f;
lastInput = 0.0f;
Expand Down
18 changes: 9 additions & 9 deletions C++/pid_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ PIDControl
// Returns:
// Nothing.
//
inline void PIDSetpointSet(float setpoint) { pid->setpoint = setpoint; }
inline void PIDSetpointSet(float setpoint) { this->setpoint = setpoint; }

//
// PID Input Set
Expand All @@ -236,7 +236,7 @@ PIDControl
// Returns:
// Nothing.
//
inline void PIDInputSet(float input) { pid->input = input; }
inline void PIDInputSet(float input) { this->input = input; }

//
// PID Output Get
Expand All @@ -248,7 +248,7 @@ PIDControl
// Returns:
// The output of the specific PID controller.
//
inline float PIDOutputGet() { return pid->output; }
inline float PIDOutputGet() { return this->output; }

//
// PID Proportional Gain Constant Get
Expand All @@ -260,7 +260,7 @@ PIDControl
// Returns:
// The proportional gain constant.
//
inline float PIDKpGet() { return pid->dispKp; }
inline float PIDKpGet() { return this->dispKp; }

//
// PID Integral Gain Constant Get
Expand All @@ -272,7 +272,7 @@ PIDControl
// Returns:
// The integral gain constant.
//
inline float PIDKiGet() { return pid->dispKi; }
inline float PIDKiGet() { return this->dispKi; }

//
// PID Derivative Gain Constant Get
Expand All @@ -284,7 +284,7 @@ PIDControl
// Returns:
// The derivative gain constant.
//
inline float PIDKdGet() { return pid->dispKd; }
inline float PIDKdGet() { return this->dispKd; }

//
// PID Mode Get
Expand All @@ -296,7 +296,7 @@ PIDControl
// MANUAL or AUTOMATIC depending on what the user set the
// controller to.
//
inline PIDMode PIDModeGet() { return pid->mode; }
inline PIDMode PIDModeGet() { return this->mode; }

//
// PID Direction Get
Expand All @@ -308,7 +308,7 @@ PIDControl
// DIRECT or REVERSE depending on what the user set the
// controller to.
//
inline PIDDirection PIDDirectionGet() { return pid->controllerDirection; }
inline PIDDirection PIDDirectionGet() { return this->controllerDirection; }

private:
//
Expand Down Expand Up @@ -378,6 +378,6 @@ PIDControl
// AUTOMATIC: PID controller is on.
//
PIDMode mode;
}
};

#endif // PID_CONTROLLER_H