clearpathrobotics / robot_upstart

ROS package of helper functions related to bringing up roslaunch on system startup.
BSD 3-Clause "New" or "Revised" License
193 stars 96 forks source link

Melodic compatibility: modify getifip for bionic output #88

Closed Rayman closed 4 years ago

Rayman commented 5 years ago

This is a different approach than https://github.com/clearpathrobotics/robot_upstart/pull/83 to get melodic compatibility.

We still use ifconfig, but I've modified the regex to handle the output of both distros. I've chosen for perl to print regex group 2 easily.

What do you think, is this a better approach?

Rayman commented 4 years ago

This is quite easy to test, just run rosrun robot_upstart getifip eth0 in a container:

Without fix melodic-devel (empty output)

rosrun robot_upstart getifip eth0

With fix

rosrun robot_upstart getifip eth0
172.17.0.3
mikepurvis commented 4 years ago

Heh, kind of goofy to be depending on perl, but as long as apt is implemented in perl, it will always be there on a Debian machine. Thanks for this!