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

Failure to open a new remotecontrolboard client in simulink #1850

Open
yeshasvitirupachuri opened this issue Sep 5, 2018 · 9 comments
Open

Comments

@yeshasvitirupachuri
Copy link
Member

yeshasvitirupachuri commented Sep 5, 2018

Describe the bug
In simulink I have a main config block with all the control boards i.e., {'torso','left_arm','right_arm','left_leg','right_leg'}. Then I have a subsystem with a new config block containing only a subset of the control boards i.e., {'torso','left_arm','right_arm'}. I used different prefixes for both the config blocks. Now, when I try to run the controller it terminates with the following error:

yarpdev: ***ERROR*** driver <remote_controlboard> was found but could not open
yarpdev: ***ERROR*** driver <remotecontrolboardremapper> was found but could not open

when trying to open the new client for the subsystem

If the subsystem is commented out, the model runs without any errors

NOTE: This behavior is observed with icubGazeboSim and is not checked on the real robot.

To Reproduce
Create a simple simulink model with the name test.mdl and with a config block and any simple get measurements block as shown below. Set the Local Name under config block as WBT

screenshot from 2018-09-05 18-02-38

Now, create a subsystem within this model and use another config block with a subset of control boards under the control board names tab and set the Local Name as WBT_SUB. Place either a get measurements or set measurements block as shown below

screenshot from 2018-09-05 18-02-43

Now, when you run the controller, you will see the following error

yarp: Port /WBT_SUB/testRobotModel
PositionControlConfiguration/icubSim/torso/rpc:o active at tcp://10.255.35.136:10238/
yarp: Port /WBT_SUB/testRobotModel
PositionControlConfiguration/icubSim/torso/command:o active at tcp://10.255.35.136:10239/
yarp: Port /WBT_SUB/testRobotModel
PositionControlConfiguration/icubSim/torso/stateExt:i active at tcp://10.255.35.136:10240/
yarpdev: ***ERROR*** driver <remote_controlboard> was found but could not open
yarpdev: ***ERROR*** driver <remotecontrolboardremapper> was found but could not open
Failed to open the RemoteControlBoardRemapper with the options passed.
Failed to initialize the RemoteControlBoardRemapper.
Failed to get IEncoders interface.

Expected behavior
Ideally, a new controlboard client should open for the subsystem with the port prefix WBT_SUB and connect to the robot ports without error.

Screenshots
If applicable, add screenshots to help explain your problem.

Configuration (please complete the following information):

  • OS: Link
  • yarp version: 3.1.0+10-20180821.4+gitd661b836b
  • compiler: gcc

Additional context
Add any other context about the problem here.

@diegoferigo Please add any missing details. Thanks

@traversaro
Copy link
Member

@Yeshasvitvs have you tried to check out that adding a delay in the port opening is solving the problem? Otherwise blaming YARP may be a bit premature.

@diegoferigo
Copy link
Member

@traversaro Yes he added a delay and it did not solve it.

As far as I understood this is related to the sequential opening of two remotecontrolboards (through the remapper) in the case they share one or more control boards. Under these circumstances, the second one would fail to open complaining about the access to the ports of the wrapper.

@Yeshasvitvs Could you please try what follows?

  1. Provide the output you have in the Matlab prompt. I remember it was more verbose than the one you posted.
  2. Does this happen also if the two instances do not share any control board?

@yeshasvitirupachuri
Copy link
Member Author

yeshasvitirupachuri commented Sep 5, 2018

Error from matlab diagnostic viewer while running test.mdl

screenshot from 2018-09-06 00-55-38

@diegoferigo While using the simple model test.mdl I do not have any errors on the matlab prompt. The errors you were referring to happened while running on the pHRI standup model.

[ERROR]Problem connecting to /icubSim/torso/rpc:i, is the remote device available?
[ERROR]Problem connecting to /icubSim/torso/command:i, is the remote device available?
[ERROR]*** Extended port /icubSim/torso/stateExt:o was not found on the controlBoardWrapper I'm connecting to. Falling back to compatibility behaviour
[WARNING]Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***
[ERROR]RemoteControlBoardRemapper: error opening remote_controlboard with remote " /icubSim/torso ", opening the device failed. 
[ERROR]Problem connecting to /icubSim/torso/rpc:i, is the remote device available?
[ERROR]Problem connecting to /icubSim/torso/command:i, is the remote device available?
[ERROR]*** Extended port /icubSim/torso/stateExt:o was not found on the controlBoardWrapper I'm connecting to. Falling back to compatibility behaviour
[WARNING]Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***
[ERROR]RemoteControlBoardRemapper: error opening remote_controlboard with remote " /icubSim/torso ", opening the device failed. 
[ERROR]Problem connecting to /icubSim/torso/rpc:i, is the remote device available?
[ERROR]Problem connecting to /icubSim/torso/command:i, is the remote device available?
[ERROR]*** Extended port /icubSim/torso/stateExt:o was not found on the controlBoardWrapper I'm connecting to. Falling back to compatibility behaviour
[WARNING]Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***
[ERROR]RemoteControlBoardRemapper: error opening remote_controlboard with remote " /icubSim/torso ", opening the device failed. 
[ERROR]Problem connecting to /icubSim/torso/rpc:i, is the remote device available?
[ERROR]Problem connecting to /icubSim/torso/command:i, is the remote device available?
[ERROR]*** Extended port /icubSim/torso/stateExt:o was not found on the controlBoardWrapper I'm connecting to. Falling back to compatibility behaviour
[WARNING]Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***
[ERROR]RemoteControlBoardRemapper: error opening remote_controlboard with remote " /icubSim/torso ", opening the device failed. 

@yeshasvitirupachuri
Copy link
Member Author

@diegoferigo I tried to run the test.mdl with the main config block containing only the leg control boards and the config block of the subsystem same as before. It gives the same error as failed to open the controlboard client for the subsystem!

@Nicogene
Copy link
Member

Nicogene commented Sep 6, 2018

Ping @barbalberto and/or @randaz81.
BTW, why this warning:

[WARNING] Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***

you are using the newest yarp (3.1.0), are you using ControlBoardWrapper instead of ControlBoardWrapper2?
There is a reason for that?
I don't know the history behind the two wrappers, who's is better to use, but maybe the old one is outdated/deprecated.

@diegoferigo
Copy link
Member

@Nicogene The source should be this:

s1 = remote;
s1 += "/stateExt:o";
s2 = local;
s2 += "/stateExt:i";
// not checking return value for now since it is wip (different machines can have different compilation flags
ok = Network::connect(s1, extendedIntputStatePort.getName(), carrier);
if (ok)
{
// set the QoS preferences for the 'state' port
if (config.check("local_qos") || config.check("remote_qos"))
NetworkBase::setConnectionQos(s1, extendedIntputStatePort.getName(), remoteQos, localQos, false);
}
else
{
yError("*** Extended port %s was not found on the controlBoardWrapper I'm connecting to. Falling back to compatibility behaviour\n", s1.c_str());
yWarning("Updating to newer yarp and the usage of controlBoardWrapper2 is suggested***\n");
}

@traversaro
Copy link
Member

traversaro commented Sep 6, 2018

@Nicogene That error is misleading: there is a failure in connecting to the stateExt:o port, and so the remote_controlboard is assuming that the user is trying to connect to a legacy controlboarwrapper. If controlboardwrapper still exist, that warning about the deprecation connection to state:o should be printed only if connectionProblem is not set to true.

@Nicogene
Copy link
Member

Nicogene commented Sep 7, 2018

I see, the first step is then to fix that misleading warning 😬

@barbalberto
Copy link
Collaborator

barbalberto commented Sep 17, 2018

I don't know how the code is structured in matlab, my first guess is that the Network object is no longer availalble where the second set of controlboards are created. Can you add the following check right before creating them?

    if (!yarp.checkNetwork())
    {
        printf("No yarp network, quitting\n");
        return 1;
    }

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

5 participants