Skip to content

Commit

Permalink
Add can bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed Jun 11, 2024
1 parent aab3437 commit c06052d
Show file tree
Hide file tree
Showing 22 changed files with 4,842 additions and 24 deletions.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(mrover VERSION 2025.0.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra -Wpedantic -Wno-missing-field-initializers)
endif ()

## Dependencies
Expand Down Expand Up @@ -32,9 +32,14 @@ find_package(TBB REQUIRED)
find_package(manif QUIET)
find_package(dawn QUIET)

find_package(PkgConfig REQUIRED)
pkg_search_module(NetLink libnl-3.0 QUIET)
pkg_search_module(NetLinkRoute libnl-route-3.0 QUIET)

add_subdirectory(deps/imgui EXCLUDE_FROM_ALL SYSTEM)
add_subdirectory(deps/webgpuhpp EXCLUDE_FROM_ALL SYSTEM)
add_subdirectory(deps/glfw3webgpu EXCLUDE_FROM_ALL SYSTEM)
add_subdirectory(deps/mjbots EXCLUDE_FROM_ALL SYSTEM)

if (BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
Expand Down Expand Up @@ -108,6 +113,14 @@ target_link_libraries(arm_controller lie)
ament_target_dependencies(arm_controller rclcpp)
rosidl_target_interfaces(arm_controller ${PROJECT_NAME} rosidl_typesupport_cpp)

if (NetLink_FOUND AND NetLinkRoute_FOUND)
mrover_add_node(can_bridge esw/can_bridge/*.cpp esw/can_bridge/pch.hpp)
target_link_libraries(can_bridge ${NetLink_LIBRARIES} ${NetLinkRoute_LIBRARIES})
target_include_directories(can_bridge PRIVATE ${NetLink_INCLUDE_DIRS} ${NetLinkRoute_INCLUDE_DIRS})
ament_target_dependencies(can_bridge rclcpp)
rosidl_target_interfaces(can_bridge ${PROJECT_NAME} rosidl_typesupport_cpp)
endif ()

## Install

install(PROGRAMS
Expand Down
5 changes: 5 additions & 0 deletions deps/mjbots/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(moteus VERSION 2024.5.20 LANGUAGES CXX)

add_library(moteus INTERFACE)
target_include_directories(moteus INTERFACE ${CMAKE_CURRENT_LIST_DIR})
5 changes: 5 additions & 0 deletions deps/mjbots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Moteus Library

This is the official mjbots moteus library obtained from: https://github.com/mjbots/moteus

Everything except the C++ library has been stripped
Loading

0 comments on commit c06052d

Please sign in to comment.