Skip to content

Commit

Permalink
update cmake and .github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbattle committed Dec 13, 2021
1 parent 0a90ffb commit 7c863f7
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 70 deletions.
63 changes: 0 additions & 63 deletions .github/workflows/build_catkin.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/build_ros1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: C/C++ CI

on:
push:
branches: [ master, develop_v2.4.1 ]
pull_request:

jobs:
build:
name: "ROS1 Ubuntu 16.04"
runs-on: ubuntu-latest
steps:
- name: Build docker image
run: docker build -t local < Dockerfile_ros1_16_04
- name: Run build
run: docker run -it -v $PWD:/catkin_ws/src -w/catkin_ws catkin build


# runs-on: ${{ matrix.os }}
# if: "!contains(github.event.head_commit.message, 'skip ci')"
# strategy:
# fail-fast: false
# matrix:
# os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04 ]
# compiler: [ "/usr/bin/g++" ]
# steps:
# - uses: actions/checkout@v2
# - name: Checkout submodules
# uses: textbook/git-checkout-submodule-action@master
#
# - name: Install apt dependencies (ubuntu-16.04)
# if: matrix.os == 'ubuntu-16.04'
# run: |
# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' &&
# sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 &&
# curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - &&
# sudo apt update && sudo apt -y install build-essential ros-kinetic-desktop python-catkin-pkg python-catkin-tools libeigen3-dev git &&
# touch ~/.bashrc && echo "alias source_ros1=\"source /opt/ros/kinetic/setup.bash\"" >> ~/.bashrc
#
# - name: Install apt dependencies (ubuntu-18.04)
# if: matrix.os == 'ubuntu-18.04'
# run: |
# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' &&
# sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 &&
# curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - &&
# sudo apt update && sudo apt -y install build-essential ros-melodic-desktop python-catkin-pkg python-catkin-tools libeigen3-dev git &&
# touch ~/.bashrc && echo "alias source_ros1=\"source /opt/ros/melodic/setup.bash\"" >> ~/.bashrc
#
# - name: Install apt dependencies (ubuntu-20.04)
# if: matrix.os == 'ubuntu-20.04'
# run: |
# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' &&
# sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 &&
# curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - &&
# sudo apt update && sudo apt -y install build-essential ros-noetic-desktop python3-catkin-pkg python3-catkin-tools python3-osrf-pycommon libeigen3-dev git &&
# touch ~/.bashrc && echo "alias source_ros1=\"source /opt/ros/noetic/setup.bash\"" >> ~/.bashrc
#
# - name: Create ROS1 catkin workspace and compile
# run: |
# export REPO=$(basename $GITHUB_REPOSITORY) &&
# cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
# mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
# source_ros1 && echo "ros version: $ROS_DISTRO" &&
# catkin build -j2 --no-status
#
# - name: Run simulation dataset
# run: |
# source $GITHUB_WORKSPACE/devel/setup.bash &&
# roscore &
# export REPO=$(basename $GITHUB_REPOSITORY) &&
# source $GITHUB_WORKSPACE/devel/setup.bash &&
# rosrun ov_msckf run_simulation _sim_traj_path:=$GITHUB_WORKSPACE/src/$REPO/ov_data/sim/udel_gore.txt
18 changes: 11 additions & 7 deletions ov_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ else ()
add_definitions(-DENABLE_ARUCO_TAGS=1)
endif ()

# check if we have our python libs files
# sudo apt-get install python-matplotlib python-numpy python2.7-dev
find_package(PythonLibs 2.7)
# check if we have our python libs files (will search for python3 then python2 installs)
# sudo apt-get install python-matplotlib python-numpy python-dev
# https://cmake.org/cmake/help/latest/module/FindPython.html
# https://stackoverflow.com/a/34580995/7718197
find_package(Python COMPONENTS Interpreter Development)
option(DISABLE_MATPLOTLIB "Disable or enable matplotlib plot scripts in ov_eval" OFF)
if (PYTHONLIBS_FOUND AND NOT DISABLE_MATPLOTLIB)
if (Python_FOUND AND NOT DISABLE_MATPLOTLIB)
add_definitions(-DHAVE_PYTHONLIBS=1)
message(STATUS "PYTHON VERSION: " ${PYTHONLIBS_VERSION_STRING})
message(STATUS "PYTHON INCLUDE: " ${PYTHON_INCLUDE_DIRS})
message(STATUS "PYTHON LIBRARIES: " ${PYTHON_LIBRARIES})
message(STATUS "PYTHON VERSION: " ${Python_VERSION})
message(STATUS "PYTHON INCLUDE: " ${Python_INCLUDE_DIRS})
message(STATUS "PYTHON LIBRARIES: " ${Python_LIBRARIES})
include_directories(${Python_INCLUDE_DIRS})
list(APPEND thirdparty_libraries ${Python_LIBRARIES})
endif ()

# We need c++14 for ROS2, thus just require it for everybody
Expand Down

0 comments on commit 7c863f7

Please sign in to comment.