Open gftabor opened 7 months ago
It looks like this file
./Library/etc/catkin/profile.d/10.roslaunch.bat
looks like this on windows
REM roslaunch/env-hooks/10.roslaunch.bat
:: workaround Python 2 xmlrpc performance issue
:: https://stackoverflow.com/questions/2617615/slow-python-http-server-on-localhost
:: use IP address instead to avoid unnecessary DNS lookups.
if "%ROS_MASTER_URI%" == "" (
set ROS_MASTER_URI=http://127.0.0.1:11311
)
:: it is discourage to set ROS_IP and ROS_HOSTNAME at the same time.
if "%ROS_IP%" == "" (
if "%ROS_HOSTNAME%" == "" (
set ROS_IP=127.0.0.1
)
)
That file on linux is pretty much blank.
Seems like you would have to set the ROS_HOSTNAME environment variable before activating the conda environment, and it would work how I expect.
So this is a weird hack to avoid strange performance issues, the PR that added the change is here https://github.com/ros/ros_comm/pull/1872
Following the chain all the way to https://bugs.python.org/issue6085 it seems this is a non issue in python3 so for all modern versions of ROS that hack isn't necessary
Hi @gftabor, thanks for reporting this! Are you happy to open a PR that removes the undesired behaviour in ros_comm? Happy to review + merge.
I made a PR directly to ros_comm, seems like the weird behavior is all upstream. If they don't accept the PR there then we can look at making patch here in robostack
Hi @gftabor - we're in the process of rebuilding all packages at the moment. Now would be a good time to open a PR against #418 if you would like to see this changed in RoboStack.
Solution to issue cannot be found in the documentation.
Issue
Robostack on windows automatically sets ROS_IP to local host (incorrect behavior) but not doing it on linux (correct behavior). The problem is I was setting ROS_HOSTNAME but ros was choosing to listen to IP over HOSTNAME when both were set. On linux neither ROS_IP nor ROS_HOSTNAME environment variables are set by default, so its easier to overwrite
Results of
printenv | grep ROS
on LinuxOn Windows
Interestingly
C:\Users\tabor\anaconda3\envs\foundations\etc\conda\activate.d\ros-noetic-catkin_activate.bat
doesn't mention ROS_MASTER_URI or ROS_IP but both are set.Installed packages
Environment info