-
Notifications
You must be signed in to change notification settings - Fork 48
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 <yarpConfigurationString> parameter #396
Add <yarpConfigurationString> parameter #396
Conversation
Thanks @lrapetti . I know that the current status of the documentation in I think it could make sense to expand the "Using the plugins in Gazebo Models" section in https://github.com/robotology/gazebo-yarp-plugins/blob/master/doc/embed_plugins.md#using-the-plugins-in-gazebo-models to contain a reference to the new
|
documentation updated 50aeb93 |
Agh, this is ugly. To make sure that the variables contained in the |
We can also merge the PR as it is to test it and then try to solve the |
For handling the multi-robot case, we can also change the strategy we agreed on in #93 . |
Yes, I probably this solution should be re-discussed. |
I agree, that is solution is bad nevertheless because you need to manually modify the model to achieve multi-robot integration. |
Yes, give me 5 minutes. |
The problem related to multiple robots will be solved in a future PR, as this PR add the required functionality without any regression. |
As discussed in #142 I am adding a
yarpConfigurationString
option that allows to simply define a configuration for a plugin without editing/writing an.ini
.The implementation is based on the Property::fromString(), so it is using the same format of
Bottle
.e.g. in order to define the
name
property of alinkattacher
plugin without passing trough a.ini
:Observations
yarpConfigurationFile
andyarpConfigurationString
, the parameters will be loaded from both the file and the string. If a parameter is present in both, it will be always used the one fromyarpConfigurationString
.loadConfigSensorPlugin()
andloadConfigModelPlugin()
are almost identical a part from the fact that the sensor name is read usingName()
instead ofGetName()
whenGAZEBO_MAJOR_VERSION >= 7
. Probably, in the future it would make sense to merge the two function or to wrap the common part in a single function.fromString()
instead offromCommand()
because it would require a conversion ofstd::string
toargc
andargv
, but I have not found any compact implementation. If we decide to implement this type conversion, I think it would be better to do it inyarp::os::Property
by defining there a method likefromCommand(std::String & command, bool skipFirst, bool wipe)
.yarpConfigurationString
with different devices and options and it was working correctly. However, I have observed in theControlBoard
that when I change thegazeboYarpPluginsRobotName
usingyarpConfigurationString
, the property inm_parameters
changes accordingly. But if a differentgazeboYarpPluginsRobotName
was defined somewhere else (e.g. in the.ini
), this old name is used:e.g. if I am using this
sdf
I can print here
m_parameters.findGroup("gazeboYarpPluginsRobotName").toString()
->new_iCub
, but the port prefix that is used in the controlboard isicubSim
like if the port is opened before loading the new property (if thegazeboYarpPluginsRobotName
is not defined anywhere else, it is correctly usingnew_iCub
as prefix).