Skip to content

Commit

Permalink
add workflow, dockerfile, build and install scripts (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
PonomarevDA authored Mar 21, 2022
1 parent 160fc87 commit 83ade09
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .github/workflows/catkin_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: catkin_build

on: [push]

defaults:
run:
shell: bash
jobs:
catkin_build:
runs-on: ubuntu-18.04
container:
image: ros:melodic
steps:
- name: Install basic ROS requirements
run: |
apt-get update && \
apt-get install -y python-catkin-tools python-pip python3-pip && \
apt-get install -y python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential python-catkin-tools
- uses: actions/checkout@v2
with:
path: catkin_ws/src/geographiclib_conversions

- name: Install geographiclib_conversions requirements
run: ./catkin_ws/src/geographiclib_conversions/scripts/install.sh

- name: catkin build
run: source /opt/ros/melodic/setup.bash && cd catkin_ws && catkin build
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG ROS_DISTRO=melodic

FROM ros:$ROS_DISTRO
LABEL description="geographiclib_conversions"
SHELL ["/bin/bash", "-c"]
WORKDIR /catkin_ws/src/geographiclib_conversions


# 1. Install basic requirements
RUN apt-get update && \
apt-get install -y ros-$ROS_DISTRO-catkin \
python3-pip \
python3-catkin-tools
RUN if [[ "$ROS_DISTRO" = "melodic" ]] ; then apt-get install -y python-pip python-catkin-tools ; fi

# 2. Copy repository
COPY ./ ./

# 3. Setup packages
RUN ./scripts/install.sh

# 4. Build ROS
RUN source /opt/ros/$ROS_DISTRO/setup.bash && cd ../../ && catkin build

CMD echo "main process has been started" && \
source /opt/ros/$ROS_DISTRO/setup.bash && \
source /catkin_ws/devel/setup.bash && \
echo "container has been finished"
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Wrapper library for Geographiclib

Download `wmm2020` from [here](https://geographiclib.sourceforge.io/html/magnetic.html) and put them into corresponding folder or use it from `wmm2020` folder inside repository.
[Geographiclib](https://geographiclib.sourceforge.io/) is a small set of C++ classes for performing conversions between geographic, UTM, UPS, MGRS, geocentric, and local cartesian coordinates, for gravity (e.g., EGM2008), geoid height, and geomagnetic field (e.g., WMM2020) calculations, and for solving geodesic problems.

This repository is a ROS wrapper under this library.

# Installation

See [Dockerfile](Dockerfile) or [.github/workflows/catkin_build.yml](.github/workflows/catkin_build.yml) as an example of installation.
4 changes: 4 additions & 0 deletions scripts/docker/build_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd "$(dirname "$0")"

sudo docker build ../..
8 changes: 8 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
SCRIPT_FOLDER="$(dirname "$0")"
PACKAGE_FOLDER=$SCRIPT_FOLDER/..
WMM_FOLDER=$PACKAGE_FOLDER/wmm2020/magnetic

mkdir -p /usr/local/share/GeographicLib/magnetic && \
cp $WMM_FOLDER/wmm2020.wmm /usr/local/share/GeographicLib/magnetic/wmm2020.wmm && \
cp $WMM_FOLDER/wmm2020.wmm.cof /usr/local/share/GeographicLib/magnetic/wmm2020.wmm.cof

0 comments on commit 83ade09

Please # to comment.