Skip to content

Directory Structure

The controllers of different State, Input, Controller_Type are defined in this directory:

src/ros4crs/ros_controllers/include/ros_controllers/controllers

The folder structure

  • controller_common.h
  • platform I (e.g. car vs. rocket)
    • state_A-input_A
    • typedef.h
    • controller_1.h
    • controller_2.h
    • ...
    • state_A-input_B
    • typedef.h
    • ...
  • platform II
    • state_C-input_C
    • ...

Explanation:

  • Common imports, such as the ROS Controller interface, or visualization loading, is included in the controller_common.h file.
  • The shorthand type definitions for controllers of the same state and input types are put in the typedef.h file in each Platform/State_Input_Type folder (i.e. the state_A-input_B in the example above). The controller_common.h should be included in each of these files.
  • The controller specific definition are in its own file. The types and common stuff are imported via including typedef.h. It also imports its actual controller definition (e.g. from src/crs) and the dynamic server options if needed.

Use of a (new) controller

After adding the controller file (also typedef file if necessary), include the header in controller_node.cpp file, where the branching is determined on which controller to use.

Remarks

Re: the [XXX]Config.h files for Dynamic Config Servers (exists for some controllers)

The magical [XXX]Config.h files being included, which does not seem to be in the source files, are generated from .cfg files in the ros_controllers/cfg folder.

  • e.g. ff_fb.cfg file will generate a ff_fbConfig.h file