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

portprefix and build attributes of robot tag of robotinterface XML #2492

Open
traversaro opened this issue Feb 11, 2021 · 3 comments
Open

portprefix and build attributes of robot tag of robotinterface XML #2492

traversaro opened this issue Feb 11, 2021 · 3 comments

Comments

@traversaro
Copy link
Member

While working on, I noticed a few warnings:

2: [WARNING] Invalid syntax while loading  at line 3 . "robot" element should contain the "build" attribute [unsigned int]. Assuming 0
2: [WARNING] Invalid syntax while loading  at line 3 . "robot" element should contain the "portprefix" attribute. Using "name" attribute

While I could easily silence them by attribute the required attributes, to be honest I am not sure what this attributes are/meant, who they are used and why they should be set.

I tried to inspect the code, but here it is what I found:

  • The build attribute seems to never been used (unless I am wrong). In this case, could we remove the warning if it is not set?
  • The portprefix is used in
    setName(mPriv->robot.portprefix().c_str());
    to overwrite the name attribute and it is used to specify the name of the YARP RPC port used to control the yarprobotinterface. However, at this point if this is the role of the portprefix argument, I don't know what is the role of the name attribute. If portprefix is not set, then name seems a perfectly fine fallback, so could it make sense to remove the warning also if the portprefix argument is missing?
@traversaro
Copy link
Member Author

cc @drdanz @randaz81

@traversaro
Copy link
Member Author

I don't know what is the role of the name attribute

Actually the get_name is exposed on the YARP rpc via

, so it may be useful to specify a portprefix different from the name.

@drdanz
Copy link
Member

drdanz commented Feb 17, 2021

  • build: Long time ago, there was a plan to generate these files from some database. The build number was supposed to be increased by one in all files every time the files were re-generated, to avoid mixing files generated by 2 different generations.
    Feel free to remove the warning if not set, but perhaps we should leave the check to ensure that, if set, the number is the same in every file.

  • portprefix: I think that long time ago, we considered setting the names of the port using YARP_PORT_PREFIX, or something like that, considering that, instead of opening all devices with --name /icub/right_arm, we could have just passed --name /right_arm and the name would have been added automatically for all ports, reducing the number of errors, and increasing reusability of the files. Again, this was never implemented, so feel free to do whatever you want with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants