Skip to content

rosrust::tcpros::subscriber Failed to connect to topic each time a message arrive on it #150

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

Closed
pmirabel opened this issue Oct 28, 2020 · 1 comment

Comments

@pmirabel
Copy link

pmirabel commented Oct 28, 2020

Hi,

I may be missing something, but I noticed a strange behavior with a "simple rosrust subscriber". Here is some piece of code to expose my issue :

rosrust::subscribe("/dock", 2, |v: rosrust_msg::std_msgs::String| {
            rosrust::ros_info!("Received: {:?}", v);
}).unwrap();
 let rate = rosrust::rate(2.0);
    while rosrust::is_ok() {
        rate.sleep();
    }

I use the #113 tips to build the node with catkin and launch the node with roslaunch
.
After that when I : rostopic pub /dock std_msgs/String "data: 'hello, world.'",
I then got a log :

[2020-10-28T10:08:57Z ERROR rosrust::tcpros::subscriber] Failed to connect to topic '/dock'
    Caused by:Connection refused (os error 111)
[INFO @ src/(...)/main.rs:27]: Received: String { data: "hello, world." }

So message is properly received but I don't know why this error pop ...
Any advice ? Thank you very much!

@pmirabel
Copy link
Author

Closing as #46 (comment) fix it.

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

1 participant