You're reading the documentation for a development version. For the latest released version, please have a look at Kilted.

Chained Filter Controller

This controller wraps around filter_chain library from the filters package. It allows to chain multiple filters together, where the output of one filter is the input of the next one. The controller can be used to apply a sequence of filters to a single interface, the same filter chain to multiple interfaces, or different filter chains to different interfaces.

Parameters

This controller uses the generate_parameter_library to handle its parameters. The parameter definition file located in the src folder contains descriptions for all the parameters used by the controller.

Full list of parameters:

input_interfaces (string_array)

Name of the input state interface

Read only: True

Default: {}

Constraints:

  • parameter is not empty

output_interfaces (string_array)

Name of the output state interface

Read only: True

Default: {}

Constraints:

  • parameter is not empty

filter_chain

Map of parameters that defines a filter chain, containing filterN as key. Valid for all interfaces, overrides <input_interfaces>.filter_chain if set. The fields for each filter are: type: The filter plugin to be loaded name: Actual name semantically describing the filter, e.g., low_pass_filter params: And underlying map of parameters needed for a specific filter, refer to the specific filter documentation.

<input_interfaces>.filter_chain

Instead of a single configuration, a distinct configuration can be provided for each input interface. The key is the name of the input interface, and the value is a map of parameters that defines a filter chain, containing filterN as key. The fields for each filter are: type: The filter plugin to be loaded name: Actual name semantically describing the filter, e.g., low_pass_filter params: And underlying map of parameters needed for a specific filter, refer to the specific filter documentation.

An example parameter file for this controller can be found in the test directory for a single interface:

test_chained_filter:
  ros__parameters:
    filter_chain:
      filter1:
        name: filter1
        type: "filters/MeanFilterDouble"
        params:
          number_of_observations: 2
    input_interfaces: ["wheel_left/position"]
    output_interfaces: ["wheel_left/filtered_position"]

or for multiple interfaces:

test_chained_filter_multiple_interfaces:
  ros__parameters:
    filter_chain:
      filter1:
        name: position_filter
        type: "filters/MeanFilterDouble"
        params:
          number_of_observations: 2
    input_interfaces:
      - "wheel_left/position"
      - "wheel_right/position"
    output_interfaces:
      - "wheel_left/filtered_position"
      - "wheel_right/filtered_position"

test_chained_filter_multiple_interfaces_config_per_input:
  ros__parameters:
    input_interfaces:
      - "wheel_left/position"
      - "wheel_right/position"
    output_interfaces:
      - "wheel_left/filtered_position"
      - "wheel_right/filtered_position"
    wheel_left/position:
      filter_chain:
        filter1:
          name: wheel_left_filter
          type: "filters/MeanFilterDouble"
          params:
            number_of_observations: 2
    wheel_right/position:
      filter_chain:
        filter1:
          name: wheel_right_filter
          type: "filters/MeanFilterDouble"
          params:
            number_of_observations: 3