Closed antodld closed 10 months ago
Hi @antodld
If I understand correctly, what you are trying to do is:
MainRobot
is a loadable module then you treat it as beforerobots
entry and you use the module
entry in there to load the robotSo 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")
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.
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
This PR allows to rename the main robot declared in
mc_rtc.yaml
as the one named in a controller configuration inrobots