-
Notifications
You must be signed in to change notification settings - Fork 8
Developers Guide
Follow ROS Cpp Style Guide rigorously.
Follow Caktin CMake Style Guide.
Python code should follow pep8. Please see ROS PyStyleGuide for details. Use Anaconda
plugin for sublime text editor for style check.
Use this python script.
All pkgs (except commons
pkgs which don't have cpp or py code) depend on roslint for static code analysis.
To fix basic whitespace issues in Cpp files, use astyle.
sudo apt-get install astyle
find -regextype egrep -regex '.*\.[ch](pp)?$' -exec astyle '{}' --style=allman --indent=spaces=2 --pad-oper --unpad-paren --pad-header --convert-tabs \;
Similarly for python use pep8ify
sudo pip install pep8ify
pep8ify -nw .
[Note - Utils
directory contains scripts for formatting cpp, python, xml, CmakeList files. Since these are bash scripts I have also added formatting script for bash]
We maintain two forms of online documentation for ROS packages:
wiki pages / External docs: This is the AUVWiki repo. Home for tutorials and other sorts of information. This is mainly for people running your code.
auto-generated code documentation Internal docs: This is mainly for people integrating with or editing your code. Use Doxygen while documenting new code.
We use Git. Read the wiki page on git.
We use github issues on auv repo for tracking bugs.
We use two level of testing:
Library: At the library level, we use standard unit-test frameworks. In C++, we use gtest. In Python, we use unittest.
Message: At the message level, we use rostest to set up a system of ROS nodes, run a test node, then tear down the system.
ROS has established best practices and policies for writing and running tests.
Code should use ROS services, follow guidelines for their use:
use rosout for printing messages
uses the ROS Clock for time-based routines
Large files (anything over 1MB, really) often don't belong in the auv repositories, especially if they are just used for tests. These large files affect the time that it takes to checkout the repository.
Moderators: Mayank Mittal, Shikher Verma, Suryansh Agarwal . AUV-IITK