Skip to content

Input port parsing issue in AreErrorCodesPresent BT node #4985

@DylanDeCoeyer-Quimesis

Description

@DylanDeCoeyer-Quimesis

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Computer:
  • ROS2 Version:
    • All
  • Version or commit hash:
  • DDS implementation:

Steps to reproduce issue

Add the node to a BT, set an error code in a BT variable, and try to use this node to compare the variable against the expected value.

Expected behavior

It returns BT::NodeStatus::SUCCESS.

Actual behavior

It returns BT::NodeStatus::FAILURE.

Reproduction instructions

Additional information

The AreErrorCodesPresent BT node has an input port called error_codes_to_check. This port is expecting a std::set<uint16_t>. However, BehaviorTree-CPP's getInput function is unable to parse and convert a string to std::set<uint16_t>. So, this line has no effect, meaning that the node is useless.

To make AreErrorCodesPresent work, I suggest to define the input port as a std::vector<int> which is supported by the getInput function. Once loaded, the vector can be converted to a std::set<uint16_t>.

In addition, the example provided in the documentation suggests that the provided error codes to check should be comma-separated. In BehaviorTree-CPP's convertFromString implementation, I can see no case where the comma (,) is used. Only the semicolon (;) is used as separator. So, the documentation is likely incorrect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions