HaFred / ROS-DiLearnNavi

Yet Another Navigation Package
0 stars 0 forks source link

ROSPY vs. ROSCPP #10

Open HaFred opened 3 years ago

HaFred commented 3 years ago

I think the choice between rospy and roscpp is application-driven. Some applications, like autonomous vehicles, require low latency, and inherently roscpp is preferred. You can then narrow it further, like within autonomous vehicles, you might be okay with perception skipping a few frames but motion control/planning cannot skip any.

In the end, knowledge of both is important and if you can get by with rospy, with both accuracy and speed, why change? https://www.reddit.com/r/ROS/comments/lywv8s/rospy_vs_roscpp/

Also, bear in mind that, C++ is one of the best programming languages when it comes to performance. https://roboticsbackend.com/python-vs-cpp-with-ros/ https://roboticsbackend.com/when-to-use-python-vs-c-in-robotics/

HaFred commented 3 years ago

Fred: C++ more relies on the "low-level" layer as an inherent property. So, if you’re running a control loop at 100+ Hz, and if on top of that you need real-time constraints, then go for C++.

→ OK, C++ is performing well, but it’s not the lowest level in programming. Why not going deeper ?

Well, of course you can always go deeper and try to write code in assembly. But when it comes to motion planning, image processing, and networking, good luck with that.

C++ is a great language to maximize the performance/productivity ratio in robotics.

HaFred commented 3 years ago

Another big difference between Python and C++ is the fact that C++ is a compiled language, but Python is an interpreted language.

HaFred commented 3 years ago

According to these two posts on roboticsbackend.com, for the coming up ROS-VLP-3DRecon optimization and the henceforth navigation project, using rospy for agile development first is a good idea. The performance optimization part can be done after the proof-of-concept design comes out. Just do not over-engineer it.