Skip to content

Style and Contribution Guidelines

Ryan Liao edited this page Feb 11, 2024 · 3 revisions

The following is the style and contribution guidelines for working on Simulation Stack

URDF Format

Treat Marvin's URDF as de-facto standard.

Styling

  • Parameters should use snake_case
  • Put a comment above each link on what the link is
  • Add one line between a major block (ex. between link / joint, visual / collision / inertia). Add two lines between each link.
  • NO ABSOLUTE PATHS! Everything should be included relatively using $(find packagename)

Code reuse

  • Reuse code as much as possible! This reduces the amount of work needed for set up. For example, instead of defining your own inertia property, inertia.xacro already have premade inertia macros for common shapes
  • Similarly, if you think that a certain part of the code can be reused, try turning it into a xacro macro

Xacro macros

  • Macros should be placed in their respective files
  • Macros should have the following parameters:
    • parent: the name of the link it is connected to
    • *joint_origin: the location of the joint relative to the parent
  • When creating a new macro, think about where the mounting point should be that would make the most sense (ex. LiDAR's mounting point should be at the bottom). Create ${name}_link and ${name}_base_link to separate the object origin and the mounting origin

Package Dependency

  • If there is a package that needs to be added as a dependency, here are the two ways to add it:
    • If the package is on GitHub, it should be added as a git submodule using the command git submodule add -b <branch> <repo link> path
    • If the package is on apt, it should be added to setup.bash and package.xml

Issue, Branch & Pull Request

  • Make good use of git / GitHub features. Report issues using the issues tab, work on features in branches and send pull requests for review
  • Make sure that your changes are checked by multiple people. If the changes may be platform dependent (ex. installation files), try to test the code on multiple systems (ex. docker image & dual boot)
  • Do not push to main, you will end up with a breaking change when you think it is fine