Skip to content

Commit

Permalink
pulled integration
Browse files Browse the repository at this point in the history
  • Loading branch information
neuenfeldttj committed Feb 20, 2024
2 parents 261a27e + 7cd08ae commit c6cc823
Show file tree
Hide file tree
Showing 788 changed files with 581,946 additions and 233,208 deletions.
12 changes: 11 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
text=auto
# Image files
*.png filter=lfs diff=lfs merge=lfs -text
# Model files
*.dae filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.stl filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
# Neural network files
*.pt filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.engine filter=lfs diff=lfs merge=lfs -text
# Model files
*.glb filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
# Packages
*.deb filter=lfs diff=lfs merge=lfs -text
# Program files
ansible/roles/esw/files/bin/fdcanusb_daemon filter=lfs diff=lfs merge=lfs -text
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- master
- integration
push:
branches:
- master
Expand Down Expand Up @@ -37,9 +38,12 @@ jobs:
- 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
- name: Build Without Clang Tidy
if: github.event.pull_request.draft == false && github.event.pull_request.base.ref != 'refs/heads/master'
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && catkin build
- name: Build With Clang Tidy
if : github.event_name == 'push' && github.event.pull_request.base.ref == 'refs/heads/master'
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && catkin build -DCMAKE_CXX_CLANG_TIDY=clang-tidy-16
- 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
run: . /opt/ros/noetic/setup.sh && . /home/mrover/catkin_ws/src/mrover/venv/bin/activate && . $GITHUB_WORKSPACE/devel/setup.sh && catkin test && rostest mrover integration.test --text
6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[submodule "deps/libde265"]
path = deps/libde265
url = git@github.com:strukturag/libde265.git
url = https://github.com/strukturag/libde265.git
shallow = true
branch = 0.1-20240106
[submodule "deps/dawn"]
path = deps/dawn
url = https://dawn.googlesource.com/dawn
shallow = true
branch = chromium/6108
[submodule "deps/manif"]
path = deps/manif
url = https://github.com/artivis/manif.git
shallow = true
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"python.analysis.typeCheckingMode": "off",
//// Miscellaneous
"redhat.telemetry.enabled": false,
"editor.formatOnSave": true,
"git.ignoreSubmodules": true,
"git.detectSubmodules": false,
"cSpell.words": [
Expand All @@ -46,5 +45,9 @@
"**/bower_components": true,
"**/*.code-search": true,
"deps/dawn": true,
}
},
"python.autoComplete.extraPaths": [
"/home/eric/catkin_ws/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
]
}
59 changes: 22 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ if (MROVER_CI)
list(APPEND MROVER_CPP_COMPILE_OPTIONS -Werror)
endif ()

option(MROVER_BUILD_SIM "Build the simulator" ON)

include(cmake/macros.cmake)

# ROS packages list
Expand Down Expand Up @@ -63,6 +61,7 @@ set(MROVER_MESSAGE_DEPENDENCIES

set(MROVER_PARAMETERS
config/DetectorParams.cfg
config/ObjectDetectorParams.cfg
)

set(MROVER_CMAKE_INCLUDES
Expand All @@ -73,29 +72,8 @@ set(MROVER_CMAKE_INCLUDES
### Dependencies ###
### ============ ###

if (MROVER_BUILD_SIM)
# Apparently Assimp has different names on different systems
# find_package is case-sensitive so try both
find_package(Assimp QUIET)
find_package(assimp QUIET)
if (NOT Assimp_FOUND AND NOT assimp_FOUND)
message(FATAL_ERROR "Assimp not found")
endif ()

find_package(Bullet REQUIRED)
include(cmake/deps.cmake)

find_package(glfw3 REQUIRED)

include(cmake/webgpu.cmake)

add_subdirectory(deps/glfw3webgpu)
endif ()
find_package(OpenCV REQUIRED)
find_package(ZED QUIET)
find_package(Eigen3 REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_search_module(NetLink libnl-3.0)
pkg_search_module(NetLinkRoute libnl-route-3.0)
if (ZED_FOUND)
# Anything newer than C++17 combined with libstdc++13 is not supported just yet by NVCC (the CUDA compiler)
set(CMAKE_CUDA_STANDARD 17)
Expand Down Expand Up @@ -142,6 +120,7 @@ catkin_package()
## Libraries

mrover_add_library(lie src/util/lie/*.cpp src/util/lie)
target_link_libraries(lie PUBLIC MANIF::manif)

## ESW

Expand Down Expand Up @@ -169,9 +148,10 @@ if (NOT APPLE)
mrover_add_esw_bridge_node(cache_bridge src/esw/cache_bridge/*.cpp)
mrover_add_esw_bridge_node(drive_bridge src/esw/drive_bridge/*.cpp)
mrover_add_esw_bridge_node(led_hw_bridge src/esw/led_hw_bridge/*.cpp)
mrover_add_esw_bridge_node(led src/esw/led/*.cpp)
mrover_add_esw_bridge_node(mast_gimbal_bridge src/esw/mast_gimbal_bridge/*.cpp)
mrover_add_esw_bridge_node(pdb_bridge src/esw/pdb_bridge/*.cpp)
mrover_add_esw_bridge_node(sa_bridge src/esw/sa_bridge/*.cpp)
# mrover_add_esw_bridge_node(sa_bridge src/esw/sa_translator_bridge/*.cpp)
mrover_add_esw_bridge_node(science_bridge src/esw/science_bridge/*.cpp)
mrover_add_esw_bridge_node(brushless_test_bridge src/esw/brushless_test_bridge/*.cpp motor_library)
mrover_add_esw_bridge_node(brushed_test_bridge src/esw/brushed_test_bridge/*.cpp)
Expand All @@ -193,11 +173,15 @@ if (CUDA_FOUND)
endif ()

if (ZED_FOUND)
mrover_add_library(streaming src/esw/streaming/*.c* src/esw/streaming)
# target_link_libraries(streaming PUBLIC opencv_core opencv_cudacodec)
target_link_libraries(streaming PUBLIC cuda nvidia-encode opencv_core)
target_include_directories(streaming SYSTEM PUBLIC deps/nvenc)
target_compile_definitions(streaming PUBLIC BOOST_ASIO_NO_DEPRECATED)
mrover_add_nodelet(object_detector src/perception/object_detector/*.c* src/perception/object_detector src/perception/object_detector/pch.hpp)
mrover_nodelet_link_libraries(object_detector PRIVATE opencv_core opencv_dnn opencv_imgproc lie nvinfer nvonnxparser tbb)
mrover_nodelet_defines(object_detector
__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ # Eigen includes some files it should not, ignore
)
# TODO(john): Update object detector to use new API
target_compile_options(object_detector_nodelet PRIVATE -Wno-deprecated-declarations)
# Temporary
mrover_nodelet_link_libraries(object_detector PRIVATE opencv_imgcodecs opencv_highgui)

mrover_add_nodelet(zed src/perception/zed_wrapper/*.c* src/perception/zed_wrapper src/perception/zed_wrapper/pch.hpp)
mrover_nodelet_include_directories(zed ${ZED_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS})
Expand All @@ -216,8 +200,8 @@ mrover_add_node(arm_controller src/teleoperation/arm_controller/*.cpp)

if (MROVER_BUILD_SIM)
mrover_add_nodelet(simulator src/simulator/*.cpp src/simulator src/simulator/pch.hpp)
mrover_nodelet_include_directories(simulator ${ASSIMP_INCLUDE_DIRS} ${BULLET_INCLUDE_DIRS} ${OPENCV_INCLUDE_DIRS} src/simulator/imgui)
mrover_nodelet_link_libraries(simulator ${ASSIMP_LIBRARIES} ${BULLET_LIBRARIES} glfw3webgpu webgpu glfw opencv_core opencv_imgcodecs opencv_imgproc lie)
mrover_nodelet_include_directories(simulator ${ASSIMP_INCLUDE_DIRS} ${BULLET_INCLUDE_DIRS} ${OPENCV_INCLUDE_DIRS})
mrover_nodelet_link_libraries(simulator ${ASSIMP_LIBRARIES} ${BULLET_LIBRARIES} glfw3webgpu webgpu glfw opencv_core opencv_imgcodecs opencv_imgproc webgpu_hpp imgui lie)
mrover_nodelet_defines(simulator BOOST_THREAD_PROVIDES_FUTURE)
endif ()

Expand All @@ -232,15 +216,16 @@ catkin_add_gtest(example-cpp-test test/example/cpp_test.cpp)

# Python unit tests
catkin_add_nosetests(test/navigation/drive_test.py)
catkin_add_nosetests(test/teleop/teleop_test.py)
catkin_add_nosetests(test/util/SE3_test.py)
catkin_add_nosetests(test/util/SO3_test.py)

# Integration tests (python and c++)
find_package(rostest REQUIRED)
add_rostest(test/example/basic_integration_test.test)
add_rostest(test/integration/integration.test)
add_rostest(test/util/SE3_tf_test.test)
# Note(quintin): Commented these out because they ignore the Python virtual environment
# Most of our code relies on newer Python features so they fail to initialize
#find_package(rostest REQUIRED)
#add_rostest(test/example/basic_integration_test.test)
#add_rostest(test/integration/integration.test)
#add_rostest(test/util/SE3_tf_test.test)

## Install

Expand Down
26 changes: 15 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
FROM ros:noetic
FROM ubuntu:focal

# 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
# DEBIAN_FRONTEND=noninteractive prevents apt from asking for user input
# 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
# sudo is needed for ansible since it escalates from a normal user to root
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install software-properties-common sudo -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
ADD ./pkg /tmp/
RUN apt-get install -f /tmp/*.deb && rm /tmp/*.deb

RUN useradd --create-home --groups sudo --shell /bin/zsh mrover
# Give mrover user sudo access with no password
Expand All @@ -17,18 +19,20 @@ RUN mkdir -p /home/mrover/catkin_ws/src/mrover
WORKDIR /home/mrover/catkin_ws/src/mrover
# Defines the APT packages that need to be installed
# rosdep is called from Ansible to install them
ADD ./package.xml .
ADD --chown=mrover:mrover ./package.xml .
# Defines the Python packages that need to be installed
# pip is called from Ansible to install them
ADD ./pyproject.toml .
ADD --chown=mrover:mrover ./pyproject.toml .
# Define the NPM packages that need to be installed by Bun
ADD --chown=mrover:mrover ./src/teleoperation/frontend/package.json ./src/teleoperation/frontend/bun.lockb ./src/teleoperation/frontend/
# Copy over all Ansible files
ADD ./ansible ./ansible
ADD ./ansible.sh .
RUN ./ansible.sh build.yml
ADD --chown=mrover:mrover ./ansible ./ansible
ADD --chown=mrover:mrover ./ansible.sh .
RUN ./ansible.sh ci.yml

USER root
# Remove apt cache to free up space in the image
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

USER mrover
ENTRYPOINT [ "/bin/zsh" ]
ENTRYPOINT [ "/bin/bash" ]
7 changes: 7 additions & 0 deletions ansible/ci.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:
- ci
1 change: 0 additions & 1 deletion ansible/roles/build/files/profiles/ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cmake_args:
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_CLANG_TIDY=clang-tidy-16
- -DCMAKE_CUDA_HOST_COMPILER=clang++-16
- -DMROVER_CI=ON
- -Wno-dev
Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@
- ros-{{ ros_distro }}-rosbash
- libbullet-dev
- libglfw3-dev
- xorg-dev
- libx11-xcb-dev
- libnl-3-dev
- libnl-route-3-dev
- libtbb-dev
- libopencv-dev

- name: Initialize rosdep
become: True
Expand Down
Loading

0 comments on commit c6cc823

Please sign in to comment.