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
  • General Rules
  • Dynamic Parametrization
  • Skills and actions
  • Scenarios

Was this helpful?

  1. @home
  2. Guides
  3. ROS
  4. Creating a new package

Creating a new node

PreviousCreating a new packageNextCreating a new message, service or action

Last updated 4 years ago

Was this helpful?

General Rules

If you implement a ROS node some rules need to be followed: 1. The name of the file containing the ROS node has to be extend by " node". For instance: whole_body_controller_node.cpp 2. The node name passed to the ros::init() function should never include the repository specific prefix. 3. In the launch file of a node, the namespace tag (ns="...") needs to be added. The name of the meta-package in which the concerned package is located in, has to be used as this namespace. For instance:

<node pkg="mcr arm cartesian control " type="
arm_cartesian_control" name="
mcr_arm_cartesian_control " ns="mcr_manipulation "
output="screen" respawn="false"/>

In general, the algorithmic part of a component has to be developed framework independent (i.e. without any ROS specific artefacts), e.g. in C++ classes. In case of a framework change it is much easier to port a component with strict separation. The ROS node then only wraps your classes in order to get connected (by topics, actions, etc.) to the ROS world.

Dynamic Parametrization

Many algorithms have parameters (thresholds, velocities, filenames, etc.) which need to be configured in order to let the algorithm work properly. ROS provides an easy to use functionality called , which allows dynamic parametrization (through a GUI) while the component is already running. Therefore it is recommended, if an algorithm/component has configuration parameters, to use this embedded functionality. The GUI can be launched with the following command:

rosrun rqt_reconfigure rqt_reconfigure

Skills and actions

Components in our repository should be developed using smach state machines with an actionlib wrapper. This way we can guarantee that they are ready for the planner to use them.

Actions must always:

  • have a timeout with a default value

  • provide feedback during the execution

  • the outcome states should include:

    • REJECTED

    • RECALLED

    • PREEMTED

    • ABORTED

    • SUCCEEDED

Scenarios

Should be implemented as classes which inherit smach.StateMachine. They will ideally contain only skills of the robot and the minimum number of smach.States as possible.

Ideally, the scenarios will be substituted soon with a proper planner.

See the for more information.

dynamic reconfigure
template