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

Can I use Python to fully write the Ros2 control package? #1615

Open
zouzhe1 opened this issue Jul 16, 2024 · 2 comments
Open

Can I use Python to fully write the Ros2 control package? #1615

zouzhe1 opened this issue Jul 16, 2024 · 2 comments

Comments

@zouzhe1
Copy link

zouzhe1 commented Jul 16, 2024

Can I use Python to fully write the Ros2 control package?

Because I am not familiar with CPP,
and I am used to using Python libraries such as can, canopen, and so on.

And my Python program for controlling hardware has already been written

@christophfroehlich
Copy link
Contributor

No, currently this is not possible. There were some attempts for python bindings for controllers afair, maybe @olivier-stasse can give an update on this topic.

If you don't have hard realtime requiremtents, you can use a topic based system with existing python hardware drivers.

@olivier-stasse
Copy link
Contributor

Dear @zouzhe1 ,
There is no solution which fits all the problems.

The ros2_controllers are already covering a large part of real life robotics problem.

But if you are designing your own controller and it is quite complex, I would strongly advice to decouple the mathematics from the encapsulation. You can view the ros2_controller interface as a standard interface to encapsulate controllers.

If you are quite good at python you can try:
https://github.com/ICube-Robotics/pytroller
generating a ros2_controller from python.

For complex controller, such as inverse dynamics on humanoid robot, and quick prototyping it is usually recommended to check the math with python following examples such as:
https://github.com/stack-of-tasks/tsid/tree/master/exercizes if you want to do Task Space Inverse Dynamics.

Then you can deploy it in a custom ros2_controller.

We wrote some python bindings to ros2_control, but they need more work.

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

No branches or pull requests

3 participants