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

Add blockfactory-exists command line tool #61

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Conversation

traversaro
Copy link
Member

Add a simple command line tool to check if a given block exists in a given plugin.

Added Tools CMake component to contain command line tools.

For example, if WB-Toolbox is installed correctly and BLOCKFACTORY_PLUGIN_PATH is set correctly, this are the output of the command:

STraversaro@IITICUBLAP102 MINGW64 /c/src/robotology-superbuild/build/src/BlockFactory (master)
$ blockfactory-exists WBToolbox ForwardKinematics
SUCCESS: Block "ForwardKinematics" found and loaded from plugin "WBToolbox".

STraversaro@IITICUBLAP102 MINGW64 /c/src/robotology-superbuild/build/src/BlockFactory (master)
$ echo $?
0

STraversaro@IITICUBLAP102 MINGW64 /c/src/robotology-superbuild/build/src/BlockFactory (master)
$ blockfactory-exists WBToolbox BlockThatDoesNotExists
ERROR: Failed to get factory object (blockName=BlockThatDoesNotExists,pluginName=WBToolbox)
STraversaro@IITICUBLAP102 MINGW64 /c/src/robotology-superbuild/build/src/BlockFactory (master)
$ echo $?
1

Add a simple command line tool to check if a given block exists
in a given plugin.
Added Tools CMake component to contain command line tools.
@traversaro
Copy link
Member Author

cc @nunoguedelha

Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

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

Great idea @traversaro, this simple command line tool will be very useful for debugging plugins!

@traversaro
Copy link
Member Author

traversaro commented Jan 26, 2021

Great idea @traversaro, this simple command line tool will be very useful for debugging plugins!

Yes, I think it could also be used to define a new test_blockfactory_plugin CMake macro in https://github.com/robotology/blockfactory/blob/master/cmake/BlockFactoryPlugin.cmake that can be used by downstream projects (such as WBToobox) a to a CTest test for each block to ensure that they load fine and they are not tricky linking issue that will appear just at runtime. In any case, even just the command tool is useful to test robotology/wb-toolbox#197 .

@diegoferigo
Copy link
Member

I agree on the CMake macro, it would be a great addition.

@traversaro
Copy link
Member Author

@diegoferigo please let me know if there is anything I can do to merge this PR, thanks!

@traversaro
Copy link
Member Author

By the way, the tools proved useful in debugging in robotology/wb-toolbox#197 .

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

Successfully merging this pull request may close these issues.

2 participants