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

Add a passthrough_controller demo #556

Closed
wants to merge 5 commits into from

Conversation

AndyZe
Copy link
Contributor

@AndyZe AndyZe commented Mar 30, 2023

This is a simple demo of a chained controller that I'm working on with @saikishor

@AndyZe AndyZe force-pushed the chained_controller_demo branch from 97bca55 to 44736ad Compare March 30, 2023 15:25
@AndyZe AndyZe marked this pull request as draft March 30, 2023 15:25
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2023

Codecov Report

Merging #556 (19eed91) into master (e7f9962) will increase coverage by 0.75%.
The diff coverage is 34.91%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master     #556      +/-   ##
==========================================
+ Coverage   35.78%   36.53%   +0.75%     
==========================================
  Files         189        7     -182     
  Lines       17570      676   -16894     
  Branches    11592      357   -11235     
==========================================
- Hits         6287      247    -6040     
+ Misses        994      134     -860     
+ Partials    10289      295    -9994     
Flag Coverage Δ
unittests 36.53% <34.91%> (+0.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ontroller/test/test_load_diff_drive_controller.cpp 11.11% <0.00%> (ø)
diff_drive_controller/src/odometry.cpp 42.16% <11.11%> (ø)
diff_drive_controller/src/speed_limiter.cpp 46.55% <11.11%> (ø)
...ive_controller/test/test_diff_drive_controller.cpp 17.62% <12.08%> (ø)
...iff_drive_controller/src/diff_drive_controller.cpp 47.09% <46.88%> (ø)
...de/diff_drive_controller/diff_drive_controller.hpp 100.00% <100.00%> (ø)
...troller/include/diff_drive_controller/odometry.hpp 100.00% <100.00%> (ø)

... and 189 files with indirect coverage changes

@saikishor saikishor force-pushed the chained_controller_demo branch from 92af54d to 5692487 Compare April 5, 2023 21:41
@saikishor saikishor force-pushed the chained_controller_demo branch from 5692487 to a5ed335 Compare April 5, 2023 21:45
@bmagyar
Copy link
Member

bmagyar commented Jun 20, 2023

@christophfroehlich @ARK3r do you guys think this'd be better hosted in the demos repo?

@ARK3r
Copy link
Contributor

ARK3r commented Jun 20, 2023

I honestly don't know enough about use cases for this, but I think it could be useful to demonstrate how to write a custom controller perhaps.

@saikishor
Copy link
Member

I honestly don't know enough about use cases for this, but I think it could be useful to demonstrate how to write a custom controller perhaps.

Hello @ARK3r,

With @AndyZe, we wrote this controller in order to have it as a tutorial/demo on how to write a chainable controller. This is a simple controller that simply takes the interface and forwards the interface to another controller. It is purely written for demonstration.

As we always have the controller name prepended to the exported interfaces, as in the interface /controller_1/position_x will be exposed as /passthrough_controller/controller_1/position_x, I don't think we will have a lot of use cases with this. In the future, we might modify it to expose it without the initial controller naming, then it might be useful.

@christophfroehlich
Copy link
Contributor

In this case I vote for the demo repository. I also proposed a GPIO controller there, where the use-case is kind of similar to this one (demonstration only).

@saikishor
Copy link
Member

Perfect!. We will then open a PR to the demos repository soon.
Thank you.

@christophfroehlich
Copy link
Contributor

@saikishor there is an existing PR for a chained controller example: ros-controls/ros2_control_demos#162

Will your contribution replace it (and work without any adaptions of upstream packages)?

@saikishor
Copy link
Member

saikishor commented Jun 21, 2023

@christophfroehlich Thanks for the reference to an existing example.

As far as I understand, that example PR shows how to launch and setup the controller chaining for an existing set of controllers, but there is no clear example of how to write a simple one (I'm aware of the existing admittance controller), but it is very complex for a newbie. This controller itself will serve as a simple example. I think this controller is kinda similar to the #318 's (chainable_forward_controller)

@olivier-stasse
Copy link
Contributor

I agree with @saikishor . Receiving the same kind of comments often, I am willing to help on the simple example.

@christophfroehlich
Copy link
Contributor

@saikishor Ok, I understand. Nevertheless, I think a self-contained example including how to write a chained controller, as well as how to configure the chain, would be most valuable. This would be then a merge of this one and the existing one from @destogl

@saikishor
Copy link
Member

@christophfroehlich Sounds good to me, then If I understood correctly, I will have to move this controller to the ros-controls/ros2_control_demos and maybe I can pick @destogl's commits and add changes on the top?.

I believe all these changes should go inside the example_10 folder structure right?

BTW, I am currently working on the controllers sorting, once I am done with that I will be happy to contribute to this.

@christophfroehlich
Copy link
Contributor

We have a PR for example_10 and example_11 already, so your's would be example_12 then 😉
I suggest having a look on the existing PR but make a new one directly to the master branch, otherwise we have to approve/merge it twice. And pls follow the folder structure of the master branch.

@saikishor
Copy link
Member

@christophfroehlich Sure. Thanks for the info. 👍

@saikishor
Copy link
Member

Hello @AndyZe!

You can close this PR, I've moved this example controller into the ros2_control_demos repo under example_12.

Thank you,

Best Regards,
Sai

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.

7 participants