Skip to content

Commit

Permalink
controller now compiles without errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sdekhterman committed Oct 25, 2024
1 parent 39c206c commit 6d67e37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cpp_pid/include/cpp_pid/pid.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace auvsl
{
public:
// Contructor and destructor
PID(double dt, double max, double min, double Kp, double Kd, double Ki);
PID(double dt, double max, double min, double Kp, double Ki, double Kd);
~PID();

// Returns the manipulated variable given a setpoint and current process value
Expand Down
4 changes: 2 additions & 2 deletions cpp_pid/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ void writeToCSVfile(std::string name, Eigen::MatrixXd matrix)

int main(int argc, char **argv)
{
double T = 50, dt = 1/T, max = 70, min = -70, Kp = 10, Kd = 5, Ki = 2;
double T = 50, dt = 1/T, max = 70, min = -70, Kp = 10, Ki = 2, Kd = 5;

//make a server object that callsback odomentry information, an object to analysis the relevant waypoints, if the vehcile should stop, path errors fed into the controller, and a controller object
auvsl::Server* srvrObj = new auvsl::Server;
auvsl::Environment* envObj = new auvsl::Environment;
auvsl::PID* pidObj = new auvsl::PID(dt, max, min, Kp, Kd, Ki);
auvsl::PID* pidObj = new auvsl::PID(dt, max, min, Kp, Ki, Kd);

rclcpp::init(argc, argv);
auto node = rclcpp::Node::make_shared("fuzzyControl");
Expand Down
6 changes: 3 additions & 3 deletions cpp_pid/src/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
namespace auvsl
{
// Constructor
PID::PID(double dt, double max, double min, double Kp, double Kd, double Ki) :
PID::PID(double dt, double max, double min, double Kp, double Ki, double Kd) :
_dt(dt),
_max(max),
_min(min),
_Kp(Kp),
_Kd(Kd),
_Ki(Ki),
_pre_error(0),
_Kd(Kd),
_prev_error(0),
_integral(0)
{
}
Expand Down

0 comments on commit 6d67e37

Please sign in to comment.