Skip to content

Conversation

@Yadunund
Copy link
Contributor

@Yadunund Yadunund commented Nov 25, 2025

The flowstate_ros_bridge queries the Flowstate Solution Servce to get a list of BTs. See here. The default request params will only query 20 BTs as seen here. Another area where page_size is used is querying the execute for a list of running operations using this proto.

If your solution had more than 20 BTs, calling the service to list the behavior trees would return a truncated list.

This PR

  • Makes the page_size configurable and by default sets it to the max value.
  • Makes some other executive parameters configurable.
  • Ran clang linter on flowstate_ros_bridge which adds some formatting changes.

@Yadunund Yadunund requested a review from b-corry November 25, 2025 15:35
Copy link
Collaborator

@mjcarroll mjcarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small nits

const std::string &solution_service_address,
std::size_t deadline_seconds = 5,
std::size_t update_rate_millis = 1000);
std::size_t update_rate_millis = 1000, std::size_t page_size = 100);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed this with @luca-della-vedova who suggested relying on next_page_token to recursively get all pages. We change the arg to std::optional<std::size_t> with default nullopt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually upon further thought I feel we should remove the parameter altogether and instead:

  • In the clear_and_delete_operations here, always iterate through all operations. The function's API promises to delete all currently running operations, deleting only one page goes against that.
  • In the behavior_trees here, either do the same as the above or make it a function parameter with default value, i.e.:
// Current
absl::StatusOr<std::vector<BehaviorTree>> behavior_trees() const;
// After, return the first `n` or all the behavior trees.
absl::StatusOr<std::vector<BehaviorTree>> behavior_trees(std::optional<std::size_t> n = std::nullopt) const;

But still my recommendation would still be to remove it altogether since it's not clear what the ordering of the behavior trees returned would be, and "first n" might mean anything from "alphabetical order", "last edit order", "creation order", non-guaranteed order, and unless we can guarantee a fixed ordering users should probably not rely on it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yadunund This is an implementation of the approach where we always get all running operations and behavior trees 4142ba3

b-corry

This comment was marked as outdated.

@Yadunund Yadunund merged commit 739ce80 into main Dec 4, 2025
2 of 3 checks passed
@Yadunund Yadunund deleted the yadu/increase-list-bt-page-size branch December 4, 2025 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants