diff --git a/.github/workflows/ros.yml b/.github/workflows/ros.yml index 87fb8a2a..e1d534b2 100644 --- a/.github/workflows/ros.yml +++ b/.github/workflows/ros.yml @@ -10,7 +10,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04] + os: [ubuntu-18.04, ubuntu-20.04] + fail-fast: false steps: - name: Create Catkin Workspace @@ -51,7 +52,6 @@ jobs: run: | cd "$HOME/catkin_ws/src/LilFloSystem" bash gen_install.sh - - uses: actions/cache@v1 with: path: ~/.cache/pip @@ -60,7 +60,7 @@ jobs: ${{ runner.os }}-pip- - name: Pylint - if: ${{ success() || failure() }} + if: ${{ (success() || failure()) && matrix.os == 'ubuntu-18.04' }} run: | python -m pip install --upgrade pip echo "/home/runner/.local/bin" >> $GITHUB_PATH @@ -70,7 +70,7 @@ jobs: git ls-files | grep 'py$' | xargs pylint --unsafe-load-any-extension=y --disable=fixme - name: Catkin Lint - if: ${{ success() || failure() }} + if: ${{ (success() || failure()) && matrix.os == 'ubuntu-18.04' }} run: | sudo add-apt-repository ppa:roehling/ros sudo apt-get update -y diff --git a/gen_install.sh b/gen_install.sh index c900231d..762b356f 100755 --- a/gen_install.sh +++ b/gen_install.sh @@ -9,37 +9,66 @@ sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31 sudo apt-get -qq update -y if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==16));then - ROS_VERSION="kinetic" - else - if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then - ROS_VERSION="melodic" + readonly ROS_VERSION_TARGET="kinetic" +fi +if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then + readonly ROS_VERSION_TARGET="melodic" fi +if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==20)); then + readonly ROS_VERSION_TARGET="noetic" fi -echo "installing for ros version: ${ROS_VERSION}" -sudo apt-get install -qq -y ros-${ROS_VERSION}-desktop-full -source /opt/ros/${ROS_VERSION}/setup.bash +echo "installing for ros version1: ${ROS_VERSION_TARGET}" +#to get the variable into global scope +export $ROS_VERSION_TARGET +echo "installing for ros version2: ${ROS_VERSION_TARGET}" +sudo apt-get install -qq -y ros-${ROS_VERSION_TARGET}-desktop-full +echo "installing for ros version3: ${ROS_VERSION_TARGET}" +source /opt/ros/${ROS_VERSION_TARGET}/setup.bash +echo "installing for ros version4: ${ROS_VERSION_TARGET}" ## install rosmon, it would be weird for this to be in one of the packages: -#sudo apt-get install ros-${ROS_VERSION}-rosmon - -sudo apt-get -qq install -y python-rosdep -[ ! -d "/etc/ros/rosdep/sources.list.d" ] && sudo rosdep init -q -rosdep update -q -sudo apt-get -qq install -y python-rosinstall python-rosinstall-generator python-wstool build-essential +#sudo apt-get install ros-${ROS_VERSION_TARGET}-rosmon +echo "ros version:${ROS_VERSION_TARGET}" +if [[ "$ROS_VERSION_TARGET" == "kinetic" || "$ROS_VERSION_TARGET" == "melodic" ]] +then + echo "In ROS Version kinetic or melodic" + sudo apt-get -qq install -y python-rosdep + sudo apt-get -qq install -y python-pip + #Mutagen has dropped python 2 support. Last supported version was 1.43.0: mutagen moved into if statement to account for ubuntu 20, also python3 supports latest version of mutagen. + pip install 'mutagen==1.43.0' --user -q + echo "INSTALLING ROSDEP DEPENDENCIES" + sudo apt-get -qq install python-rosdep -y + [ ! -d "/etc/ros/rosdep/sources.list.d" ] && sudo rosdep init -q + rosdep update -q + sudo apt-get -qq install -y python-rosinstall python-rosinstall-generator python-wstool build-essential +cd ~/catkin_ws +rosdep install --from-paths src --ignore-src -q -r -y --skip-keys "realsense2_camera realsense2_description rosbridge_suite rosbridge_server rosbridge_library rosbridge_msgs video_stream_opencv kobuki webrtc_ros" +cd - +fi +if [[ "$ROS_VERSION_TARGET" == "noetic" ]] +then + echo "In ROS Version noetic" + sudo apt-get -qq install -y python3-rosdep + sudo apt-get -qq install -y python3-pip + pip install 'mutagen' --user -q + echo "INSTALLING ROSDEP DEPENDENCIES" + sudo apt-get -qq install python3-rosdep -y + [ ! -d "/etc/ros/rosdep/sources.list.d" ] && sudo rosdep init -q + rosdep update -q + sudo apt-get -qq install -y python3-rosinstall python3-rosinstall-generator python3-wstool build-essential +cd ~/catkin_ws +rosdep install --from-paths src --ignore-src -q -r -y --skip-keys "realsense2_camera realsense2_description rosbridge_suite rosbridge_server rosbridge_library rosbridge_msgs video_stream_opencv kobuki webrtc_ros" +cd - +fi ## Install packages we need: echo "INSTALLING DEPENDENCIES NOT FOUND IN ROSDEP" -#pip install pyqtgraph --user +#pip install pyqtgraph --useri #I think I have replaced this by adding a symlink: #python flo_face/teensy/src/serial_coms/computer/python/serial-coms/setup.py install --user -# Mutagen has dropped python 2 support. Last supported version was 1.43.0: -sudo apt-get -qq install -y python-pip -pip install 'mutagen==1.43.0' --user -q -echo "INSTALLING ROSDEP DEPENDENCIES" -sudo apt-get -qq install python-rosdep -y -cd ~/catkin_ws -rosdep install --from-paths src --ignore-src -q -r -y --skip-keys "realsense2_camera realsense2_description rosbridge_suite rosbridge_server rosbridge_library rosbridge_msgs video_stream_opencv kobuki" -cd - +#cd ~/catkin_ws +#rosdep install --from-paths src --ignore-src -q -r -y --skip-keys "realsense2_camera realsense2_description rosbridge_suite rosbridge_server rosbridge_library rosbridge_msgs video_stream_opencv kobuki webrtc_ros" +#cd - echo "checking vars" echo "github_actions: $GITHUB_ACTIONS" diff --git a/realsense_install.sh b/realsense_install.sh index f07eb11b..e01c01a6 100755 --- a/realsense_install.sh +++ b/realsense_install.sh @@ -8,11 +8,14 @@ sudo apt-get -qq install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==16));then ROS_VERSION="kinetic" OS_VERSION="xenial" - else - if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then +fi +if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==18)); then ROS_VERSION="melodic" OS_VERSION="bionic" fi +if(($(cat /etc/os-release | grep VERSION_ID|grep -o '".*"' | sed 's/"//g' | cut -c1-2 )==20));then + ROS_VERSION="noetic" + OS_VERSION="focal" fi sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE