Giter Site home page Giter Site logo

leggedrobotics / ros_best_practices Goto Github PK

View Code? Open in Web Editor NEW
1.5K 101.0 412.0 188 KB

Best practices, conventions, and tricks for ROS

Home Page: https://rsl.ethz.ch/education-students/lectures/ros.html

License: BSD 3-Clause "New" or "Revised" License

CMake 38.52% C++ 61.48%
ros robotics best-practices conventions

ros_best_practices's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros_best_practices's Issues

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.

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

Create 4 packages: algorithm, algorithm_msgs, algorithm_ros and rqt_algorithm

I propose to create 4 packages to extend the examples:

  • algorithm (ROS-independent core)
  • algorithm_msgs (ROS msgs/srvs only)
  • algorithm_ros (ROS-wrapper around algorithm using algorithm_msgs and containing a ROS node)
  • rqt_algorithm (ROS GUI to interact with algorithm_ros)

We can discuss the naming :-)

I could add it if you want.

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.

Naming Convention Violations for Variables in RosPackageTemplate

The member variables in the RosPackageTemplate package of this repository are not following the recommended naming conventions outlined in the ROS C++ Style Guide.

According to ROS style guide, member variables should be named using under_scored, while in the current implementation, camelCase is used.

For example, in the RosPackageTemplate class:

- serviceServer_
- subscriberTopic_
- nodeHandle_

I have no problem making a pull request to address this issue if needed.

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?

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!

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.

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 '_ZTVN10__cxxabiv121__vmi_class_type_infoE@@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)

Nodelet conventions

Hey!

it would be nice to have also conventions for nodelets like naming, basic structure. :)

Have a great day!
Ugnius

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.