Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Other issue]: How to access RobotContext inside Negotiation Evaluator? #461

Open
1 task done
CarlyyyChen opened this issue May 6, 2024 · 1 comment
Open
1 task done

Comments

@CarlyyyChen
Copy link

Before proceeding, is there an existing issue or discussion for this?

Description

Hello team, I am trying to create a customized Negotiation Evaluator that looks at what task the robot is running and assign priorities to those tasks. However it seems I cannot access RobotContext inside Negotiation class or the Evaluator class, and the proposals passed into the Evaluator::choose(~) are not associated with RobotContext either. I tried to look into the ParticipantId but it seems I cannot get a RobotContext using a participandId.

Any advice on this would be highly appreciated. Many thanks in advance!

@mxgrey
Copy link
Contributor

mxgrey commented May 17, 2024

RobotContext is meant to be inaccessible to the public API because it's a very sensitive and unstable class. Sensitive meaning any slight misuse of the class can break the system, including causing misbehavior or segfaults. Unstable meaning we might make breaking changes to it at any time, so downstream applications should not depend on it.

For the time being if you want to make a custom negotiator that uses information in the robot context, there are only two options:

  1. Fork the source code of rmf_ros2 and make your changes internally
  2. Capture the data you need for your negotiator using an external source and somehow keep it in sync with the RobotContext

Neither of these are pleasant. (1) will make it very easy to fall out of sync with future updates. (2) will be very error prone and tedious.

For the next generation rewrite we're moving towards a service-oriented architecture which will make it very smooth to customize every component of your system, including your negotiation. Until then I'm afraid that this level of customization is going to painful.

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

No branches or pull requests

2 participants