ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Is there any systematic approach to read and understand the flow of ROS source code?

asked 2018-03-07 00:38:42 -0600

malgudi gravatar image

updated 2022-06-12 19:43:51 -0600

lucasw gravatar image

I have been trying to study DWA local planner and base local planner source code. It has become very difficult to understand the flow. I have never analysed such a big code ever before. And I am new in the software engineering field. Do you know any systematic approach to read the code? Thank You.

edit retag flag offensive close merge delete


Nope, you have to understand the basic structure of ROS code .

You can understand the control flow by using other applications like roswtf , tf , view_frames...

chrissunny94 gravatar image chrissunny94  ( 2018-03-07 00:46:21 -0600 )edit

I have never analysed such a big code ever before. And I am new in the software engineering field

while your question "is there a systematic approach" is a valid one, I feel that any answer would most likely require some experience with SE in general. Analysing any piece of software you ..

gvdhoorn gravatar image gvdhoorn  ( 2018-03-07 01:50:21 -0600 )edit

.. haven't written can be a complex task, especially when you're not used to dealing with (large) software systems. If I may suggest, I would not limit your search to "ROS source code" for an analysis method: this is a problem people in all domains and using very different software frameworks ..

gvdhoorn gravatar image gvdhoorn  ( 2018-03-07 01:51:42 -0600 )edit

.. encounter, as it is just a complex problem.

gvdhoorn gravatar image gvdhoorn  ( 2018-03-07 02:05:58 -0600 )edit

I just find out the way using UML class diagram, but I am not sure I m just learning it and I will try it. Are there any other methods?

malgudi gravatar image malgudi  ( 2018-03-07 18:38:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-23 22:40:39 -0600

Albert_dH gravatar image


chrissunny94 and gvdhoorn are correct in that there are some things that are unavoidable to explore in detail--it is possible to follow just the flow of control for the use cases you are interested in.

It sounds like you have found some UML diagrams already. The Doxygen code documentation tool can generate diagrams for C, C++ and Java code and that can be very useful. It can also generate call graphs, but they do not always show details of repetition and preconditions for calls like a message sequence diagram will. I have not found a shortcut /tool for that yet :(

Some Integrated Development Environments have good code analysis tools, but it usually takes a high-specification computer and a bit of tweaking to their configuration to handle large projects. I consider ROS to be a medium-large project compared to the one I'm paid to work on. The complexity is (weirdly) the packaging that compartmentalizes the pieces of code. Code analyzers don't always handle that well.

For the past few years I have been using NetBeans C/C++ because it can handle (with tweaks to the JVM limits) large projects. Eclipse is another choice, but I have not worked with it recently.

Good luck with understanding the part of ROS you want to understand. It can be a big job; but usually you can find an expert to answer your questions when you really get stuck. The big thing is; if you ask harder questions with specific evidence of effort, then 'experts' are more likely to take the time to answer. Helping those who help themselves is very gratifying and I learn a lot doing it.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-03-07 00:38:42 -0600

Seen: 413 times

Last updated: Mar 07 '18