Skip to content

Commit

Permalink
more workflows and fix ros-free build
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbattle committed Dec 13, 2021
1 parent df93c2b commit ae0276f
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ROS Free Workflow

on:
push:
branches: [ master]
pull_request:

jobs:
build:
name: "Ubuntu Latest"
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Configure and Build
run: |
apt-get update && apt-get install -y libeigen3-dev &&
mkdir build && cd build &&
cmake ../ov_msckf/ && make
9 changes: 9 additions & 0 deletions .github/workflows/build_ros1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
docker build -t openvins -f $GITHUB_WORKSPACE/src/$REPO/Dockerfile_ros1_16_04 .
- name: Echo Enviroment
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "echo $ROS_DISTRO && echo $ROS_VERSION"
- name: Run Build in Docker
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && catkin build"
Expand All @@ -36,6 +39,9 @@ jobs:
cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
docker build -t openvins -f $GITHUB_WORKSPACE/src/$REPO/Dockerfile_ros1_18_04 .
- name: Echo Enviroment
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "echo $ROS_DISTRO && echo $ROS_VERSION"
- name: Run Build in Docker
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && catkin build"
Expand All @@ -54,6 +60,9 @@ jobs:
cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
docker build -t openvins -f $GITHUB_WORKSPACE/src/$REPO/Dockerfile_ros1_20_04 .
- name: Echo Enviroment
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "echo $ROS_DISTRO && echo $ROS_VERSION"
- name: Run Build in Docker
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && catkin build"
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/build_ros2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ROS 2 Workflow

on:
push:
branches: [ master ]
pull_request:

jobs:
build_1804:
name: "ROS2 Ubuntu 18.04"
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Create Workspace and Docker Image
run: |
export REPO=$(basename $GITHUB_REPOSITORY) &&
cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
docker build -t openvins -f $GITHUB_WORKSPACE/src/$REPO/Dockerfile_ros2_18_04 .
- name: Echo Enviroment
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "echo $ROS_DISTRO && echo $ROS_VERSION"
- name: Run Build in Docker
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && colcon build"
- name: Run OpenVINS Simulation!
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && source install/setup.bash && ros2 run ov_msckf run_simulation src/open_vins/config/rpng_sim/estimator_config.yaml"
build_2004:
name: "ROS2 Ubuntu 20.04"
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Create Workspace and Docker Image
run: |
export REPO=$(basename $GITHUB_REPOSITORY) &&
cd $GITHUB_WORKSPACE/.. && mkdir src/ &&
mv $REPO/ src/ && mkdir $REPO/ && mv src/ $REPO/ && cd $REPO/ &&
docker build -t openvins -f $GITHUB_WORKSPACE/src/$REPO/Dockerfile_ros2_20_04 .
- name: Echo Enviroment
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "echo $ROS_DISTRO && echo $ROS_VERSION"
- name: Run Build in Docker
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && colcon build"
- name: Run OpenVINS Simulation!
run: |
docker run -t --mount type=bind,source=$GITHUB_WORKSPACE,target=/catkin_ws openvins /bin/bash -c "cd /catkin_ws && source install/setup.bash && ros2 run ov_msckf run_simulation src/open_vins/config/rpng_sim/estimator_config.yaml"
27 changes: 23 additions & 4 deletions ov_msckf/cmake/ROS1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,34 @@ list(APPEND thirdparty_libraries

# If we are not building with ROS then we need to manually link to its headers
# This isn't that elegant of a way, but this at least allows for building without ROS
# See this stackoverflow answer: https://stackoverflow.com/a/11217008/7718197
# If we had a root cmake we could do this: https://stackoverflow.com/a/11217008/7718197
# But since we don't we need to basically build all the cpp / h files explicitly :(
if (NOT catkin_FOUND OR NOT ENABLE_ROS)

message(WARNING "MANUALLY LINKING TO OV_CORE LIBRARY....")
message(WARNING ${ov_core_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/../ov_core/src/)
list(APPEND thirdparty_libraries ov_core_lib)
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/cam/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/cpi/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/feat/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/plot/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/sim/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/track/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/types/*.cpp")
list(APPEND library_source_files ${ov_core_files})
file(GLOB_RECURSE ov_core_files "${CMAKE_SOURCE_DIR}/../ov_core/src/utils/*.cpp")
list(APPEND library_source_files ${ov_core_files})

message(WARNING "MANUALLY LINKING TO OV_INIT LIBRARY....")
include_directories(${CMAKE_SOURCE_DIR}/../ov_init/src/)
list(APPEND thirdparty_libraries ov_init_lib)
file(GLOB_RECURSE ov_init_files "${CMAKE_SOURCE_DIR}/../ov_init/src/*.[hc]pp")
list(APPEND library_source_files ${ov_init_files})

endif ()

##################################################
Expand Down
4 changes: 4 additions & 0 deletions ov_msckf/src/run_simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ int main(int argc, char **argv) {
viz->visualize_final();
#endif

#if ROS_AVAILABLE == 2
rclcpp::shutdown();
#endif

// Done!
return EXIT_SUCCESS;
}

0 comments on commit ae0276f

Please sign in to comment.