robotology / wb-toolbox

Simulink toolbox to rapidly prototype robot controllers
https://robotology.github.io/wb-toolbox/
GNU Lesser General Public License v2.1
23 stars 17 forks source link

Unable to connect to multiple remotecontrolboard clients on MacOS #186

Open lrapetti opened 4 years ago

lrapetti commented 4 years ago

Description

I am trying to run a Simulink project using WBToolbox to control two robots in a Gazebo simulation. The project was working a couple of months ago (in the middle for sure I updated YARP to more recent versions, and eventually other folders, not sure of all the changes) but now I am no longer able to have it running. Commenting out one or the other robot the project is working, but when I try to run it with both the robots, it is failing giving following errors:

...
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: Receiving input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i using udp
yarp: Removing input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i
yarpdev: ***ERROR*** driver <remote_controlboard> was found but could not open
yarp: Removing output from 
...

(full terminal and Simulink diagnostic output can be found below)

The problem is somehow similar to https://github.com/robotology/yarp/issues/1850.

Additional context

Simulink configuration Outer view of the Simulink project: Screenshot 2020-01-30 at 17 09 06 Each robot block contains the Config and the WBtoolbox boxes as in the following picture Screenshot 2020-01-30 at 17 09 38

For each robot I have a different configuration:

terminals outputs Matlab terminal:

yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/rpc:o active at tcp://10.240.2.21:10086/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/command:o active at tcp://10.240.2.21:10087/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/stateExt:i active at tcp://10.240.2.21:10088/
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/rpc:o to /iCub1/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/command:o to /iCub1/torso/command:i using udp
yarp: Receiving input from /iCub1/torso/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/rpc:o active at tcp://10.240.2.21:10089/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/command:o active at tcp://10.240.2.21:10090/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/stateExt:i active at tcp://10.240.2.21:10091/
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/rpc:o to /iCub1/left_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/command:o to /iCub1/left_arm/command:i using udp
yarp: Receiving input from /iCub1/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/rpc:o active at tcp://10.240.2.21:10092/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/command:o active at tcp://10.240.2.21:10093/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/stateExt:i active at tcp://10.240.2.21:10094/
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/rpc:o to /iCub1/right_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/command:o to /iCub1/right_arm/command:i using udp
yarp: Receiving input from /iCub1/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/rpc:o active at tcp://10.240.2.21:10095/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/command:o active at tcp://10.240.2.21:10096/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/stateExt:i active at tcp://10.240.2.21:10097/
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/rpc:o to /iCub1/left_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/command:o to /iCub1/left_leg/command:i using udp
yarp: Receiving input from /iCub1/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/rpc:o active at tcp://10.240.2.21:10098/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/command:o active at tcp://10.240.2.21:10099/
yarp: Port /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/stateExt:i active at tcp://10.240.2.21:10100/
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/rpc:o to /iCub1/right_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/command:o to /iCub1/right_leg/command:i using udp
yarp: Receiving input from /iCub1/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o active at tcp://10.240.2.21:10102/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o active at tcp://10.240.2.21:10103/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i active at tcp://10.240.2.21:10104/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i using udp
yarp: Receiving input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o active at tcp://10.240.2.21:10105/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o active at tcp://10.240.2.21:10106/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i active at tcp://10.240.2.21:10107/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i using udp
yarp: Receiving input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o active at tcp://10.240.2.21:10108/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o active at tcp://10.240.2.21:10109/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i active at tcp://10.240.2.21:10110/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i using udp
yarp: Receiving input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o active at tcp://10.240.2.21:10111/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o active at tcp://10.240.2.21:10112/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i active at tcp://10.240.2.21:10113/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i using udp
yarp: Receiving input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/rpc:o active at tcp://10.240.2.21:10114/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/command:o active at tcp://10.240.2.21:10115/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i active at tcp://10.240.2.21:10116/
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: Receiving input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i using udp
yarp: Removing input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i
yarpdev: ***ERROR*** driver <remote_controlboard> was found but could not open
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i
yarp: Removing input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i
yarp: Removing input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i
yarp: Removing input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i
yarp: Removing input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i
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.
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/rpc:o to /iCub1/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/command:o to /iCub1/torso/command:i
yarp: Removing input from /iCub1/torso/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/torso/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/rpc:o to /iCub1/left_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/command:o to /iCub1/left_arm/command:i
yarp: Removing input from /iCub1/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/rpc:o to /iCub1/right_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/command:o to /iCub1/right_arm/command:i
yarp: Removing input from /iCub1/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/rpc:o to /iCub1/left_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/command:o to /iCub1/left_leg/command:i
yarp: Removing input from /iCub1/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/left_leg/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/rpc:o to /iCub1/right_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/command:o to /iCub1/right_leg/command:i
yarp: Removing input from /iCub1/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot1Configuration/iCub1/right_leg/stateExt:i
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o active at tcp://10.240.2.21:10102/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o active at tcp://10.240.2.21:10103/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i active at tcp://10.240.2.21:10104/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i using udp
yarp: Receiving input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o active at tcp://10.240.2.21:10105/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o active at tcp://10.240.2.21:10106/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i active at tcp://10.240.2.21:10107/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i using udp
yarp: Receiving input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o active at tcp://10.240.2.21:10108/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o active at tcp://10.240.2.21:10109/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i active at tcp://10.240.2.21:10110/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i using udp
yarp: Receiving input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o active at tcp://10.240.2.21:10111/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o active at tcp://10.240.2.21:10112/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i active at tcp://10.240.2.21:10113/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i using udp
yarp: Receiving input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/rpc:o active at tcp://10.240.2.21:10114/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/command:o active at tcp://10.240.2.21:10115/
yarp: Port /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i active at tcp://10.240.2.21:10116/
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/rpc:o to /iCub2/right_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/command:o to /iCub2/right_leg/command:i using udp
yarp: Receiving input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i using udp
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i
yarp: Removing input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/torso/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i
yarp: Removing input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i
yarp: Removing input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i
yarp: Removing input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/left_leg/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/rpc:o to /iCub2/right_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/command:o to /iCub2/right_leg/command:i
yarp: Removing input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingRobot2Configuration/iCub2/right_leg/stateExt:i

Simulink diagnostic

...
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]created device <remotecontrolboardremapper>. See C++ class RemoteControlBoardRemapper for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[ERROR]Problem connecting to /iCub2/right_leg/rpc:i, is the remote device available?
[ERROR]Problem connecting to /iCub2/right_leg/command:i, is the remote device available?
[ERROR]RemoteControlBoardRemapper: error opening remote_controlboard with remote " /iCub2/right_leg ", opening the device failed. 
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]RemoteControlBoard is ENABLING the writeStrict option for all commands
[INFO]created device <remote_controlboard>. See C++ class RemoteControlBoard for documentation.
[INFO]created device <remotecontrolboardremapper>. See C++ class RemoteControlBoardRemapper for documentation.
An error occurred while running the simulation and the simulation was terminated
Caused by:
Error reported by S-function 'BlockFactory' in 'torqueControlBalancing/Robot 2/GetMeasurement1/S-Function': 
Component:Simulink | Category:Block diagram error
...

Additional information

lrapetti commented 4 years ago

I tried also with a different project that connects to multiple robots and I am getting the same error.

lrapetti commented 4 years ago

cc @Yeshasvitvs @diegoferigo

traversaro commented 4 years ago

I think the original intuition by @barbalberto in the comment in https://github.com/robotology/yarp/issues/1850#issuecomment-421978615 may be a good hint.

Nevertheless, to have something more actionable, I think you should proceed as in the following. As nothing changed recently in WB-Toolbox or BlockFactory, indeed a change of YARP can be a good candidate for creating this issue. First of all, find a YARP commit that is working fine, based on your original comment I would try to see if YARP v3.2.2 is working fine instead. If that tag is working fine while v3.3.1 is not working, then we are on a good track. Between v3.2.2 and v3.3.1 there are ~280 commits (see https://github.com/robotology/yarp/compare/v3.2.2...v3.3.1), so by using git bisect it should just take ≈ log2(280) ≈ 9 tests to actually find the commit that introduced the problem.

traversaro commented 4 years ago

For simplify the debugging, it would also be useful to have a Wireshark dump of the loopback traffic when you get this error.

lrapetti commented 4 years ago

From a preliminary test I found out that is not working with YARP 3.2.2 but it is working with YARP 3.2.0. I will try to investigate further about the exact commit.

traversaro commented 4 years ago

From a preliminary test I found out that is not working with YARP 3.2.2 but it is working with YARP 3.2.0. I will try to investigate further about the exact commit.

If you are taking bets, I would put my money on https://github.com/robotology/yarp/commit/1c1d01b12b284e634ac8eb672202aa198bfae7ad or https://github.com/robotology/yarp/commit/6476dcf14acd3a87d72663be1dd31e162dbf472d .

lrapetti commented 4 years ago

From a preliminary test I found out that is not working with YARP 3.2.2 but it is working with YARP 3.2.0. I will try to investigate further about the exact commit.

Unfortunately, after moving around with the commits I was no longer able to have it working (not even with 3.2.0, but I am sure at a certain point it was working), which makes me a bit confused about the origin of the problem (or about my focus during those tests).

lrapetti commented 4 years ago

Unfortunately, after moving around with the commits I was no longer able to have it working (not even with 3.2.0, but I am sure at a certain point it was working)

I discovered that if I compile master and then I switch to 3.2.0, then it is working (on 3.2.0). While moving trough intermediate commits and then to 3.2.0 apparently screwed the things.

traversaro commented 4 years ago

Unfortunately, after moving around with the commits I was no longer able to have it working (not even with 3.2.0, but I am sure at a certain point it was working)

I discovered that if I compile master and then I switch to 3.2.0, then it is working (on 3.2.0). While moving trough intermediate commits and then to 3.2.0 apparently screwed the things.

Mhh, it could be something strange in the build system. It is probably a good idea to test each commit from a clean build.

traversaro commented 4 years ago

Two things that I forgot:

lrapetti commented 4 years ago

Mhh, it could be something strange in the build system. It is probably a good idea to test each commit from a clean build.

I did test with clean build of different commits and releases (recompiling YARP, gazebo-yarp-plugins and wb-toolbox) but I was not able to find a properly working commit (I moved from 3.2.0 on).

  • It is also possible that the failure is not deterministic itself, so it is possible that it something that may go wrong also in 3.2.0, but in master has an higher probability of failure (for example if it is some kind of race condition or similar).

Unfortunately this seems to me to be the most likely condition, I will report soon the output of some test remaining showing this condition.

lrapetti commented 4 years ago
  • It is also possible that the failure is not deterministic itself, so it is possible that it something that may go wrong also in 3.2.0, but in master has an higher probability of failure (for example if it is some kind of race condition or similar).

Unfortunately this seems to me to be the most likely condition, I will report soon the output of some test remaining showing this condition.

The following results have been obtained, trough different runs in chronoligical order, with YARP3.2.0 (where the coloumns indicate which software have been restarted after the previous try):

result Yarp server Gz Simulink Matlab
Fail x x x x
Fail x
Success x x x x
Success x x
Success x x
Fail x x x x
Fail x
Fail x
Fail x
Fail x x
Fail x x
Fail x x x
Fail x x x
Fail x x x x
Fail x x x x
Fail x x x x
Success x x x x
Success x x x
Fail (Gz crash) x x x
Success x x x x
lrapetti commented 4 years ago

Similar with the previous comment, those are some test with YARP3.3.101 (current master)

result Yarp server Gz Simulink Matlab
Fail x x x x
Fail x x x x
Fail
Fail x
Fail x x
Success x x x x
Success x
Success x x
Success x
Success x x
Success x x x
Success x x x x

So it doesn't seem to be much related to the YARP version

traversaro commented 4 years ago

At this point, I think the problem is some yarpserver race condition that has been part of yarpserver for a long time, and for some reason (that could also be related to something on your PC) you are noticing it only now.

lrapetti commented 4 years ago

I agree it is some kind of race condition, but would you exclude is something related to wb-toolbox?

I tried to debug a bit understanding where is is failing in initializeRemoteControlBoardRemapper, and I have noticed something strange:

you can see this events in the following output (search for START initializeRemoteControlBoardRemapper and FINISH initializeRemoteControlBoardRemapper)

iCub1 : START initializeRemoteControlBoardRemapper 
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/rpc:o active at tcp://10.255.111.23:10087/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/command:o active at tcp://10.255.111.23:10088/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/stateExt:i active at tcp://10.255.111.23:10089/
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/rpc:o to /iCub1/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/command:o to /iCub1/torso/command:i using udp
yarp: Receiving input from /iCub1/torso/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/rpc:o active at tcp://10.255.111.23:10090/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/command:o active at tcp://10.255.111.23:10091/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/stateExt:i active at tcp://10.255.111.23:10092/
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/rpc:o to /iCub1/left_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/command:o to /iCub1/left_arm/command:i using udp
yarp: Receiving input from /iCub1/left_arm/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/rpc:o active at tcp://10.255.111.23:10093/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/command:o active at tcp://10.255.111.23:10094/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/stateExt:i active at tcp://10.255.111.23:10095/
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/rpc:o to /iCub1/right_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/command:o to /iCub1/right_arm/command:i using udp
yarp: Receiving input from /iCub1/right_arm/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/rpc:o active at tcp://10.255.111.23:10096/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/command:o active at tcp://10.255.111.23:10097/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/stateExt:i active at tcp://10.255.111.23:10098/
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/rpc:o to /iCub1/left_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/command:o to /iCub1/left_leg/command:i using udp
yarp: Receiving input from /iCub1/left_leg/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/rpc:o active at tcp://10.255.111.23:10099/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/command:o active at tcp://10.255.111.23:10100/
yarp: Port /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/stateExt:i active at tcp://10.255.111.23:10101/
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/rpc:o to /iCub1/right_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/command:o to /iCub1/right_leg/command:i using udp
yarp: Receiving input from /iCub1/right_leg/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/stateExt:i using udp
iCub1 : FINISH initializeRemoteControlBoardRemapper 
iCub2 : START initializeRemoteControlBoardRemapper 
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o active at tcp://10.255.111.23:10102/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o active at tcp://10.255.111.23:10103/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i active at tcp://10.255.111.23:10104/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i using udp
yarp: Receiving input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/rpc:o active at tcp://10.255.111.23:10105/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/command:o active at tcp://10.255.111.23:10106/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i active at tcp://10.255.111.23:10107/
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: No connection to nameserver
yarp: *** try running: yarp detect ***
yarp: Receiving input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i using udp
yarp: Removing input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i
yarpdev: ***ERROR*** driver <remote_controlboard> was found but could not open
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i
yarp: Removing input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i
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.
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/rpc:o to /iCub1/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/command:o to /iCub1/torso/command:i
yarp: Removing input from /iCub1/torso/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/torso/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/rpc:o to /iCub1/left_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/command:o to /iCub1/left_arm/command:i
yarp: Removing input from /iCub1/left_arm/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/rpc:o to /iCub1/right_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/command:o to /iCub1/right_arm/command:i
yarp: Removing input from /iCub1/right_arm/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/rpc:o to /iCub1/left_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/command:o to /iCub1/left_leg/command:i
yarp: Removing input from /iCub1/left_leg/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/left_leg/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/rpc:o to /iCub1/right_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/command:o to /iCub1/right_leg/command:i
yarp: Removing input from /iCub1/right_leg/stateExt:o to /WBT/torqueControlBalancingModel1Robot1Configuration/iCub1/right_leg/stateExt:i
iCub2 : START initializeRemoteControlBoardRemapper 
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o active at tcp://10.255.111.23:10102/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o active at tcp://10.255.111.23:10103/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i active at tcp://10.255.111.23:10104/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i using udp
yarp: Receiving input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/rpc:o active at tcp://10.255.111.23:10105/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/command:o active at tcp://10.255.111.23:10106/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i active at tcp://10.255.111.23:10107/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i using udp
yarp: Receiving input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/rpc:o active at tcp://10.255.111.23:10108/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/command:o active at tcp://10.255.111.23:10109/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/stateExt:i active at tcp://10.255.111.23:10110/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i using udp
yarp: Receiving input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/rpc:o active at tcp://10.255.111.23:10111/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/command:o active at tcp://10.255.111.23:10112/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/stateExt:i active at tcp://10.255.111.23:10113/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i using udp
yarp: Receiving input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/stateExt:i using udp
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/rpc:o active at tcp://10.255.111.23:10114/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/command:o active at tcp://10.255.111.23:10115/
yarp: Port /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/stateExt:i active at tcp://10.255.111.23:10116/
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/rpc:o to /iCub2/right_leg/rpc:i using tcp
yarp: Sending output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/command:o to /iCub2/right_leg/command:i using udp
yarp: Receiving input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/stateExt:i using udp
iCub2 : FINISH initializeRemoteControlBoardRemapper 
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/rpc:o to /iCub2/torso/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/command:o to /iCub2/torso/command:i
yarp: Removing input from /iCub2/torso/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/torso/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/rpc:o to /iCub2/left_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/command:o to /iCub2/left_arm/command:i
yarp: Removing input from /iCub2/left_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/rpc:o to /iCub2/right_arm/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/command:o to /iCub2/right_arm/command:i
yarp: Removing input from /iCub2/right_arm/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_arm/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/rpc:o to /iCub2/left_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/command:o to /iCub2/left_leg/command:i
yarp: Removing input from /iCub2/left_leg/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/left_leg/stateExt:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/rpc:o to /iCub2/right_leg/rpc:i
yarp: Removing output from /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/command:o to /iCub2/right_leg/command:i
yarp: Removing input from /iCub2/right_leg/stateExt:o to /WBT/torqueControlBalancingModel2Robot2Configuration/iCub2/right_leg/stateExt:i

aren't this sequence of events and the fact that the second model is initialized twice, strange? @traversaro @diegoferigo

lrapetti commented 4 years ago

Today I have tested the same code with the following configuration: OS: Ubuntu 18.04 YARP: 3.2.101 Matlab: R2018a

and I didn't experience the failure. Further investigation should be done in order to understand if the problem is related to Matlab version or OS.

lrapetti commented 4 years ago

Adding some note on debugging the error, the error appears in the open() call for the polyDriver. The passed arguments seems to be fine:

diegoferigo commented 4 years ago

The configuration seems correct, I confirm. As discussed in the previous days f2f, did you have the chance to extend the test done in https://github.com/robotology/wb-toolbox/issues/186#issuecomment-582464615 and try an Ubuntu machine with the new 2019b Matlab version?

In this way we know that the problem is not related to the Matlab version you have on your computer nor Ubuntu. The only difference therefore is MacOS, and we can limit the debugging to the portions of code (or loaded libraries) of the OS.


Another try, as discussed, could be trying to switch on / off ACE in YARP (I think it's on by default). On Ubuntu I know it can be done and everything should work even without ACE, I'm not sure if it can be done also on MacOS.

lrapetti commented 4 years ago

The configuration seems correct, I confirm. As discussed in the previous days f2f, did you have the chance to extend the test done in #186 (comment) and try an Ubuntu machine with the new 2019b Matlab version?

I will procede with this tests

Another try, as discussed, could be trying to switch on / off ACE in YARP (I think it's on by default). On Ubuntu I know it can be done and everything should work even without ACE, I'm not sure if it can be done also on MacOS.

I don't see any YARP_USE_ACE option in cmake

In addition, I did some check with the debugger, and I have found out that the second initialisation of iCub2 (the succesfully one) that I was seeing in https://github.com/robotology/wb-toolbox/issues/186#issuecomment-582364289 was triggered by the call of getRobotInterface in the block termination https://github.com/robotology/wb-toolbox/blob/f110c4b641a09a4bb392161db2ab79d0afc0adbe/toolbox/library/src/SetReferences.cpp#L276-L282 this explain hence the presence of two initializations for iCub2

traversaro commented 4 years ago

Another try, as discussed, could be trying to switch on / off ACE in YARP (I think it's on by default). On Ubuntu I know it can be done and everything should work even without ACE, I'm not sure if it can be done also on MacOS.

I don't see any YARP_USE_ACE option in cmake

The option is SKIP_ACE .

diegoferigo commented 4 years ago

In addition, I did some check with the debugger, and I have found out that the second initialisation of iCub2 (the succesfully one) that I was seeing in #186 (comment) was triggered by the call of getRobotInterface in the block termination

Good catch! Thanks GDB :)

lrapetti commented 4 years ago

@diegoferigo

Good catch! Thanks GDB LLDB :)

lrapetti commented 4 years ago

Another try, as discussed, could be trying to switch on / off ACE in YARP (I think it's on by default). On Ubuntu I know it can be done and everything should work even without ACE, I'm not sure if it can be done also on MacOS.

I don't see any YARP_USE_ACE option in cmake

The option is SKIP_ACE .

The compilation is failing when SKIP_ACE is on.

[  2%] Building CXX object src/libYARP_os/src/CMakeFiles/YARP_os.dir/yarp/os/Carrier.cpp.o
In file included from /Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/Carrier.cpp:11:
In file included from /Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/impl/TcpFace.h:17:
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/impl/TcpAcceptor.h:22:1: error: 
      Cannot implement TcpAcceptor on this platform
YARP_COMPILER_ERROR(Cannot implement TcpAcceptor on this platform)
^
/Users/lorenzorapetti/Software/robotology-superbuild/build/robotology/YARP/src/libYARP_conf/src/yarp/conf/system.h:109:35: note: 
      expanded from macro 'YARP_COMPILER_ERROR'
  #define YARP_COMPILER_ERROR(x)  __YARP_DO_PRAGMA(GCC error #x)
                                  ^
/Users/lorenzorapetti/Software/robotology-superbuild/build/robotology/YARP/src/libYARP_conf/src/yarp/conf/system.h:106:31: note: 
      expanded from macro '__YARP_DO_PRAGMA'
  #define __YARP_DO_PRAGMA(x) _Pragma (#x)
                              ^
<scratch space>:210:6: note: expanded from here
 GCC error "Cannot implement TcpAcceptor on this platform"
     ^
In file included from /Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/Carrier.cpp:11:
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/impl/TcpFace.h:51:21: error: 
      no type named 'TcpAcceptor' in namespace 'yarp::os::impl'
    yarp::os::impl::TcpAcceptor peerAcceptor;
    ~~~~~~~~~~~~~~~~^
/Users/lorenzorapetti/Software/robotology-superbuild/robotology/YARP/src/libYARP_os/src/yarp/os/Carrier.cpp:130:12: error: 
      cannot initialize return object of type 'yarp::os::Face *' with an rvalue
      of type 'yarp::os::impl::TcpFace *'
    return new yarp::os::impl::TcpFace();
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make[2]: *** [src/libYARP_os/src/CMakeFiles/YARP_os.dir/yarp/os/Carrier.cpp.o] Error 1
make[1]: *** [src/libYARP_os/src/CMakeFiles/YARP_os.dir/all] Error 2
make: *** [all] Error 2
diegoferigo commented 4 years ago

Ok, in MacOS you must have ACE. It was worth trying.

lrapetti commented 3 years ago

Further investigation should be done in order to understand if the problem is related to Matlab version or OS.

Jumping back in this old issue, I have now worked for some time on Simulink models with multiple remotecontrolboard with different OS and Matlab version. I keep experiencing the same problem on MacOS, while it never happened on Ubunt. Indeed, I think we can say the problem is OS-related, and I have update the title accordingly.

lrapetti commented 3 years ago

Actually, I think the same problem is happening also in presence of a single robot but with "heavy" models.

Today I was running a model which attaches to the control-board of a single icub running in simulation, runs a state-machine and a QP-based controller, and opens other yarp port using WB-toolbox block, and I was getting the following error in the Simulink diagnostic, which seems same as what observed above.

...
INFO] |yarp.device.remote_controlboard| RemoteControlBoard is ENABLING the writeStrict option for all commands
    [INFO] |yarp.os.Port| Port /WBT/MomentumBasedControllerModel1Configuration/icubSim/right_leg/rpc:o active at tcp://10.255.111.45:10070/
    [INFO] |yarp.os.impl.NameClient| No connection to nameserver
    [INFO] |yarp.os.impl.NameClient| *** try running: yarp detect ***
    [INFO] |yarp.os.Port| Port /WBT/MomentumBasedControllerModel1Configuration/icubSim/right_leg/command:o active at tcp://10.255.111.45:10071/
    [INFO] |yarp.os.impl.NameClient| No connection to nameserver
    [INFO] |yarp.os.impl.NameClient| *** try running: yarp detect ***
    [INFO] |yarp.os.Port| Port /WBT/MomentumBasedControllerModel1Configuration/icubSim/right_leg/stateExt:i active at tcp://10.255.111.45:10072/
    [INFO] |yarp.os.impl.NameClient| No connection to nameserver
    [INFO] |yarp.os.impl.NameClient| *** try running: yarp detect ***
    [ERROR] |yarp.device.remote_controlboard| Problem connecting to /icubSim/right_leg/rpc:i, is the remote device available?
    [INFO] |yarp.os.impl.NameClient| No connection to nameserver
    [INFO] |yarp.os.impl.NameClient| *** try running: yarp detect ***
    [ERROR] |yarp.device.remote_controlboard| Problem connecting to /icubSim/right_leg/command:i, is the remote device available?
    [INFO] |yarp.os.impl.NameClient| No connection to nameserver
    [INFO] |yarp.os.impl.NameClient| *** try running: yarp detect ***
    [ERROR] |yarp.device.remote_controlboard| Problem connecting to /icubSim/right_leg/stateExt:o, is the remote device available?
    [ERROR] |yarp.dev.PolyDriver| Driver <remote_controlboard> was found but could not open
    [ERROR] |yarp.device.remotecontrolboardremapper| Opening remote_controlboard with remote " /icubSim/right_leg ", opening the device failed.
    [ERROR] |yarp.dev.PolyDriver| Driver <remotecontrolboardremapper> was found but could not open
...

Here are the full logs:

@nunoguedelha I don't know if you followed the discussion back in time. As a MacOS user, have you ever experienced this problem?

nunoguedelha commented 3 years ago

Hi @lrapetti , just saw your comment now, sorry. I had indeed an issue last year, somewhat similar, not sure it's the same though. I'll send you the link. We can discuss on Monday.

lrapetti commented 3 years ago

Hi @lrapetti , just saw your comment now, sorry. I had indeed an issue last year, somewhat similar, not sure it's the same though. I'll send you the link. We can discuss on Monday.

Thanks @nunoguedelha, let me know if you want to have a chat regarding this issue