

In case you have a project documented this way, you can easily run Doxygen tool from the built-in terminal in CLion to get the documentation.
DOXYGEN COMMENT EXAMPLES CODE
For example, IMAGE_PATH is set to the root of the project.įor more information on customizing these settings, please see rosdoc.Doxygen-style comments can be placed across the source code and used for generating full-fledged documentation in various formats. You can " roscd rosdoc" and look at the templates/doxy.template to see the many of the default settings used with Doxygen. By default, this is:įILE_PATTERNS: *.c *.cpp *.h *.cc *.hh *.py *.dox The most important is FILE_PATTERNS: these are the files that Doxygen will look inside of for documentation. Rosdoc comes with default settings that generally work well with packages in ROS. Please use the \todo tag wherever applicable. This is better than using //TODO or //FIXME or whatever other comments you might normally use, because it makes the todo-ness externally visible. */ĭoxygen provides a \todo tag, that can be used in any Doxygen-style comment block, e.g.: /** Make the value externally configurable */ĭoxygen collects these tags into a "related page," providing a nice reference for remaining work. String* name /**< A variable that is the coolest. Int error_number /**< A variable that can be confused with the other variable. * \param junk This is a cool junk varible * This description is displayed lower in the doxygen as an extended description along with * \brief This description shows up at the top of the doxygen so you don't have to scroll. Here is an example geared toward a class that is likely compiled into a library: The \htmlinclude line inputs a nicely formatted version of the package's manifest.xml file.ĭoxygen's main strength is that you can include documentation inline with your code. NOTE: you have to use C++ comment syntax in this file, e.g., : /** Also, if you use the roscreate-pkg tool to create your package, a mainpage.dox will be generated for you. To make things easier, we have created a default template in the rosdoc package, which you can find at rosdoc/templates/. There should only be one mainpage tag in your package, so we usually recommend creating a top-level file, e.g. The first thing you'll probably want to do is use the \mainpage tag. You can use any Doxygen markup in your code.
DOXYGEN COMMENT EXAMPLES HOW TO
For actual documentation on how to use the Doxygen documentation tool, please see the official Doxygen site.

NOTE: this page is not a comprehensive guide to Doxygen. For Python we generally use Epydoc or Sphinx.

With ROS packages, we generally use Doxygen to document C++-based code. Instead, we recommend that you use the rosdoc tool, which provides common templating and other features. You don't need to configure and run Doxygen manually in order to generate documentation for your ROS package. Doxygen searches for source code in your tree and generates API documentation for it. The main advantage of Doxygen is that you can write documentation directly within the comments of your source code. Doxygen is a tool for auto-generating API documentation, though you can also use it to generate documentation separate from an API.
