Skip to content

Nav2_behavior_tree tests input_port doesn't get set #5295

@redvinaa

Description

@redvinaa

Bug report

Required Info:

  • Operating System:
    • Ubuntu 24.04 (jazzy docker)
  • Computer:
  • ROS2 Version:
    • jazzy docker
  • Version or commit hash:
  • DDS implementation:

Steps to reproduce issue

  1. Set the input port value here to something else than the default value (for example 2).
  2. Add EXPECT_TRUE(false) to the end of any test, so prints are shown.
  3. Print input port value in recovery_node tick function (to stderr so gtest doesn't hide it)
std::cerr << "RecoveryNode: number_of_retries = " << number_of_retries_ << std::endl;
  1. Run tests.

Expected behavior

Prints should say number_of_recoveries = 2 (or whatever random value you set).

Actual behavior

Prints say number_of_recoveries = 1 (because the default value is 1).

Additional information

In the background the value does get set, but to string type. So the default value of type int really doesn't get overwritten.
This is because the input_ports member is actually of type

using PortsRemapping = std::unordered_map<std::string, std::string>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions