question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

roslaunch is not executed on startup because network adapter doesn't delay start

See original GitHub issue

Hi,

I created a launch file that runs my ROS nodes automatically, including the Master.

Firstly I added the service with robot_upstart, including my master-ip and the wlan0 interface Then I used daemon-reload and started the service. That was always working fine. However, on reboot it would never work.

service name-of-service status helped me finding the issue: The error displayed was root: bebop: No IP address on wlan0, cannot roslaunch.

After more debugging, there were two things I needed to do before it worked correctly: Firstly, I needed to alter the automatically created service file in /lib/systemd/system/name-of-service.service. I added following lines: After=network.target Wants=network.target After=network-online.target Wants=network-online.target

After adding these lines and reloading the daemon, the error persisted. As I found out, there was no service activated that delays my service. So I enabled both of these services with sudo systemctl enable NetworkManager-wait-online.service sudo systemctl enable systemd-networkd-wait-online.service

After reloading the deamon again, finally my service is delayed until I have a wifi connection and the lauch file is executed correctly.

Make sure every time you edit and reinstall the service, to edit the automatically created service file.

There’s not much that can be done about the disabled network waiting service, but please automatically add the four lines to the service file.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kaorushacommented, Jan 7, 2022

Hi, adding those four lines worked at first but not after adding another user service. So eventually I changed the service file as below:

[Unit]
Description="myservice"
After=network.target
Wants=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/sbin/myservice-start
Restart=on-failure # add this

[Install]
WantedBy=multi-user.target

It will restart until wlan0 get data.

0reactions
Squizzy911commented, Aug 17, 2022

I don’t know that there’s strictly a right or wrong way for this to go. Historically (for Clearpath), we never wanted to block starting ROS on having wifi connectivity because a) we wanted users to be able to teleop their robots right out of the crate on initial delivery, without having to have the wifi set up first, and b) we wanted the robots to be able to react to wifi-loss as just another environmental event to potentially respond to (eg, by flashing a light, returning to a known waypoint, whatever).

But part of that is obviously our field robotics focus, and there is a complexity cost paid for it, particularly once you get into the realm of clock syncs occurring after network connectivity is achieved (and therefore after ROS has already started).

That said, I can certainly imagine other types of scenarios such as controlled lab environments would rather just bypass all this and assume that every device is online all the time, and that being online is a prerequisite for any other kind of operation.

for me it looks like the launch file is executed before the ubuntu network stack is available at all. not specific for wifi. but could be a specific problem for me, because i source a bash file which checks the current IP, which is not available at launch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set delay between starting nodes within launch file
You can perform a workaround by putting the delayed node into an extra launch file and run it via timed_roslaunch . Explanation goes...
Read more >
Issues · clearpathrobotics/robot_upstart - GitHub
only start my node when I make it respawn, but its service still doesn't work ... roslaunch is not executed on startup because...
Read more >
RE: Forticlient Network Startup delay in Windows
Symptoms: After Windows start and logon, it takes up to 5 Minutes until Network Interfaces (LAN and/or WLAN) get online and their IPs....
Read more >
F1/10 Reference Manual - F1TENTH
near the fan connector on the heat sink (the order of the wires doesn't matter). ... LiPO batteries allow your car to run...
Read more >
PRo - River Thames Conditions
Disembarkation card hong kong, Picabia opleidingen, Account no and ... Aleyda ortiz y luis coronel, 2c aether reverb vst, Air starting valve working....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found