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

[bug] can not connect with the roscore in vscode Dev Container mode with a different ROS_MASTER_URI #1138

Open
2 tasks done
onlytailei opened this issue Sep 24, 2023 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed ROS1

Comments

@onlytailei
Copy link

(Please add appropriate labels)

  • Linux: A ubuntu 18.04 melodic docker image.
  • ROS 1: melodic

<Version of the plugin> v0.9.5

<Copy the Version information from the Help | About menu>

what is the bug

<current behavior>
I run my code in a docker container with the plugin Dev Container

And I set the following environment variables both in .bashrc catkin_ws/devel/setup.bash and .vscode/launch.json
"ROS_MASTER_URI": "http://172.17.0.2:11311",
"ROS_IP": "172.17.0.2",

I start the roscore in vscode terminal and then start the ROS:launch debug.
However, it always says "Timed out(30 seconds) waiting for ROS Core to start. Start ROSCore manually to avoid this error."

And ros core status always said "offline"

Repro steps

<how to reproduce the bug. Please attach sample files or github repo if appropriate.>
1.
2.
3.

expected behavior

<what you would expect to happen>
run the debug in docker image

additional context

<any additional information would be helpful for a better understanding>

@onlytailei onlytailei added the bug Something isn't working label Sep 24, 2023
@onlytailei onlytailei changed the title [bug] [bug] can not connect with the roscore in vscode Dev Container mode with a different ROS_MASTER_URI Sep 25, 2023
@ooeygui ooeygui added the ROS1 label Jan 8, 2024
@ooeygui
Copy link
Member

ooeygui commented Jan 8, 2024

Can you try this with the pre-release version of the extension?

@samiframadhan
Copy link

Hi, i'm also encountering this issue. I have set the debug launch launch.json configuration. However, in my case i have already run the roscore on another container and make the network able to refer to the roscore by setup it in docker compose config

Even though it's not complaining about roscore, it says the debug launch is not supported on ROS 1
Screenshot from 2024-04-20 06-00-27

I have already using the pre-release version of vscode-ros

Is there anything i can help to make it happen? Thanks

@ooeygui
Copy link
Member

ooeygui commented Apr 19, 2024

@samiframadhan Thanks for reaching out. The Launch file debugging feature is designed to enable debugging ROS2 python style launch files, which isn't why it isn't supported on ROS1.

@ooeygui ooeygui added the help wanted Extra attention is needed label Apr 19, 2024
@samiframadhan
Copy link

Oh ok then. Thanks for the confirmation @ooeygui

@ooeygui
Copy link
Member

ooeygui commented Apr 20, 2024

@samiframadhan That said - this is a real bug. When debugging nodes launched by a launch file, the probe -

this.xmlRpcApi = new ros_core.XmlRpcApi(this.env.ROS_MASTER_URI);
- for roscore isn't finding the ROS_MASTER_URI correctly. I suspect a race condition loading the environment.

@samiframadhan
Copy link

Oh great, thanks for the pointer. Actually i haven't taken a look at how it works internally. I will try to understand it first and come back when i found something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed ROS1
Projects
None yet
Development

No branches or pull requests

3 participants