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

Would like a way to not run rosmaster #11

Open
frankjoshua opened this issue Feb 21, 2021 · 3 comments
Open

Would like a way to not run rosmaster #11

frankjoshua opened this issue Feb 21, 2021 · 3 comments

Comments

@frankjoshua
Copy link

It would be great to have some sort of flag or environmental variable to not start a ROS master. My use case is that I want to use Jupyter lab in an existing system with an already running master. It could be accomplished by adding --wait before roslaunch.

In https://github.com/RoboStack/jupyterlab-ros/blob/70b0582b834fa0ca9b03acc75226696de0758d23/jupyter_ros_server/api/master.py
cls.thread = Thread(target=cls.run, args=([path.join(getEnv(), 'roslaunch'), getMaster()],))
becomes
cls.thread = Thread(target=cls.run, args=([path.join(getEnv(), 'roslaunch --wait'), getMaster()],))

Is this an unusual use case? If so I could also just fork and change for my purpose.

@hbcarlos
Copy link
Member

hbcarlos commented Feb 25, 2021

Hi @frankjoshua, actually this behaviour was only to make the binder examples easier, we can change it.
We can also change the frontend to not start ROS master by default if you prefer.

Just modifying this line

onOpen = (msg) => { this.ws.send(JSON.stringify({ cmd: "start" })); }

for something like:
onOpen = (msg) => {}

Do you what to open a PR? I'll be happy to merge.

@frankjoshua
Copy link
Author

I don't think it should be permanently changed. Probably still want Binder to work. I think maybe an environmental variable to set the behavior? Where would be the best place for that?

@hbcarlos
Copy link
Member

A good place would be here

if msg['cmd'] == "start" and cls.proc == None :

to prevent ROS master to start. But the problem is that when starting ROS master, we also run tf2_web_republisher which is necessary for Zethus and also turns on web bridge and sets a variable to allow running roslaunch from the frontend.

Another problem is that you should have ROS master running before starting JupyterLab-ROS because we start Web bridge with the extension and needs ROS master running.

while cont < 10 and (not rosgraph.is_master_online()) :

Anyway, the status bar widget is a button to start and stop master. There is no problem at all with binder since we can turn it on later.

The main problem is that if you want to run your own master, you will need to run also tf2_web_republisher and every time you stop master you will probably need to restart jupyterlab, otherwise the extension would not work.

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