wiki
Getting startedGuidesFAQ
1.0.0
1.0.0
  • b-it-bots wiki
  • @home
    • Getting started
      • First steps
      • Setting up your development environment
        • Configuring your editor
        • Using ssh
      • Adding your first contribution
    • Tutorials
      • Architecture
    • Guides
      • git
        • Making good commits
        • Branching model
        • Adding git aliases to make your life easier
        • Creating a release
      • SSH
      • ROS
        • Creating a new package
          • Creating a new node
        • Creating a new message, service or action
        • Testing in ROS
        • Linting
      • Coding conventions
        • C++
        • Python
      • Toolkit
        • CLion
        • Atom configuration
        • Using vim
        • TMUX - Terminal Multiplexer
    • Resources
    • FAQ
      • git
  • @work
    • 2018-05-06-navigation-atwork
    • 2018-05-06-simulation_mapping
    • How to use the RealSense2 camera
    • Getting the classifier from a data set
Powered by GitBook
On this page
  • Naming
  • Folder structure
  • Meta-packages
  • Adding the dependencies to the package.xml

Was this helpful?

  1. @home
  2. Guides
  3. ROS

Creating a new package

Naming

In order to create a new ROS package for one of the repositories some rules need to be considered:

  1. The package name has always the following format:

     prefix_my_package_name
  2. Use the right prefix for every repository: a. mas_domestic_robotics: mdr_ b. mas_industrial_robotics: mir_ c. mas_common_robotics: mcr_

  3. Use lowercase.

  4. Separate words in the package name by underscores ( _ ).

Examples for creating packages according to the above described rules are as follows:

catkin create_pkg mdr_grasp_planning
catkin create_pkg mir_whole_body_control
catkin create_pkg mcr_object_detection

Folder structure

Every ROS package within our repositories has to strictly match the following structure:

.
├── common
│   ├── config
│   ├── include
│   │   └── <package_name>
│   ├── src
│   │   └── <package_name>
│   ├── test
│   └── tools
├── ros
│   ├── config
│   ├── include
│   │   └── <package_name>
│   ├── launch
│   │   |— <package_name>.launch
│   ├── rviz
│   │   |— <package_name>.rviz
│   ├── scripts
│   │   └── <package_name>
│   ├── src
│   │   └── <package_name>_node
│   ├── test
│   └── tools
├── CMakeLists.txt
├── package.xml
├── setup.py
└── README.md

In short:

  • ROS-independent code goes into the common folder

  • the ros folder contains a ROS-wrapper for the functionality you are adding

Meta-packages

If the package you are creating is meant to contain other packages inside of it, it needs to have instead the following structure:

./<meta_package_name>
└── <meta_package_name>
    ├── CMakeLists.txt
    ├── package.xml
    └── README.md

Adding the dependencies to the package.xml

It is extremely important to maintain your package.xml up to date with its dependencies. Not doing so results in the need of specialized tools or manual inspection of launch files and source code to discover your package dependencies.

PreviousROSNextCreating a new node

Last updated 4 years ago

Was this helpful?