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

[MCControler] Update main robot name #423

Merged
merged 15 commits into from
Jan 17, 2024

Conversation

antodld
Copy link
Contributor

@antodld antodld commented Jan 11, 2024

This PR allows to rename the main robot declared in mc_rtc.yaml as the one named in a controller configuration in robots

@gergondet
Copy link
Member

gergondet commented Jan 12, 2024

Hi @antodld

If I understand correctly, what you are trying to do is:

  1. If the value of MainRobot is a loadable module then you treat it as before
  2. Otherwise you look into every loaded controller configurations to find if it's configured under the robots entry and you use the module entry in there to load the robot

So for example:

MainRobot: MyJVRC
robots:
  MyJVRC:
    module: JVRC1

would load JVRC1 as the main robot but rename it MyJVRC instead of the default of jvrc1

This poses at least one problem, say you have a controller that supports multiple robots and you wish to rename a few, so you would have something like:

MainRobot: MyJVRC # sometimes you switch to MyHRP4CR
robots:
  MyJVRC:
    module: JVRC1
  MyHRP4CR:
    module: HRP4CR

with this configuration and your patch, both modules are always loaded

I would suggest to write a patch that allows this syntax:

MainRobot:
  name: MyName
  module: MyModule

To solve this I suggest to add a std::optional<std::string> main_robot_module_name entry into the global configuration and treat config("MainRobot")("module") as config("MainRobot")

@antodld
Copy link
Contributor Author

antodld commented Jan 12, 2024

Hello @gergondet

The behavior described in your multi-robot example is the desired one.

With this PR, whatever the main robot you chose in your mc_rtc.yaml configuration file (whether MyJVRC1 or MyHRP4CR), the controller will always have 2 robots loaded with the same name, in opposition to the current state where the robot loaded in MainRobot is always named after its robot module.

@gergondet
Copy link
Member

the controller will always have 2 robots loaded with the same name

Just to clarify, that's two robots at the same time at all times right?

With the syntax I proposed you can get the same effect:

MainRobot:
  name: MyJVRC
  module: JVRC1
robots:
  MyJVRC:
    module: JVRC1
  MyHRP4CR
    module: HRP4CR

Would get you the same robots as:

MainRobot:
  name: MyHRP4CR
  module: HRP4CR
robots:
  MyJVRC:
    module: JVRC1
  MyHRP4CR
    module: HRP4CR

@gergondet gergondet force-pushed the topic/RobotFromControllerYAML branch from fe724f3 to 4cd496f Compare January 15, 2024 10:26
@gergondet gergondet merged commit f207cb6 into jrl-umi3218:master Jan 17, 2024
20 checks passed
gergondet added a commit that referenced this pull request Jan 17, 2024
Added
--

- [mc_control] Support for renaming the main robot via the configuration (#423)
- [mc_rbdyn] Add `addBodySensor` to `mc_rbdyn::Robot` (#419)
- [mc_rtc] Add support for any fixed size vector to Schema (#422)
- [mc_rtc] Add `std::map<std::string, T>` support in Schema (#412)
- [mc_solver] Add support for inactive joints in a collision (#416)

Fixes
--

- [StabilizerTask] Fix disabling when the robot is in the air (#411)
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.

2 participants