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

Pyros node is not responding #143

Open
hanggaga opened this issue Mar 7, 2019 · 1 comment
Open

Pyros node is not responding #143

hanggaga opened this issue Mar 7, 2019 · 1 comment

Comments

@hanggaga
Copy link

hanggaga commented Mar 7, 2019

I have example code for explain my issue here
First run $ bokeh serve sliders.py at my command prompt. Then navigate to the URL http://localhost:5006/sliders in my browser.
I would to do with simple pub from ros to pyros to bokeh plot with command
$ rostopic pub /topic_line_color std_msgs/String "data: 'red'" -1 to change the line color to red and
$ rostopic pub /topic_line_color std_msgs/String "data: 'green'" -1 to change to the back green one
It's work but after I would to refresh my browser for once so I pub with the same command but nothings change.
Question?
I think about the node has been created with the same name, then what I should do to solve this.
help me! I hope my question is clear for you, please give me some advice. Thank you.

@asmodehn
Copy link
Member

asmodehn commented Mar 7, 2019

Hello,

Thanks for trying pyros and posting about this issue.
Your code also is useful, and I had a quick shot at setting it up, but got quickly stuck because I don't have a ROS setup locally anymore (since I don't work with it daily nowadays). So it is one more reason to invest time in pyros-dev/pyros-rosinterface#14 :-)

Anyway I had a couple of hints that might be useful for your usecase :

  • pub/sub communication is not the same as REST/HTTP Request/Response. so two options : Either have a ROS service based interface (cleaner, interface well with most other communicating systems, like the web), or have a specific trick to bridge both communication paradigm. Pyros does the latter, which means that the last message on the topic is kept in a buffer, and sent whenever a client requests it.
  • From memory, there have been known ROS1 issues (not sure nowadays) with node names and topic registration/de-registration, node restarting, listeners still using old socket, and so on... You might want to check step by step that 1) ROS topics and nodes are working (check master API to list topics and so on) and can send messages between each other the way you expect, and 2) what happens when you refresh the page / restart the node/ etc. ROS1 was rarely used with, and does not support well, a "reset anytime" architecture, which is everywhere in the web nowadays.
  • you want to plug a debugger on the running server to be able to step through and understand what is happening when a request arrives. There is likely a small communication issue that makes it behave in an unexpected way... the refresh will resend requests to grab the message and maybe something will go wrong there.

Good luck in tracking this down, it doesn't look trivial from your description.
Let me know when you find some clue !

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

2 participants