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

ROS melodic updates #126

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 38 additions & 20 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

ROS_DISTRO=${ROS_DISTRO:-lunar}
ROS_DISTRO=${ROS_DISTRO:-melodic}
ROS_CONFIGURATION=${ROS_CONFIGURATION:-desktop_full}
ROS_EXTRA_PACKAGES=${ROS_EXTRA_PACKAGES:-}
ROS_INSTALL_DIR=${ROS_INSTALL_DIR:-/opt/ros/${ROS_DISTRO}}
Expand Down Expand Up @@ -78,7 +78,7 @@ do_install()

# Brewed Python
if [ ! "$(which python2)" = "/usr/local/bin/python2" ]; then
brew install python
brew install python@2
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
fi
Expand All @@ -90,7 +90,7 @@ do_install()
brew tap osrf/simulation

# ROS infrastructure tools
brew install libyaml || true
brew install libyaml
pip2 install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools bloom empy sphinx pycurl

# Rosdep has an issue detecting that qt5 is correctly installed, so preinstall it. This is a keg-only formula,
Expand Down Expand Up @@ -118,11 +118,17 @@ do_install()
sudo rosdep init
fi
if [ ! -f /etc/ros/rosdep/sources.list.d/10-ros-install-osx.list ]; then
echo "This sudo prompt adds the the brewed python rosdep yaml to /etc/ros/rosdep/sources.list.d/10-ros-install-osx.list"
echo "This sudo prompt adds the brewed python rosdep yaml to /etc/ros/rosdep/sources.list.d/10-ros-install-osx.list"
sudo sh -c "echo 'yaml file://$(pwd)/rosdeps.yaml osx' > /etc/ros/rosdep/sources.list.d/10-ros-install-osx.list"
fi
rosdep update

# set up the symlink for openssl
# based on https://stackoverflow.com/questions/45693149/openssl-aes-h-file-not-found-on-mac
cd /usr/local/include
ln -fs ../opt/openssl/include/openssl .
cd -

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had fixed this with adding some find_package(OpenSSL) in the cmake lists. But it is not clean yet (doesn't propagate to depending packages), so I'm not sure if it is worth the effort if this also works just as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: I noticed another issue with this. Since you only set the include path, the linker still links to the system ssl and crypto libraries. I guess that might lead to wired issues...

$ otool -L /opt/ros/melodic/lib/librosbag_storage.dylib | grep /usr/lib
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
	/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got around that by passing -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" to it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Karsten1987, you mean as an alternative to ln -fs ... or adding find_package ...? I guess it doesn't address the linker issue still?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternative to the ln -fs. For finding the library in the first place, I added the openssl to my DYLD_LIBRARY_PATH:

export DYLD_LIBRARY_PATH=`brew --prefix openssl`/lib:$DYLD_LIBRARY_PATH

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes that would fix it also for dynamic linking. Thanks! 👍


# Remove previous workspace if present, create and enter new one.
WS=${ROS_DISTRO}_${ROS_CONFIGURATION}_ws
if [ -d "$WS" ]; then
Expand All @@ -135,28 +141,40 @@ do_install()
rosinstall_generator ${ROS_CONFIGURATION} ${ROS_EXTRA_PACKAGES} --rosdistro ${ROS_DISTRO} --deps --tar > ${WS}.rosinstall
wstool init src
pushd src
# Avoid downloading opencv3; we already installed it from homebrew.
wstool merge file://$(pwd)/../${WS}.rosinstall
wstool remove opencv3
wstool update -j8

# See: https://github.com/ros/catkin/pull/784
if [ -d catkin ]; then
curl https://raw.githubusercontent.com/ros/catkin/8a47f4eceb4954beb4a5b38b50793d0bbe2c96cf/cmake/catkinConfig.cmake.in > catkin/cmake/catkinConfig.cmake.in
# Pending release https://github.com/ros/bond_core/pull/37
if [ -d bond_core ]; then
curl https://raw.githubusercontent.com/ros/bond_core/1240bce50ca1538cdad07dc472d31797257e0851/bondcpp/src/bond.cpp > bond_core/bondcpp/src/bond.cpp

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: Maybe applying the patch instead of taking the files as is would be slightly more future proof, in case of a new release with other unrelated changes but this PR not merged. It also means just one line per PR and you get the latest version when the PR is updated.

curl https://patch-diff.githubusercontent.com/raw/ros/bond_core/pull/37.patch | patch -p1 --dir bond_core

Same for the other fixes from PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: overall I needed the following changes (from PRs) on Sierra for melodic:

    # See: https://github.com/ros/catkin/pull/784
    if [ -d catkin ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros/catkin/pull/784.patch | patch -p1 --dir catkin
    fi

    # See: https://github.com/ros/bond_core/pull/37
    if [ -d bond_core ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros/bond_core/pull/37.patch | patch -p1 --dir bond_core
    fi

    # See: https://github.com/ros-perception/image_common/pull/85
    if [ -d image_common ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros-perception/image_common/pull/85.patch | patch -p1 --dir image_common
    fi

    # See: https://github.com/ros-perception/vision_opencv/pull/239
    if [ -d vision_opencv ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros-perception/vision_opencv/pull/239.patch | patch -p1 --dir vision_opencv
    fi

    # See: https://github.com/ros/actionlib/pull/111
    # See: https://github.com/ros/actionlib/pull/105
    if [ -d actionlib ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros/actionlib/pull/111.patch | patch -p1 --dir actionlib
        curl https://patch-diff.githubusercontent.com/raw/ros/actionlib/pull/105.patch | patch -p1 --dir actionlib
    fi

    # See: https://github.com/ros-perception/laser_assembler/pull/16
    if [ -d laser_assembler ]; then
        curl https://patch-diff.githubusercontent.com/raw/ros-perception/laser_assembler/pull/16.patch | patch -p1 --dir laser_assembler
    fi

fi

# Pending merge and release https://github.com/ros-perception/vision_opencv/pull/239
if [ -d vision_opencv ]; then
curl https://raw.githubusercontent.com/meyerj/vision_opencv/9a9ad348abdfed010c70604cd964786f22220b30/cv_bridge/CMakeLists.txt > vision_opencv/cv_bridge/CMakeLists.txt
fi

# Pending release: https://github.com/ros-visualization/rviz/pull/1165
if [ -d rviz ]; then
curl https://raw.githubusercontent.com/mikepurvis/rviz/21eac2bcc061bb623fd17aa449f6215c493b27f2/CMakeLists.txt > rviz/CMakeLists.txt
# Pending merge and release https://github.com/ros-perception/image_common/pull/85
if [ -d image_common ]; then
curl https://raw.githubusercontent.com/meyerj/image_common/51be08ba5dc352597a2ad5baabb7e92c6baa2634/camera_calibration_parsers/CMakeLists.txt > image_common/camera_calibration_parsers/CMakeLists.txt
fi

if [ -d image_pipeline ]; then
# Pending merge and release: https://github.com/ros-perception/image_pipeline/pull/303
curl https://raw.githubusercontent.com/mikepurvis/image_pipeline/d308d00aed5b66961f9e13ab7a50660a24be7c7f/image_proc/CMakeLists.txt > image_pipeline/image_proc/CMakeLists.txt
curl https://raw.githubusercontent.com/mikepurvis/image_pipeline/d308d00aed5b66961f9e13ab7a50660a24be7c7f/stereo_image_proc/CMakeLists.txt > image_pipeline/stereo_image_proc/CMakeLists.txt
# Pending release https://github.com/ros/actionlib/pull/105
if [ -d actionlib ]; then
curl https://raw.githubusercontent.com/ros/actionlib/e30896c84209dd9b605b91f34087aefc1de91d57/src/connection_monitor.cpp > actionlib/src/connection_monitor.cpp
curl https://raw.githubusercontent.com/ros/actionlib/e30896c84209dd9b605b91f34087aefc1de91d57/include/actionlib/destruction_guard.h > actionlib/include/actionlib/destruction_guard.h
curl https://raw.githubusercontent.com/ros/actionlib/e30896c84209dd9b605b91f34087aefc1de91d57/include/actionlib/server/simple_action_server_imp.h > actionlib/include/actionlib/server/simple_action_server_imp.h
curl https://raw.githubusercontent.com/ros/actionlib/e30896c84209dd9b605b91f34087aefc1de91d57/include/actionlib/client/simple_action_client.h > actionlib/include/actionlib/client/simple_action_client.h
fi

# Pending merge and release: https://github.com/ros-perception/image_pipeline/pull/304
curl https://raw.githubusercontent.com/mbreyer/image_pipeline/4bf67d3c861cb157e8174f67250680263b18d2b7/image_publisher/CMakeLists.txt > image_pipeline/image_publisher/CMakeLists.txt
# Pending release https://github.com/ros-perception/laser_assembler/pull/16
if [ -d laser_assembler ]; then
curl https://raw.githubusercontent.com/ros-perception/laser_assembler/5c504c05078a684746860efb9db433f73c896d32/test/test_assembler.cpp > laser_assembler/test/test_assembler.cpp
fi

# temporary fix for catkin_pkg issue with unicode characters reported in https://github.com/ros-infrastructure/catkin_pkg/issues/234
if [ -d roslisp ]; then
curl https://raw.githubusercontent.com/berkaydeniz/roslisp/03826c6dd92fd348ffd7a74de1f361c13a92346c/manifest.xml > roslisp/manifest.xml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this has been fixed.

fi

# Package dependencies.
Expand All @@ -181,7 +199,8 @@ do_install()
-DCMAKE_FIND_FRAMEWORK=LAST \
-DPYTHON_EXECUTABLE=$(which python2) \
-DPYTHON_LIBRARY=$(python2 -c "import sys; print sys.prefix")/lib/libpython2.7.dylib \
-DPYTHON_INCLUDE_DIR=$(python2 -c "import sys; print sys.prefix")/include/python2.7
-DPYTHON_INCLUDE_DIR=$(python2 -c "import sys; print sys.prefix")/include/python2.7 \
-DCMAKE_CXX_STANDARD=14
catkin build --limit-status-rate 1

echo "Installation successful, please source the ROS workspace:"
Expand All @@ -202,5 +221,4 @@ do_install()
fi
fi
}

do_install
24 changes: 19 additions & 5 deletions rosdeps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@ libogre-dev:
homebrew:
packages: [ogre1.9]

# Use Gazebo 8 instead of 7.
gazebo7:
# Use Gazebo 9.
gazebo9:
osx:
homebrew:
packages: [gazebo8]
libgazebo7-dev:
packages: [gazebo9]
libgazebo9-dev:
osx:
homebrew:
packages: [gazebo8]
packages: [gazebo9]

libgpgme-dev:
osx:
homebrew:
packages: [gpgme]
# Don't try to install opencv3
opencv3:
osx:
homebrew:
packages: []

# Don't try to install google-mock
google-mock:
osx:
homebrew:
packages: []

# Installing all this Python stuff from homebrew instead of pip
# means we get pre-built bottles and don't have to build it all
# each time.
Expand All @@ -37,6 +47,10 @@ python-numpy:
osx:
homebrew:
packages: [numpy]
python-gnupg:
osx:
pip:
packages: [python-gnupg]
python-scipy:
osx:
homebrew:
Expand Down