Skip to content
Snippets Groups Projects
Select Git revision
  • 7bac8b8c533831efde515c5fce5cbf144decad69
  • master default
  • include-tests
  • remove-yaml-quotes
  • configurable-ci-setup-lookup-path
  • dev-image-test-bak
  • dev-images
  • tmp/deploy-image-build
  • fast-ci
  • modular-templates
10 results

catkin_ws_init.sh

Blame
  • Forked from tecnalia_robotics-public / templates
    Source project has a limited visibility.
    catkin_ws_init.sh 943 B
    #!/bin/bash
    
    if [[ -z "${ROS_PACKAGE_PATH}" ]]; then
       . $(find /opt/ros/ -name "setup.bash")
    fi
    
    if [[ -z "${ROS_DISTRO}" ]]; then
       export ROS_DISTRO=$(basename $(find /opt/ros/* -maxdepth 0 -type d | head -1))
    fi
    
    pkg_name=$(basename $(find /workspaces/ -maxdepth 1 -mindepth 1 -type d))
    mkdir -p ~/robot_ws/src
    cd ~/robot_ws/src
    ln -s /workspaces/${pkg_name}
    cd ..
    wstool init src
    if [ -f "src/${pkg_name}/.rosinstall" ]; then
        wstool merge "src/${pkg_name}/.rosinstall" -t src
    fi
    
    mkdir -p ~/.ssh/
    cat << EOF >> ~/.ssh/config
    Host *
         StrictHostKeyChecking no
    EOF
    wstool update -t src
    find -L src -name ci_entry_script.bash -exec bash -c 'echo Running entry script from $(basename $(dirname $1)) ; $1 ' _ {} \;
    rosdep update
    rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y
    catkin init
    catkin config --cmake-args -DCMAKE_CXX_FLAGS=-w --
    
    echo "source $(find /opt/ros/ -name 'setup.bash')"  >>  ~/.bashrc