Rosanswers logo

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.

Originally posted by malgudi on ROS Answers with karma: 88 on 2018-03-07

Post score: 0

Original comments

Comment by chrissunny94 on 2018-03-07:
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...

Comment by gvdhoorn on 2018-03-07:\

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 ..

Comment by gvdhoorn on 2018-03-07:
.. 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 ..

Comment by gvdhoorn on 2018-03-07:
.. encounter, as it is just a complex problem.

Comment by malgudi on 2018-03-07:
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?


1 Answer 1


Rosanswers logo


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.


Originally posted by Albert_dH with karma: 26 on 2018-05-23

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.