Just a doubt I had

so, I am in chapter 3 of Ros control and I saw that roscpp is being used to create a package so that we can create a custom controller instead of python, is it a ROS thing, that we can only create custom controllers using cpp or is cpp better than python ? any explanation in this regard would be nice :).
Thank you.


So very good question. The short answer is that Cpp tends to be more efficient and fast in execution than python. That’s why traditionally controllers , which are programs executed with high frequencies, are made in Cpp.

I say tend because, although this is true, python uses libraries compiled in cpp, so in performance unless you need super efficient programs, you wont see the difference. An din development time, python is MUCH faster.

I hope this answered your question

thank you very much @duckfrost for the explanation you answered my question, if you can please give an example for controller made with python too. and one final question, do i need to be good at creating custom controllers for differential drive robots and manipulators ?. or technically speaking do i need to learn it for these kind of robots ? where i will be using hobby servos and dc motors nothing fancy.


I don’t have any controller made with python now that you mention it. Normally, already made controllers are used in ROS, because odds are the controller you need , someone has already done it.

Normally the controllers are already made by the company of the hardware, unless its a very simple robot. And in simulations most of the controllers are already done., so only if you are designing the controller for your company is useful that knowledge. Servos for example have laready position control, so you dont have to create the driver really.

@duckfrost thank you for the reply, I see so servos can be controlled with the already existing controllers.
anyways i started learning c++ so that i can understand controllers more better. looking forward to spend more time on the platform, absolutely love it!.

1 Like