inorbit_republisher package from ros_inorbit_samples repo

inorbit_republisher

Package Summary

Tags No category tags.
Version 0.2.1
License MIT
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/inorbit-ai/ros_inorbit_samples.git
VCS Type git
VCS Version noetic-devel
Last Updated 2021-07-20
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

ROS to InOrbit topic republisher

Additional Links

No additional links.

Maintainers

  • InOrbit

Authors

No additional authors.

InOrbit republisher for ROS 1

This directory includes a republisher that allows mapping from arbitrary ROS values to InOrbit custom data key/value pairs for application-specific observability.

Currently only mapping from ROS topics is supported. The republisher could be extended to map actions, services and parameters.

Usage

Create a YAML config file specifying the mappings you would like to use using this format:

  republishers:
  - topic: "/fruits_per_cubic_m"
    msg_type: "fruit_msgs/Citrus"
    mappings:
    - field: "num_oranges"
      mapping_type: "single_field"
      out:
        topic: "/inorbit/custom_data/0"
        key: "oranges"
  - topic: "/hardware/status"
    msg_type: "hw_msgs/HardwareStatus"
    mappings:
    - field: "status"
      mapping_options:
        fields: ["lidar", "motor", "battery"]
        filter: 'lambda x: (x.status == 1)'
      mapping_type: "array_of_fields"
      out:
        topic: "/inorbit/custom_data/0"
        key: "hardware_error"

Then launch the republisher.py script passing the config file as the config param.

A suggested way to organize this is by creating the config file and launch file in your package, then the corresponding launch file would like like this:

<launch>
  <node name="inorbit_republisher" pkg="inorbit_republisher" type="republisher.py">
    <param name="config" textfile="$(find inorbit_republisher)/config/example.yaml" />
  </node>
</launch>

Mapping types

The republisher can map the ROS values to single field (e.g. 'fruit=apple') or to an array of fields (e.g. 'fruits=[{fruit1: apple, fruit2: orange}, {fruit1: melon, fruit2: apple}]'). The former is useful to capture simple fields and the latter to get data from an array of values.

Array of fields: mapping options

When republishing an array of fields, you can include a set of mapping_options for each mapping. These include:

  • fields: a set of fields that you'd like to capture from each array element. For example, if each array element contains the elements [a, c, d, e] and you'd like to get a and c only, you can specify it as:
  mapping_options:
    fields: ["a", "c"]

If no fields are specified, the republisher will get all the fields in each array element.

  • filter: a lambda expression that can be used to pick certain array elements based on a condition. For example, if you'd like to republish array elements where c > 5 only, you can do it with:
  mapping_options:
    filter: 'lambda x: (x > 5)'

Building and running locally

Find below instructions for building the package and running the node using the the code on the workspace (see also catkin).

Build

cd ~/catkin_ws
rosdep install --from-paths ~/catkin_ws/src --ignore-src --rosdistro=noetic
catkin clean
catkin build inorbit_republisher --verbose

Run

. ~/catkin_ws/install/setup.zsh
# Using the launch file under the 'launch' directory
roslaunch launch/example.launch

TODO

  • Mapping of nested, top-level and complex (object) fields
  • Schema validation
  • Better documentation
  • Error handling
  • Proper logging
  • Latched topic support
  • Mapping of ROS parameters
CHANGELOG

Changelog for package inorbit_republisher

0.2.1 (2021-07-20)

  • Initial Implementation
  • Contributors: Leandro Pineda

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Package Dependencies

System Dependencies

Dependant Packages

No known dependants.

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged inorbit_republisher at answers.ros.org

inorbit_republisher package from ros_inorbit_samples repo

inorbit_republisher

Package Summary

Tags No category tags.
Version 0.2.1
License MIT
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/inorbit-ai/ros_inorbit_samples.git
VCS Type git
VCS Version melodic-devel
Last Updated 2021-07-20
Dev Status MAINTAINED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

ROS to InOrbit topic republisher

Additional Links

No additional links.

Maintainers

  • InOrbit

Authors

No additional authors.

InOrbit republisher for ROS 1

This directory includes a republisher that allows mapping from arbitrary ROS values to InOrbit custom data key/value pairs for application-specific observability.

Currently only mapping from ROS topics is supported. The republisher could be extended to map actions, services and parameters.

Usage

Create a YAML config file specifying the mappings you would like to use using this format:

  republishers:
  - topic: "/fruits_per_cubic_m"
    msg_type: "fruit_msgs/Citrus"
    mappings:
    - field: "num_oranges"
      mapping_type: "single_field"
      out:
        topic: "/inorbit/custom_data/0"
        key: "oranges"
  - topic: "/hardware/status"
    msg_type: "hw_msgs/HardwareStatus"
    mappings:
    - field: "status"
      mapping_options:
        fields: ["lidar", "motor", "battery"]
        filter: 'lambda x: (x.status == 1)'
      mapping_type: "array_of_fields"
      out:
        topic: "/inorbit/custom_data/0"
        key: "hardware_error"

Then launch the republisher.py script passing the config file as the config param.

A suggested way to organize this is by creating the config file and launch file in your package, then the corresponding launch file would like like this:

<launch>
  <node name="inorbit_republisher" pkg="inorbit_republisher" type="republisher.py">
    <param name="config" textfile="$(find inorbit_republisher)/config/example.yaml" />
  </node>
</launch>

Mapping types

The republisher can map the ROS values to single field (e.g. 'fruit=apple') or to an array of fields (e.g. 'fruits=[{fruit1: apple, fruit2: orange}, {fruit1: melon, fruit2: apple}]'). The former is useful to capture simple fields and the latter to get data from an array of values.

Array of fields: mapping options

When republishing an array of fields, you can include a set of mapping_options for each mapping. These include:

  • fields: a set of fields that you'd like to capture from each array element. For example, if each array element contains the elements [a, c, d, e] and you'd like to get a and c only, you can specify it as:
  mapping_options:
    fields: ["a", "c"]

If no fields are specified, the republisher will get all the fields in each array element.

  • filter: a lambda expression that can be used to pick certain array elements based on a condition. For example, if you'd like to republish array elements where c > 5 only, you can do it with:
  mapping_options:
    filter: 'lambda x: (x > 5)'

Building and running locally

Find below instructions for building the package and running the node using the the code on the workspace (see also catkin).

Build

cd ~/catkin_ws
rosdep install --from-paths ~/catkin_ws/src --ignore-src --rosdistro=noetic
catkin clean
catkin build inorbit_republisher --verbose

Run

. ~/catkin_ws/install/setup.zsh
# Using the launch file under the 'launch' directory
roslaunch launch/example.launch

TODO

  • Mapping of nested, top-level and complex (object) fields
  • Schema validation
  • Better documentation
  • Error handling
  • Proper logging
  • Latched topic support
  • Mapping of ROS parameters
CHANGELOG

Changelog for package inorbit_republisher

0.2.1 (2021-07-20)

  • Initial Implementation
  • Contributors: Leandro Pineda

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Package Dependencies

System Dependencies

Dependant Packages

No known dependants.

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged inorbit_republisher at answers.ros.org