Skip to content

TECS based controller#52

Draft
LLagu wants to merge 6 commits into
mainfrom
49-investigate-possible-usage-of-controller-based-on-tecs
Draft

TECS based controller#52
LLagu wants to merge 6 commits into
mainfrom
49-investigate-possible-usage-of-controller-based-on-tecs

Conversation

@LLagu

@LLagu LLagu commented Nov 27, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

@LLagu LLagu linked an issue Nov 27, 2024 that may be closed by this pull request

@caiopiccirillo caiopiccirillo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job so far! Nice to see the controller taking shape 😄

Comment thread src/controller/TECSController.h Outdated
double jp_; // Moment of inertia of the pendulum
double jr_; // Moment of the rotating arm

const double g_ = 9.81;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking in 2 options to move this const:

  1. To config (maybe other classes can use?)
  2. As constant in a nameless namespace on .cpp file

What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are going to be other shared constants I would say 2. for sake of simplicity.

Comment thread src/controller/TECSController.h Outdated
#include "ControllerInterface.h"
#include <chrono>

namespace tecscontroller {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep everything related to the controller lib in the same namespace controller

Comment thread src/controller/TECSController.cpp Outdated
namespace tecscontroller {


class TECSController : public ControllerInterface<double, double> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove this line (and its closing bracket) because you already defined the class in the header.

Comment thread src/controller/TECSController.cpp Outdated
Comment on lines +7 to +9
public:
double kappa;
double ktheta;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these variables are going to be used, move to header and initialize them in the constructor list (as you are already doing for the controller constants)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick re-read of my paper's summary I think ktheta and what I called kd_ in the code are the same thing and kappa should not even be there in the first place 😬

Comment on lines +12 to +15
TECSController(config::ConfigurationInterface& config, std::chrono::milliseconds cycle_time);
~TECSController() override = default;
void Read(double error) override;
[[nodiscard]] double Write() override;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary for this moment: documentation. But we should create one before merging.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a TODO 👍

Comment thread src/controller/TECSController.h Outdated
public:
TECSController(config::ConfigurationInterface& config, std::chrono::milliseconds cycle_time);
~TECSController() override = default;
void Read(double error) override;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I owe you some article reading, because if the error in .cpp needs those inputs, we sould rethink the controller interface. But I'll read the article and I'll come back to help you with a good structure for this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! :)

@caiopiccirillo caiopiccirillo force-pushed the 49-investigate-possible-usage-of-controller-based-on-tecs branch from 688c1d3 to aabd489 Compare March 2, 2025 13:42
@caiopiccirillo

Copy link
Copy Markdown
Collaborator

@LLagu I added some changes, but mostly aren't fully correct. The unit tests are failing and I need to figure out what's going on.

@LLagu

LLagu commented Mar 3, 2025

Copy link
Copy Markdown
Collaborator Author

@LLagu I added some changes, but mostly aren't fully correct. The unit tests are failing and I need to figure out what's going on.

Looking at the changes right now, mega job as always. No rush at all for the tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate possible usage of controller based on TECS

2 participants