Best practices, conventions, and tricks for ROS. Do you want to become a robotics master? Then consider graduating or working at the Robotics Systems Lab at ETH in Zürich!

ROS Best Practices, Conventions and Tricks

Best practices for ROS2 in the making. See the Foxy branch in the meanwhile.

This is a loose collection of best practices, conventions, and tricks for using the Robot Operating System (ROS). It builds up on the official ROS documentation and other resources and is meant as summary and overview.

  • 📚 Read: Head over to the Wiki to get started!
  • 🐛 Report: Share issues you encounter by submitting them.
  • 🔧 Improve: Make these practices even better. Submit a PR to improve a specific topic.

Also, check out the ROS package's ros_package_template/readme.md.

Owner
Robotic Systems Lab - Legged Robotics at ETH Zürich
The Robotic Systems Lab investigates the development of machines and their intelligence to operate in rough and challenging environments.
Robotic Systems Lab - Legged Robotics at ETH Zürich
Comments
  • Correct the inclusion and usage of Eigen in CMakeLists.txt

    Correct the inclusion and usage of Eigen in CMakeLists.txt

    Specifying ${EIGEN3_INCLUDE_DIR} as an explicit catkin_package INCLUDE_DIR is not as good idea as putting it as a DEPENDS package. That will do the same thing and, moreover, is future-proof. Further, it also adds required compiler definitions, which you've forgot to do here (and I think lots of people would). This can have disastrous consequences if you change some flags that alter memory layout of Eigen objects.

    Also, adding the include directory via a UseEigen3 file is more future-proof.

  • Added -Wall and -Werror to CmakeLists.

    Added -Wall and -Werror to CmakeLists.

    This shows all build warnings and turns them into errors, meaning that you cannot build a package with warnings anymore. I introduced this for the ANYdrive SDK and could fix all warnings so far.

    In my opinion this should be standard for all our packages.

    Additional literature: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

  • Problem building the example

    Problem building the example

    I have a problem in building the example...I've installed ROS Kinect instead of ROS Indigo.

    Here the error code after launching "catkin build ros_package_template"

    build] Found '1' packages in 0.0 seconds.
    [build] Updating package table.
    Starting >>> catkin_tools_prebuild
    No handlers could be found for logger "trollius"d] [catkin_tools_prebuild:cmake - 0.7]
    Failed <<< catkin_tools_prebuild [ 0.7 seconds ]
    Abandoned <<< ros_package_template [ Unrelated job failed ]
    [build] Summary: 0 of 2 packages succeeded.
    [build] Ignored: None.
    [build] Warnings: None.
    [build] Abandoned: 1 packages were abandoned.
    [build] Failed: 1 packages failed.
    [build] Runtime: 0.8 seconds total.

  • best practices for git

    best practices for git

    Hi. What are the best practices for organizing git repositories?

    Should the src/ folder be a git repository? Or should I make each package a separate repository?

  • Wiki: Lecture notes on Using Third-Party Libraries are not available

    Wiki: Lecture notes on Using Third-Party Libraries are not available

  • catkin_make is not working

    catkin_make is not working

    In file included from /home/viki/catkin_ws/src/ros_best_practices/ros_package_template/src/ros_package_template_node.cpp:2:0: /home/viki/catkin_ws/src/ros_best_practices/ros_package_template/include/ros_package_template/RosPackageTemplate.hpp:8:30: fatal error: std_srvs/Trigger.h: No such file or directory #include <std_srvs/Trigger.h> ^ compilation terminated. In file included from /home/viki/catkin_ws/src/ros_best_practices/ros_package_template/src/RosPackageTemplate.cpp:1:0: /home/viki/catkin_ws/src/ros_best_practices/ros_package_template/include/ros_package_template/RosPackageTemplate.hpp:8:30: fatal error: std_srvs/Trigger.h: No such file or directory #include <std_srvs/Trigger.h> ^ compilation terminated. make[2]: *** [ros_best_practices/ros_package_template/CMakeFiles/ros_package_template.dir/src/ros_package_template_node.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [ros_best_practices/ros_package_template/CMakeFiles/ros_package_template.dir/src/RosPackageTemplate.cpp.o] Error 1 make[1]: *** [ros_best_practices/ros_package_template/CMakeFiles/ros_package_template.dir/all] Error 2

  • Enhancement: static code analysis with roslint

    Enhancement: static code analysis with roslint

    Original PR #2 by @fkromer. Sorry for late reply. Your branch was gone so I revived your changes here. You're Co-authored-by now, that's the best I could do. You will be mentioned. Thanks for your effort.

  • Updates for ros2 template

    Updates for ros2 template

    • Use ament_cmake_auto to simplify CmakeLists
    • Format cpp files using ament_uncrusify
    • Use rclcpp components to build nodes
    • Update ROS2 launch file using Python (.launch.py)
    • changed files name to under_scored style according to cpp code style guide 4.3 in ROS Wiki

    I only tested my code on ROS2 Galactic.

  • ld error during catkin build

    ld error during catkin build

    When I tried to build the project with catkin build, it returns error like this:

    /usr/bin/ld: CMakeFiles/ros_package_template.dir/src/RosPackageTemplate.cpp.o: undefined reference to symbol '[email protected]@CXXABI_1.3' /usr/bin/ld: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

    After I searched the Internet, I found that it is probably because cmake didn't use the right compiler. See this https://stackoverflow.com/questions/59536040/libstdc-so-6-error-adding-symbols-dso-missing-from-command-line I think it might need to add a line like this in the CMakeLists.txt

    set(CMAKE_CXX_COMPILER "/path/to/g++")

    or simply modify the project line to

    project(ros_package_template CXX)

  • Add example where virtual call is appropriate

    Add example where virtual call is appropriate

    Sometimes virtual functions are costly, sometimes not. Show both examples in this repo.

    As suggested in #23 by @peci1:

    Virtual functions might be costly if the function is called often. Maybe the code could have a non-virtual function OftenCalledFunction and a virtual NotSoOftenCalledFunction. But that decision is on you.

  • C++ Debug Best Practices

    C++ Debug Best Practices

    It is really inconvenient to debug ros programs without supportive tools and resulted in wasting a lot of time. Considering the community lack of necessary tutorial for effective debug, can you complete the debug part.

  • call traversability_footprint service always failed

    call traversability_footprint service always failed

    hi: we used the traversability_estimation rospack for mapping the robot footprint cost map for our quadruped robot's body-path planner. the issue is that: when we call traversability_footprint service, this service always gived the error like"service call failed: service [/traversability_estimation/traversability_footprint] respond with an error: GridMap::at(...): No map layer 'traversability_slope' available", other similar errors are maybe traversability_step or traversability_roughness layer not available. so, we did not know what caused this service call failure, could you give us some advice? thank you!

CSC404: Computer Graphics [CG] & CSL402: Computer Graphics Lab [CG Lab]

COMPUTER-GRAPHICS-AND-COMPUTER-GRAPHICS-LAB CSC404: CG & CSL402: CG LAB [SEMESTER IV] Syllabus CG - Reference Books THE WALL MEGA SATISH - AUTHOR CG C

Apr 28, 2022
This Repo would take notes for some OCW courses which I consider it is excellent.

Excellent OCW This Repo would take notes for some OCW courses which I consider it is excellent. Course Code HomePage Assignment&Note [Done] MIT 6.S096

Apr 24, 2022
Please consider reading the README.md

cs50xweek4 Hi my name is ali and im graduated from cs50xharvard (Introduction to computer science) Please consider that all the contents are for educa

Dec 22, 2021
Please consider reading the README.md

cs50xweek5 Hi my name is ali and im graduated from cs50xharvard (Introduction to computer science) Please consider that all the contents are for educa

Dec 22, 2021
🎃 Submit creative FizzBuzz solutions in any language you want! Open for beginners !
🎃 Submit creative FizzBuzz solutions in any language you want! Open for beginners !

?? Hacktoberfest 2021 FizzBuzz Submit creative FizzBuzz solutions in any language you want! TL;DR: We're searching for creative/extraordinary/weird Fi

May 14, 2022
Pipet - c++ library for building lightweight processing pipeline at compile-time for string obfuscation, aes ciphering or whatever you want

Pipet Pipet is a lightweight c++17 headers-only library than can be used to build simple processing pipelines at compile time. Features Compile-time p

Jul 30, 2022
A ROS based Open Source Simulation Environment for Robotics Beginners
A ROS based Open Source Simulation Environment for Robotics Beginners

A ROS based Open Source Simulation Environment for Robotics Beginners

Aug 6, 2022
Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Jun 19, 2022
This is a project from my Embedded Systems Lab course. It's made using C and intended for the MSP430FG461 microcontroller.

This is a project from my Embedded Systems Lab course. It's made using C and intended for the MSP430FG461 microcontroller.

Dec 21, 2021
Material for the UIBK Operating Systems Lab (2022)

UIBK Operating Systems Lab 2022 This repository contains material required to complete exercises for the OS lab in the 2022 summer semester, including

Jul 20, 2022
A fun exercise to brute for a master lock combination if you forgot it.
A fun exercise to brute for a master lock combination if you forgot it.

Lock Decombinator From NerdLab Projects May 9, 2022 Updated at: May 10, 2022 A fun exercise to brute for a master lock combination if you forgot it. T

Jul 15, 2022
Wtf Riot? I just want to close League of Legends and live my life. Leave me alone. F*ck corporate adware.

RiotKiller Wtf Riot? Anyways... This application launches League of Legends by calling RiotClientServices.exe --launch-product=league_of_legends --lau

Mar 29, 2022
A python package to provide you with many useful tools for osu! servers, written in C++ for the best speeds possible.

pysu_bindings A python package to provide you with many useful tools for osu! servers, written in C++ for the best speeds possible. What? As most peop

Nov 29, 2021
ROS GNSS/INS driver for Inertial Labs positioning systems for the CARMA Platform
ROS GNSS/INS driver for Inertial Labs positioning systems for the CARMA Platform

CARMA Inertial Labs GNSS/INS Driver This is a fork of the Inertial Labs ROS package that is used for connecting to Inertial Labs GNSS/INS, IMU-P, AHRS

Dec 26, 2021
The Xnoe Operating System, for people who want an OS that is useless.

Xnoe OS An attempt at writing an "Operating System" in x86 assembler. Hi all, I have many hobbies, one of those is torturing myself with knowledge I p

Jul 12, 2022
This Repo Is Mainly For Developers Who Want to Contribute .

HacktoberFest-2021 Hacktoberfest 2021 Link To HacktoberFest 2021 Event details : Hacktoberfest® is open to everyone in our global community. Whether y

Oct 25, 2021
If the button pressed esp will reset and App mode will on. App mode will on then led will on, network is connected led will off.

DHT22-to-Google-sheet-Reset-Using-ESP8266-LED-Switch If button pressed esp will reset and App mode will on. App mode will on then led will on, network

Oct 5, 2021
Comparing data of module exports from disk and memory, then caching any differences.
Comparing data of module exports from disk and memory, then caching any differences.

Inline-PatchFinder Need to see if the process you're reversing/analyzing is patching/hooking any loaded module's exports? Well, look no further. Inlin

Jun 20, 2022
An advanced in-memory evasion technique fluctuating shellcode's memory protection between RW/NoAccess & RX and then encrypting/decrypting its contents
An advanced in-memory evasion technique fluctuating shellcode's memory protection between RW/NoAccess & RX and then encrypting/decrypting its contents

Shellcode Fluctuation PoC A PoC implementation for an another in-memory evasion technique that cyclically encrypts and decrypts shellcode's contents t

Aug 5, 2022