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

No error when tcpros is not compiled, but yarp node is being used to publish to ROS topic #9

Open
Tobias-Fischer opened this issue Apr 26, 2018 · 12 comments

Comments

@Tobias-Fischer
Copy link
Member

Hi,
We were playing around today to set up the joint state publisher using the ControlBoardWrapper as described in http://www.yarp.it/classyarp_1_1dev_1_1ControlBoardWrapper.html

It took us a while to realize that we did not get an output on the ROS topic because we did not have the ENABLE_yarpcar_tcpros flag enabled. The ROS topic was created just fine, and rostopic info showed the proper type etc.; there was just no output.

It would be great if there was a warning / error message somewhere if that happens.

Best, Tobi

@randaz81
Copy link
Member

Hi, Tobias, thank you for reporting this issue. Please note that similar problems may happen also if you have not properly set the ip addresses of the machines in your /etc/hosts files or if yarp is bound to 127.0.1.1 instead of the ip address of your network interface. This is another issue frequently reported by users.

@Nicogene
Copy link
Member

Nicogene commented May 9, 2018

Related to robotology/yarp#722 and robotology/yarp#1679 .

@Tobias-Fischer
Copy link
Member Author

Tobias-Fischer commented May 9, 2018

Hi @Nicogene,
Thanks for the heads up! Unfortunately I don't think this is fixed by robotology/yarp#1679 as this PR only addresses the yarpserver but not the client machines. In my case, the machine running yarpserver --ros had everything installed correctly, but another machine (pc104 ....) which was supposed to send messages to the ROS topic was missing tcpros. Is there any way of catching this?

EDIT:
One idea - when initializing a yarp::os::Node, one could do a similar check as in the PR above and issue a warning of the carriers do not exist. I'm happy to create a PR if that sounds viable.

@Nicogene
Copy link
Member

Hi @Tobias-Fischer !
yes you are right 😕

One idea - when initializing a yarp::os::Node, one could do a similar check as in the PR above and issue a warning of the carriers do not exist. I'm happy to create a PR if that sounds viable.

Yes it could be a nice idea! My only concern is that the overhead introduced by the call of yarp::os::Carriers::listCarriers in the initialization of every yarp::os::Node 🤔
@randaz81 what do you think about it?

@traversaro
Copy link
Member

Related issue on the nature of yarp::os::Node : robotology/yarp#1501 .

@barbalberto
Copy link

@Tobias-Fischer: On the client should not be necessary. Each carrier is searched for as a plugin, and if the plugin is not found an error is already printed.
For example, this is what I get if I don't have the tcpros carrier:

yarp connect /w /r tcpros
Cannot load plugin from shared library (yarp_tcpros)
(yarp_tcpros: cannot open shared object file: No such file or directory)
yarp: Failed to find library support for carrier tcpros
yarp: Could not find carrier "tcpros"
Failure: no way to make connection /w->tcpros://r

or if I try to use a non existing carrier:

yarp connect /w /r vsdvsd
[ERROR]Cannot find "vsdvsd" plugin (not built in, and no .ini file found for it)
[ERROR]Check that YARP_DATA_DIRS leads to at least one directory with plugins/vsdvsd.ini or share/yarp/plugins/vsdvsd.ini in it
Cannot load plugin from shared library ()
(yarp_vsdvsd: cannot open shared object file: No such file or directory)
yarp: Failed to find library support for carrier vsdvsd
yarp: Could not find carrier "vsdvsd"
Failure: no way to make connection /w->vsdvsd://r

So that check is already implemented at the connection level.
Can you provide more details and an example about your failure case?

@Tobias-Fischer
Copy link
Member Author

Hi @barbalberto,
I wanted to publish the state information of the iCub to ROS via the ControlBoardWrapper. I am not familiar enough to know how the connections between yarp and ROS are established, but there is no yarp connect command needed. Hence I do not think one can observe the error you point out in this specific case, but please do let me know if I just overlooked it.

@drdanz
Copy link
Member

drdanz commented May 10, 2018

One idea - when initializing a yarp::os::Node, one could do a similar check as in the PR above and issue a warning of the carriers do not exist. I'm happy to create a PR if that sounds viable.

This could be a good idea, but Node and Publisher/Subscriber are supposed to work even if ROS is not enabled, therefore we should add some kind of check to see if the server is running with --ros or not. Perhaps, we could check if the port /ros exists...

@drdanz
Copy link
Member

drdanz commented May 10, 2018

My only concern is that the overhead introduced by the call of yarp::os::Carriers::listCarriers in the initialization of every yarp::os::Node 🤔

I don't think this is a big issue, since Node is initialized only once in each program...

@Nicogene
Copy link
Member

Nicogene commented May 10, 2018

therefore we should add some kind of check to see if the server is running with --ros or not. Perhaps, we could check if the port /ros exists...

👍
But we have to be sure that the /ros port is our guy, through not allowing to open an /ros port by other executables (port name validation, #15 robotology/yarp#1508) or through setting a property to port (like the nameserver port)

@drdanz
Copy link
Member

drdanz commented May 10, 2018

This is strongly related to the issues with the known issues of the /ros port (deleted on yarp clean, replaced if someone registers a new /ros port, etc).

I'd start adding a property to the /ros port, and this check on Node, and fix these issues later.

An alternative could be adding some specific command to the nameserver protocol... i.e. in node init isROSEnabled, reply true or false.

This check could also replace all the ROS configuration in the .ini files, forcing to a single point where you can choose whether to enable ROS or not...

@barbalberto
Copy link

@Tobias-Fischer The example was just to have a simple test.
The procedure underneath is the same, you should see those those error raised by the ControlBoardWrapper. If it not the case let us know

@randaz81 randaz81 transferred this issue from robotology/yarp Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants