Closed wxmerkt closed 5 years ago
On top of that, we also need to revisit the naming conventions:
So here are some proposals: Formatting:
Naming convention:
Additional convention for humanoid robots.
I'd opt for clang-format-3.8 Google style. ROS style is not uniform and changing, the CLang isn't really tested. clang-format (and the different versions) is available on all platforms.
Regarding naming convention, no major preference but I'd go with a big standard as well. Not to be 100% strict with that but good to keep as a guideline.
Formatting fixed in #141.
Todo: fix naming the convention.
I went through the google style guide and PEP8 and further specified the style where there were multiple options. I also added suggestions for package and directory naming convention based off ROS standards.
exotica
exotica_python
exotica_examples
exotica_core_taskmaps
exotica_aico_solver
exotica_ik_solver
exotica_collision_scene_fcl
...
_solver
suffix._taskmaps
suffix.with_underscores.cpp
, with_underscores.h
, with_underscores.py
(don't use .cc, .hpp, ... file types)package_name\
package_name\launch\ (*.launch)
package_name\src\ (*.cpp)
package_name\include\package_name\ (*.h)
package_name\scripts\ (*.py)
package_name\init\ (*.in)
package_name\cmake\ (*.cmake and supporting scripts)
package_name\doc\ (doxygen and other files)
package_name\resources\ (urdf/srdf/meshes/scenes/trajectories/...)
package_name\test\ (c++/python test scripts)
package_name\test\resources\ (test resources)
For files in scripts/
, if they are Python file:
chmod +x filename
)Use override instead of virtual when overriding a function in a child class.
Order output parameters after inputs if returning values via arguments.
Avoid boost.
Always use c++11
Type names - CamelCasedWithFirstCapitalLetter
Variable names - with_underscores
Member variables - with_underscores_and_trailing_underscore_
Struct data members - with_underscores
Constants - kCamelCasedWithPrefix
Function names - CamelCasedWithFirstCapitalLetter
Namespace names (always single word) - lowercase
Enum names - CamelCasedWithFirstCapitalLetter
Enum data members - ALL_CAPS
Macro names - ALL_CAPS
Comments - // always use double slash
File comments - include author, copyright, and license
File/class/function/variable comments - /// always use doxygen documentation style comments
Implementation comments - // always use regular double slash comments on a separate line
TODO - // TODO(githubusername or email) use comments with enough detail - the name references who added it or who is responsible for fixing it
Formatting:
pyexotica
CamelCased
lower_case_with_underscores
_lower_case_with_leading_underscore
ALL_CAPS
__all__
)
E.g. Google