cyberbotics / webots_ros

Webots ROS package
88 stars 39 forks source link

Looks for executable in incorrect executable location for Webots on Mac #149

Open askman92 opened 6 months ago

askman92 commented 6 months ago

This may be somewhat niche as this issue might be limited to users of Robostack, but I was asked to raise the issue here and I would really appreciate some help.

This occurs when running roslaunch webots_ros e_puck_line.launch.

When I install webots_ros to my Robostack ROS environment, webots_ros looks for the executable at $WEBOTS_HOME/webots, however on Mac this directory does not exist, and instead needs to be called from /Applications/Webots.app/Contents/MacOS/webots.

I can patch this in my local install by changing the following in webots_launcher.py which allows webots_ros to launch Webots successfully.

command = [os.path.join(os.environ['WEBOTS_HOME'], 'webots'), '--mode=' + options.mode, options.world]

to

command = [os.path.join(os.environ['WEBOTS_HOME'], 'Contents/MacOS/webots'), '--mode=' + options.mode, options.world]

Following this however, I get two other issues which I would really like some advice on if possible:

  1. Running roslaunch webots_ros e_puck_line.launch tells me that a file cannot be found:

    File not found: '/Applications/Webots.app/resources/qt_warning_filters.conf'.

    I think this is a similar issue with the path not mapping correctly on Mac as this file lives at /Applications/Webots.app/Contents/Resources/qt_warning_filters.conf, however I cannot find that this code is in webot_ros anywhere and seems to come from this line in webots itself. I don't see this error if I launch Webots manually however.

  2. Number 1 doesn't seem to prevent Webots from launching epuck, but Webots does not find the controller directories:

    WARNING: DEF EPUCK E-puck: The controller directory has not been found, searched the following locations:
    /opt/homebrew/Caskroom/miniforge/base/envs/ros_env/share/webots_ros/controllers/ros/
    /Applications/Webots.app/Contents/projects/robots/gctronic/e-puck/controllers/ros/
    /Applications/Webots.app/Contents/projects/default/controllers/ros/
    /Applications/Webots.app/Contents/Resources/projects/controllers/ros/
    WARNING: ros: Could not find the controller directory.
    Starting the <generic> controller instead.
    INFO: <generic>: Starting controller: /Applications/Webots.app/Contents/Resources/projects/controllers/generic/generic

    The controller do however, show up when I manually go to select them, and they seem to work but it would be nice to get rid of the errors:

image