Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/integration' into network-bandwidth
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed Apr 29, 2024
2 parents 784d380 + d44fa8c commit e2db1de
Show file tree
Hide file tree
Showing 204 changed files with 18,847 additions and 6,320 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,8 @@ jobs:
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 --no-cache-dir -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
Expand All @@ -42,7 +34,7 @@ jobs:
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'
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
Expand Down
12 changes: 1 addition & 11 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
[submodule "deps/libde265"]
path = deps/libde265
url = https://github.com/strukturag/libde265.git
shallow = true
branch = v1.0.15
[submodule "deps/dawn"]
path = deps/dawn
url = https://dawn.googlesource.com/dawn
shallow = true
branch = chromium/6108
[submodule "deps/emsdk"]
path = deps/emsdk
url = [email protected]:emscripten-core/emsdk.git
shallow = true
branch = 3.1.53
branch = chromium/6376
[submodule "deps/manif"]
path = deps/manif
url = https://github.com/artivis/manif.git
Expand Down
80 changes: 43 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ set(MROVER_ROS_DEPENDENCIES
tf2
tf2_ros
tf2_geometry_msgs
actionlib_msgs
)

extract_filenames(msg/*.msg MROVER_MESSAGE_FILES)

extract_filenames(srv/*.srv MROVER_SERVICE_FILES)

extract_filenames(action/*.action MROVER_ACTION_FILES)

set(MROVER_MESSAGE_DEPENDENCIES
std_msgs
sensor_msgs
actionlib_msgs
)

set(MROVER_PARAMETERS
Expand All @@ -98,7 +102,7 @@ if (ZED_FOUND)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
set(CMAKE_CUDA_FLAGS "--diag-suppress 108,68")
set(CMAKE_CUDA_FLAGS "--diag-suppress 20012")
# Jetson Xavier NX/AGX has Volta 7.2 architecture
# Perception Laptop (A4000, Quadro version of RTX 3080) has Ampere 8.6 architecture
set(CMAKE_CUDA_ARCHITECTURES 72 86)
Expand All @@ -123,6 +127,8 @@ add_message_files(FILES ${MROVER_MESSAGE_FILES})

add_service_files(FILES ${MROVER_SERVICE_FILES})

add_action_files(DIRECTORY action FILES ${MROVER_ACTION_FILES})

generate_messages(DEPENDENCIES ${MROVER_MESSAGE_DEPENDENCIES})

generate_dynamic_reconfigure_options(${MROVER_PARAMETERS})
Expand All @@ -143,42 +149,40 @@ target_link_libraries(lie PUBLIC MANIF::manif)

## ESW

if (NOT APPLE)
mrover_add_vendor_header_only_library(moteus deps/mjbots)
mrover_add_header_only_library(can_device src/esw/can_device)
mrover_add_library(motor_library src/esw/motor_library/*.cpp src/esw/motor_library)
target_link_libraries(motor_library PUBLIC can_device moteus)

if (NetLink_FOUND AND NetLinkRoute_FOUND)
mrover_add_nodelet(can_driver src/esw/can_driver/*.cpp src/esw/can_driver src/esw/can_driver/pch.hpp)
mrover_nodelet_link_libraries(can_driver ${NetLink_LIBRARIES} ${NetLinkRoute_LIBRARIES})
mrover_nodelet_include_directories(can_driver ${NetLink_INCLUDE_DIRS} ${NetLinkRoute_INCLUDE_DIRS})
endif ()
mrover_add_vendor_header_only_library(moteus deps/mjbots)
mrover_add_header_only_library(can_device src/esw/can_device)
mrover_add_library(motor_library src/esw/motor_library/*.cpp src/esw/motor_library)
target_link_libraries(motor_library PUBLIC can_device moteus)

macro(mrover_add_esw_bridge_node name sources)
mrover_add_node(${name} ${sources})
target_link_libraries(${name} PRIVATE can_device motor_library)
endmacro()

mrover_add_esw_bridge_node(arm_hw_bridge src/esw/arm_hw_bridge/*.cpp)
mrover_add_esw_bridge_node(arm_translator_bridge src/esw/arm_translator_bridge/*.cpp src/esw/arm_translator_bridge/*.hpp)
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_hw_bridge src/esw/sa_hw_bridge/*.cpp)
mrover_add_esw_bridge_node(sa_translator_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)
mrover_add_esw_bridge_node(test_arm_bridge src/esw/test_arm_bridge/*.cpp)
mrover_add_esw_bridge_node(pdb_test_bridge src/esw/pdb_test_bridge/*.cpp)
mrover_add_esw_bridge_node(arm_position_test_bridge src/esw/arm_position_test_bridge/*.cpp)
# mrover_add_esw_bridge_node(sa_sensor src/esw/fw/dirt_sensor/dirt_sensor_ros/dirt_sensor_ros.ino)
if (NetLink_FOUND AND NetLinkRoute_FOUND)
mrover_add_nodelet(can_driver src/esw/can_driver/*.cpp src/esw/can_driver src/esw/can_driver/pch.hpp)
mrover_nodelet_link_libraries(can_driver ${NetLink_LIBRARIES} ${NetLinkRoute_LIBRARIES})
mrover_nodelet_include_directories(can_driver ${NetLink_INCLUDE_DIRS} ${NetLinkRoute_INCLUDE_DIRS})
endif ()

macro(mrover_add_esw_bridge_node name sources)
mrover_add_node(${name} ${sources})
target_link_libraries(${name} PRIVATE can_device motor_library)
endmacro()

mrover_add_esw_bridge_node(arm_hw_bridge src/esw/arm_hw_bridge/*.cpp)
mrover_add_esw_bridge_node(arm_translator_bridge src/esw/arm_translator_bridge/*.cpp src/esw/arm_translator_bridge/*.hpp)
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(science_bridge src/esw/science_bridge/*.cpp)
mrover_add_esw_bridge_node(brushless_test_bridge src/esw/brushless_test_bridge/*.cpp)
mrover_add_esw_bridge_node(brushed_test_bridge src/esw/brushed_test_bridge/*.cpp)
mrover_add_esw_bridge_node(science_test_bridge src/esw/science_test_bridge/*.cpp)
mrover_add_esw_bridge_node(test_arm_bridge src/esw/test_arm_bridge/*.cpp)
mrover_add_esw_bridge_node(pdb_test_bridge src/esw/pdb_test_bridge/*.cpp)
# mrover_add_esw_bridge_node(arm_position_test_bridge src/esw/arm_position_test_bridge/*.cpp)
# mrover_add_esw_bridge_node(sa_sensor src/esw/fw/dirt_sensor/dirt_sensor_ros/dirt_sensor_ros.ino)

## Perception

mrover_add_library(websocket_server src/esw/websocket_server/*.cpp src/esw/websocket_server)
Expand All @@ -199,9 +203,11 @@ if (CUDA_FOUND)
# target_include_directories(nv_vid_codec_h265_enc SYSTEM PUBLIC deps/nvenc)
endif ()

mrover_add_nodelet(gst_websocket_streamer src/esw/gst_websocket_streamer/*.c* src/esw/gst_websocket_streamer src/esw/gst_websocket_streamer/pch.hpp)
mrover_nodelet_link_libraries(gst_websocket_streamer PRIVATE websocket_server ${Gst_LIBRARIES} ${GstApp_LIBRARIES})
mrover_nodelet_include_directories(gst_websocket_streamer ${Gst_INCLUDE_DIRS} ${GstApp_INCLUDE_DIRS})
if (Gst_FOUND AND GstApp_FOUND AND LibUsb_FOUND AND LibUdev_FOUND)
mrover_add_nodelet(gst_websocket_streamer src/esw/gst_websocket_streamer/*.c* src/esw/gst_websocket_streamer src/esw/gst_websocket_streamer/pch.hpp)
mrover_nodelet_link_libraries(gst_websocket_streamer PRIVATE websocket_server ${Gst_LIBRARIES} ${GstApp_LIBRARIES} ${LibUsb_LIBRARIES} ${LibUdev_LIBRARIES} opencv_core opencv_imgproc)
mrover_nodelet_include_directories(gst_websocket_streamer ${Gst_INCLUDE_DIRS} ${GstApp_INCLUDE_DIRS} ${LibUsb_INCLUDE_DIRS} ${LibUdev_INCLUDE_DIRS})
endif ()

if (ZED_FOUND)
mrover_add_nodelet(object_detector src/perception/object_detector/*.c* src/perception/object_detector src/perception/object_detector/pch.hpp)
Expand Down
3 changes: 3 additions & 0 deletions action/ArmAction.action
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
string name
---
---
4 changes: 2 additions & 2 deletions ansible/roles/build/files/profiles/ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_CXX_FLAGS=-pipe -fgnuc-version=13.1.0
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CUDA_HOST_COMPILER=clang++-16
- -DCMAKE_CUDA_HOST_COMPILER=g++-9
- -DMROVER_IS_CI=ON
- -Wno-dev
devel_layout: linked
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/build/files/profiles/debug/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Debug
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_FLAGS=-pipe
- -DCMAKE_CXX_FLAGS=-pipe -fgnuc-version=13.1.0
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_HOST_COMPILER=clang++-16
- -DCMAKE_CUDA_HOST_COMPILER=g++-9
- -Wno-dev
devel_layout: linked
devel_space: devel
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/build/files/profiles/release/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ catkin_make_args: [ ]
cmake_args:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_C_COMPILER=clang-16
- -DCMAKE_CXX_FLAGS=-march=native -pipe
- -DCMAKE_CXX_FLAGS=-march=native -pipe -fgnuc-version=13.1.0
- -DCMAKE_CXX_COMPILER=clang++-16
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache
- -DCMAKE_CUDA_HOST_COMPILER=clang++-16
- -DCMAKE_CUDA_HOST_COMPILER=g++-9
- -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
- -Wno-dev
devel_layout: linked
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
- vainfo
- x264

- name: Install Local APT Packages
become: True
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/esw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

- name: Install Moteus GUI
pip:
name: moteus_gui
name: moteus-gui
8 changes: 4 additions & 4 deletions ansible/roles/jetson_build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
state: latest
name:
- zstd # Required to unpack ZED installer
- cuda
- cuda-12-3
- nvidia-jetpack

- name: ZED SDK Download
get_url:
url: https://download.stereolabs.com/zedsdk/4.0/l4t35.4/jetsons
dest: /tmp/ZED_SDK_Tegra_L4T35.4_v4.0.7.zstd.run
url: https://download.stereolabs.com/zedsdk/4.1/l4t35.4/jetsons
dest: /tmp/ZED_SDK_Tegra_L4T35.4_v4.1.zstd.run
mode: 0755

- name: ZED SDK Install
# Silent mode prevents any user input prompting
command: /tmp/Downloads/ZED_SDK_Tegra_L4T35.4_v4.0.7.zstd.run -- silent
command: /tmp/Downloads/ZED_SDK_Tegra_L4T35.4_v4.1.zstd.run -- silent
args:
creates: /usr/local/zed
2 changes: 0 additions & 2 deletions ansible/roles/jetson_services/files/99-usb-serial.rules

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 6 additions & 0 deletions ansible/roles/jetson_services/files/rules/99-usb-serial.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SUBSYSTEM=="tty", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a9", SYMLINK+="gps_%n"
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0058", SYMLINK+="imu"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="1bcf", ATTRS{idProduct}=="0b12", ATTR{index}=="0", GROUP="video", SYMLINK+="arducam"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="2b03", ATTRS{idProduct}=="f582", ATTR{index}=="0", GROUP="video", SYMLINK+="zed"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="05a3", ATTRS{idProduct}=="9601", ATTR{index}=="0", GROUP="video", SYMLINK+="mobcam"
SUBSYSTEM=="video4linux", KERNEL=="video*", ATTRS{idVendor}=="32e4", ATTRS{idProduct}=="9601", ATTR{index}=="0", GROUP="video", SYMLINK+="staticcam"
14 changes: 14 additions & 0 deletions ansible/roles/jetson_services/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: USB Rules
become: true
synchronize:
src: files/rules/
dest: /etc/udev/rules.d
recursive: true

- name: udev Reload Rules
become: true
command: udevadm control --reload-rules

- name: udev TTY Trigger
become: true
command: udevadm trigger --subsystem-match=tty
Binary file removed bun.lockb
Binary file not shown.
11 changes: 11 additions & 0 deletions cmake/deps.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# The simulator will only be built if Dawn (low-level graphics API) is found:
# 1) Installed system-wide with the .deb package in the pkg/ folder. This is ONLY for Ubuntu 20
# If this is the case then "find_package" will set "dawn_FOUND" to true
# 2) Built from source with the build_dawn.sh script. This is for all other systems (non-Ubuntu, macOS, etc.)
# If this is the case libwebgpu_dawn.* will be found in deps/dawn/out/Release and "dawn_FOUND" will be set to true

find_package(dawn QUIET)
if (dawn_FOUND)
message(STATUS "Using Dawn system install")
Expand Down Expand Up @@ -43,6 +49,7 @@ find_package(OpenCV REQUIRED)
find_package(ZED QUIET)
find_package(Eigen3 REQUIRED)

# Same idea as dawn, ideally installed via a package, but if not then build from source
find_package(manif QUIET)
if (NOT manif_FOUND)
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/../deps/manif/include/manif)
Expand All @@ -55,8 +62,12 @@ if (NOT manif_FOUND)
endif ()
endif ()

# These are old packages so they do not support "find_package" and must be found with pkg-config
# Thankfully CMake has a built-in module for this
find_package(PkgConfig REQUIRED)
pkg_search_module(NetLink libnl-3.0 QUIET)
pkg_search_module(NetLinkRoute libnl-route-3.0 QUIET)
pkg_search_module(Gst gstreamer-1.0 QUIET)
pkg_search_module(GstApp gstreamer-app-1.0 QUIET)
pkg_search_module(LibUsb libusb-1.0 QUIET)
pkg_search_module(LibUdev libudev QUIET)
Loading

0 comments on commit e2db1de

Please sign in to comment.