Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/uwrobotics/uwrt_mars_rover
Browse files Browse the repository at this point in the history
…into user/meshvad/cartesian-arm-controller
  • Loading branch information
meshvaD committed Jan 22, 2023
2 parents 3fbb038 + 987959e commit 7af2e59
Show file tree
Hide file tree
Showing 38 changed files with 1,202 additions and 692 deletions.
2 changes: 0 additions & 2 deletions .catkin-lint

This file was deleted.

27 changes: 27 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile.dev"
},
"containerEnv": { "DISPLAY": "host.docker.internal:0.0" }

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
5 changes: 3 additions & 2 deletions .github/dependabot.yml → .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ updates:
pull-request-branch-name:
separator: "/"
assignees:
- "wmmc88"
- "niiquaye"
- "keyonjerome"
reviewers:
- "wmmc88"
- "niiquaye"
- "keyonjerome"
22 changes: 22 additions & 0 deletions .github/templates/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
Please be sure to link the relevant issues in your Pull Request
-->

# Pull Request

<!-- Provide more details below this comment. Include details on new launch files, nodes, etc -->

<!-- Also include details on your testing procedure -->

## Contribution Checklist

<!-- Put an 'x' in the boxes that apply. -->

- [ ] I have linked all the relevant issues

## Change Checklist

<!-- Put an 'x' in the boxes that apply. -->

- [ ] I have tested my changes.
- [ ] I have added new packages to the `PACKAGES_TO_TEST` variable in `ci.yaml`.
1 change: 1 addition & 0 deletions .github/workflows/cancel-superceeded-jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: [ push, pull_request ]

jobs:
cancel-superceded-jobs:
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
steps:
- name: Cancel Superceded Jobs
Expand Down
75 changes: 64 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# the "if" flag with event.json is for running the workflow locally with `act`.
name: CI

on:
Expand All @@ -10,14 +11,20 @@ on:
- cron: '0 0 * * *'

env:
PACKAGES_TO_TEST: # This limits the packages that are checked in CI. This is to avoid testing upstream packages passed in via .repos files.
uwrt_mars_rover
uwrt_mars_rover_drivetrain
uwrt_mars_rover_drivetrain_description
uwrt_mars_rover_drivetrain_hw
uwrt_mars_rover_arm_urdf
uwrt_mars_rover_arm_urdf_moveit
ROS_DISTRO: galactic
PACKAGES_TO_TEST: "uwrt_mars_rover uwrt_mars_rover_arm_urdf uwrt_mars_rover_arm_urdf_moveit"


IMAGE: "rostooling/setup-ros-docker:ubuntu-focal-ros-galactic-desktop-latest"

jobs:
prepare-actions-environment:
if: ${{ !github.event.act }}

# workaround to use variable for IMAGE. Based off of: https://github.community/t/how-to-use-env-with-container-image/17252/25
runs-on: ubuntu-latest
outputs:
Expand All @@ -27,6 +34,7 @@ jobs:
run: echo "::set-output name=image::${{ env.IMAGE }}"

linters:
if: ${{ !github.event.act }}
name: ament-${{ matrix.linter }}
needs: prepare-actions-environment
runs-on: ubuntu-latest
Expand All @@ -40,24 +48,66 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2

uses: actions/checkout@v3
- name: ROS2 Linter - [ament-${{ matrix.linter }}]
uses: ros-tooling/action-ros-lint@master
with:
distribution: rolling
distribution: ${{ env.ROS_DISTRO }}
linter: ${{ matrix.linter }}
package-name: ${{ env.PACKAGES_TO_TEST }}

linters-clang-format:
if: ${{ !github.event.act }}
name: ament-clang-format
needs: prepare-actions-environment
runs-on: ubuntu-latest
container:
image: ${{ needs.prepare-actions-environment.outputs.image }}
options: -u root

steps:
- name: Checkout Repository
uses: actions/checkout@v3

linux-amd64-build-and-test:
- name: ROS2 Linter - [ament-clang-format]
uses: ros-tooling/action-ros-lint@master
with:
distribution: ${{ env.ROS_DISTRO }}
linter: clang-format
arguments: "--config .clang-format"
package-name: ${{ env.PACKAGES_TO_TEST }}

linters-flake8:
if: ${{ !github.event.act }}
name: ament-flake8
needs: prepare-actions-environment
runs-on: ubuntu-latest
container:
image: ${{ needs.prepare-actions-environment.outputs.image }}
options: -u root

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: ROS2 Linter - [ament-flake8]
uses: ros-tooling/action-ros-lint@master
with:
distribution: ${{ env.ROS_DISTRO }}
linter: flake8
arguments: "--config .flake8"
package-name: ${{ env.PACKAGES_TO_TEST }}

linux-amd64-build-and-test:
needs: prepare-actions-environment
runs-on: ubuntu-latest
container:
image: ${{ needs.prepare-actions-environment.outputs.image }}


steps:

- name: Build ROS2 Packages and Run Tests
uses: ros-tooling/[email protected]
with:
Expand All @@ -69,7 +119,8 @@ jobs:
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/3e627e0fa30db85aea05a50e2c61a9832664d236/index.yaml
target-ros2-distro: ${{ env.ROS_DISTRO }}
vcs-repo-file-url: https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/common_upstream_dependencies.repos
vcs-repo-file-url: |
https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/common_upstream_dependencies.repos
package-name: ${{ env.PACKAGES_TO_TEST }}

linux-arm64-build-and-test:
Expand All @@ -81,11 +132,11 @@ jobs:
# Possibly resolveable with https://github.com/actions/runner/issues/320
steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Docker/QEMU dependencies
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:latest
platforms: arm64
Expand All @@ -98,9 +149,11 @@ jobs:
run: |
docker run --name arm64-ros --mount type=bind,source=$(pwd),target=/rosws/src/$(basename $(pwd)) --workdir /rosws --detach -i --rm arm64v8/ros:${{ env.ROS_DISTRO }}
- name: Install ROS Source Dependencies
- name: Download ROS Source Dependencies
run: |
docker exec --workdir /rosws/src arm64-ros vcs import --input uwrt_mars_rover/common_upstream_dependencies.repos
# TODO: add linux_arm64_upstream_dependencies.repos

- name: Install ROS Binary Package Dependencies
run: |
docker exec arm64-ros sudo apt update
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"act": true
}
16 changes: 16 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Start with the desktop ROS Galactic 20.04 image
FROM osrf/ros:galactic-desktop

# This dockerfile assumes you'll share your development folder from your computer over to the container,
# so we don't do `rosdep install` for you, or clone the repository.

# update everything
RUN sudo apt update -y --no-install-recommends && sudo apt dist-upgrade -y
# Ensure rosinstall and rosdep are installed and up to date
RUN sudo apt install -y python3-rosdep

# build via docker build -f .\Dockerfile.dev -t uwrt_dev_image .
# run via docker run --name uwrt_dev_container -e DISPLAY=host.docker.internal:0.0 -it -v uwrt_dev_image



23 changes: 23 additions & 0 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Start with the basic ROS Galactic 20.04 image
FROM ros:galactic

# Copy over the current repository to our image
COPY . $HOME/dev_ws/src/uwrt_mars_rover
WORKDIR $HOME/dev_ws/src/

# update everything
RUN sudo apt update -y --no-install-recommends && sudo apt dist-upgrade -y
# Ensure rosinstall and rosdep are installed and up to date
RUN sudo apt install -y python3-rosdep

# Install upstream source dependencies
RUN vcs import --input uwrt_mars_rover/common_upstream_dependencies.repos

# Download metapackage dependencies (unused; used in earlier years for HW bridge)
# RUN vcs import --input uwrt_mars_rover/metapackage_dependencies.repos

# Change directories to run rosdep
WORKDIR $HOME/dev_ws/
# Get all ROS dependencies for the ROS packages we use via rosdep
RUN rosdep install --from-paths src -y --ignore-src

Loading

0 comments on commit 7af2e59

Please sign in to comment.