Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into qhdwight/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed Sep 21, 2023
2 parents 75ecb00 + 4e1c8a8 commit ab3b5e9
Show file tree
Hide file tree
Showing 77 changed files with 2,317 additions and 542 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/catkin.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
ci:
name: CI
runs-on: ubuntu-latest
container:
image: umrover1/ros:latest
options: --user root
steps:
- uses: actions/checkout@v4
with:
lfs: "true"
# This makes sure that $GITHUB_WORKSPACE is the catkin workspace path
path: "src/mrover"
- name: Ensure Python Requirements
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && pip install -e "$GITHUB_WORKSPACE/src/mrover[dev]"
- name: Style Check
run: . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && cd $GITHUB_WORKSPACE/src/mrover/ && ./style.sh
- name: Update ROS APT
if: github.event.pull_request.draft == false
run: runuser -u mrover -- rosdep update
- name: Ensure ROS APT Requirements
if: github.event.pull_request.draft == false
run: runuser -u mrover -- rosdep install --from-paths "$GITHUB_WORKSPACE/src" --ignore-src -r -y --rosdistro noetic
- name: Copy Catkin Profiles
if: github.event.pull_request.draft == false
run: rsync -r $GITHUB_WORKSPACE/src/mrover/ansible/roles/build/files/profiles $GITHUB_WORKSPACE/.catkin_tools
- name: Initialize
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && catkin init && catkin profile set ci
- name: Build
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && catkin build
- name: Test
if: github.event.pull_request.draft == false
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && . $GITHUB_WORKSPACE/devel/setup.sh && catkin test -j1
19 changes: 0 additions & 19 deletions .github/workflows/style.yml

This file was deleted.

32 changes: 16 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ __pycache__/
*.py[cod]
*$py.class
.mypy_cache/
*.egg-info/

# Common IDE's, ideally this should be in global gitignore per user
**/.vscode/
**/.idea/
cmake-build*/
.vscode/
.idea/
/cmake-build*/

#GUI Files
node_modules/
/src/teleop/gui/dist/
/src/teleop/gui/node_modules/
/src/teleop/gui/src/static/map
**/keys.json*
**/yarn.lock*
**/yarn-error.log*
keys.json*
yarn.lock*
yarn-error.log*

# Bag Files
bags/

# Bag Files
bags/
/bags/

# Catkin
.catkin_tools/
build/
devel/
logs/
/build/
/devel/
/logs/

# Moteus
moteus-cal*

# CSV
*.csv
*.csv

# Virtual Environment
/venv/
1 change: 1 addition & 0 deletions .venv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv
45 changes: 12 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.16)
project(mrover VERSION 1.0.0 LANGUAGES CXX)
project(mrover VERSION 2024.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld-16)
endif ()
set(MROVER_CPP_COMPILE_OPTIONS -Wall -Wextra -Werror -pedantic)
add_link_options(-fuse-ld=lld-16)
#add_compile_definitions(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES _LIBCPP_ENABLE_CXX20_REMOVED_FEATURES)

# Generate compile_commands.json for clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down Expand Up @@ -151,7 +152,7 @@ macro(add_tests_macro)
endmacro()

# Subdirectories before message declarations
set(CMAKE_SUBDIRS "")
set(MROVER_CMAKE_INCLUDES "")


# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Expand Down Expand Up @@ -201,31 +202,11 @@ else ()
rosbridge_server
teleop_twist_joy
gazebo_ros
moveit_commander
moveit_core
moveit_fake_controller_manager
moveit_kinematics
moveit_msgs
moveit_planners_chomp
moveit_planners_ompl
moveit_ros_benchmarks
moveit_ros_control_interface
moveit_ros_manipulation
moveit_ros_move_group
moveit_ros_occupancy_map_monitor
moveit_ros_perception
moveit_ros_planning
moveit_ros_planning_interface
moveit_ros_robot_interaction
moveit_ros_visualization
moveit_ros_warehouse
moveit_setup_assistant
moveit_simple_controller_manager
)

# append subdirectories
list(APPEND CMAKE_SUBDIRS
starter_project/teleop
list(APPEND MROVER_CMAKE_INCLUDES
starter_project/autonomy/AutonomyStarterProject.cmake
)

# -=-=-=-=-
Expand All @@ -237,7 +218,7 @@ else ()
find_package(OpenCV REQUIRED COMPONENTS core aruco)
find_package(gazebo REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(ZED 2)
find_package(ZED 2 QUIET)
if (ZED_FOUND)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_STANDARD 17)
Expand Down Expand Up @@ -298,12 +279,10 @@ endif ()
catkin_python_setup()


# 4.5. Subdirectories before message declarations
if (NOT "${CMAKE_SUBDIRS}" MATCHES "")
add_subdirectory(
${CMAKE_SUBDIRS}
)
endif ()
# 4.5. CMake includes before message declarations
foreach (CMAKE_INCLUDE ${MROVER_CMAKE_INCLUDES})
include(${CMAKE_INCLUDE})
endforeach ()


# 5. Message Generators (add_xxx)
Expand Down
33 changes: 17 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
FROM ros:noetic

RUN apt-get update && apt-get upgrade -y
# Add apt repo for latest version of Git
RUN apt-get install software-properties-common -y && add-apt-repository ppa:git-core/ppa -y
RUN apt-get update && apt-get install -y \
zsh neovim sudo git git-lfs \
clang-format-12 clang-tidy-12 \
python3-catkin-tools python3-pip
RUN DEBIAN_FRONTEND=noninteractive apt-get install keyboard-configuration -y
# DEBIAN_FRONTEND=noninteractive and keyboard-configuration are needed to prevent stdin prompting later on
# This was super annoying to figure out because otherwise the build would hang
# software-properties-common is needed for apt-add-repository
RUN apt-get update -y && apt-get upgrade -y && DEBIAN_FRONTEND=noninteractive apt-get install software-properties-common keyboard-configuration -y
RUN apt-add-repository ppa:ansible/ansible -y
RUN apt-add-repository ppa:git-core/ppa -y
RUN apt-get install -y ansible git git-lfs

RUN useradd --create-home --groups sudo --shell /bin/zsh mrover
# Give mrover user sudo access with no password
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

USER mrover
RUN mkdir -p ~/catkin_ws/src/mrover
RUN mkdir -p /home/mrover/catkin_ws/src/mrover
WORKDIR /home/mrover/catkin_ws/src/mrover
# ROS package manager (rosdep) reads this file to install dependencies
# Defines the APT packages that need to be installed
# rosdep is called from Ansible to install them
ADD ./package.xml .
# Python package manager (pip) reads this file to install dependencies
ADD ./requirements.txt .
# Install ROS packages
RUN rosdep update && rosdep install --from-paths . --ignore-src -y --rosdistro=noetic
# Defines the Python packages that need to be installed
# pip is called from Ansible to install them
ADD ./pyproject.toml .
# Copy over all Ansible files
ADD ./ansible ./ansible
ADD ./ansible.sh .
RUN ./ansible.sh build.yml

USER root
# Remove apt cache to free up space in the image
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Python packags, sudo so it is a global install
RUN pip3 install -r ./requirements.txt

USER mrover
ENTRYPOINT [ "/bin/zsh" ]
4 changes: 2 additions & 2 deletions ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fi

sudo -v # Ensure Ansible has sudo permission

MROVER_PATH=$(dirname "$0")
CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
readonly MROVER_PATH=$(dirname "$0")
readonly CATKIN_WORKSPACE_PATH=$(realpath "${MROVER_PATH}"/../..)
ansible-playbook -i "localhost," -c local "${MROVER_PATH}"/ansible/"$1" --extra-vars "catkin_workspace=${CATKIN_WORKSPACE_PATH}"
7 changes: 7 additions & 0 deletions ansible/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- hosts: all
vars:
ros_distro: noetic
ubuntu_release: focal
roles:
- build
1 change: 1 addition & 0 deletions ansible/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
ros_distro: noetic
ubuntu_release: focal
roles:
- build
- dev
3 changes: 1 addition & 2 deletions ansible/jetson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
ros_distro: noetic
ubuntu_release: focal
roles:
- jetson_dev
- dev
- jetson_dev
- jetson_networks
- jetson_services

7 changes: 4 additions & 3 deletions ansible/roles/basestation_networks/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
become: True
nmcli:
conn_name: MRover
state: present
type: ethernet
ifname: enp5s0
# Share connection to the Internet
method4: shared
state: present
autoconnect: yes
ip4: 10.0.0.2/24
# Share connection to the Internet
method4: shared
method6: disabled

- name: Jetson SSH Config
community.general.ssh_config:
Expand Down
27 changes: 27 additions & 0 deletions ansible/roles/build/files/profiles/ci/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_CLANG_TIDY=clang-tidy-16
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: [ ]
licenses:
- TODO
log_space: logs
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: [ ]
28 changes: 28 additions & 0 deletions ansible/roles/build/files/profiles/debug/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
authors: [ ]
blacklist: [ ]
build_space: build
catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: [ ]
licenses:
- TODO
log_space: logs
maintainers: [ ]
make_args: [ ]
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: [ ]
1 change: 1 addition & 0 deletions ansible/roles/build/files/profiles/profiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
active: debug
Loading

0 comments on commit ab3b5e9

Please sign in to comment.