Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fc4f31a
feat: changes for am_super so far
ajanani85 Dec 20, 2022
3190e1d
feat: super_lib is complete
ajanani85 Dec 20, 2022
b59b304
feat: am_super sofar
ajanani85 Dec 21, 2022
3976ff9
feat: am_super compiles fine
ajanani85 Dec 22, 2022
e14b79f
feat: CMAKE policy
ajanani85 Dec 23, 2022
00d8106
danhennage Jan 3, 2023
de4bc7d
fix: LOG_MSG and undefined reference to am::Node
ajanani85 Jan 9, 2023
c802aaf
attempted to complete port of am_super
edkoch Jan 18, 2023
3ae783a
feat: lifecycle inherits from node
danhennage Jan 24, 2023
ce8dca8
feat: convert am::Node to am::AMLifeCycle
danhennage Jan 24, 2023
dc4f461
fix: changed scope of life_cycle_mediator_
danhennage Jan 30, 2023
cc5d4ec
Merge branch 'GV-503/life_cycle_node' into ros2
danhennage Jan 30, 2023
062edf6
feat: redefine ros_info_stream in am_super to print blue
ianfmx Jun 8, 2023
55f5aa0
feat: add am_ll2f to manifest, print when super configures self
ianfmx Jun 9, 2023
13db054
Merge pull request #159 from AutoModality/GV-948-colorize-system-stat…
danhennage Jun 9, 2023
bfc066b
add am_mavros_bs to manifest
ianfmx Jun 13, 2023
f1077d3
change manifest to include am_gps instead of ll2f
ianfmx Jun 15, 2023
d8b93f5
Merge pull request #160 from AutoModality/GV-959/GPS-BL
ianfmx Jun 15, 2023
1ab20a2
feat: config and cleanup
FarmXDev Mar 2, 2024
e051313
fix: treat BOOTING special
FarmXDev Mar 31, 2024
c153da5
fix: removed comment
FarmXDev Apr 2, 2024
c132cac
feat: AMStatStatus
danhennage Jul 31, 2024
a433cc7
fix: added time to msg header
danhennage Aug 1, 2024
2d8849a
Merge pull request #162 from AutoModality/GV-893
ajanani85 Aug 9, 2024
5e5197c
Investigating am_super functionality
ajanani85 Sep 16, 2024
7dc49e4
feat: wholesale changes to get super working with health monitoring a…
HardikSingh97 Sep 21, 2024
d1d6b3a
tweak: make sure am_super also goes inactive
HardikSingh97 Sep 25, 2024
2098684
tweak: in field changes allowed to improve demo
HardikSingh97 Sep 30, 2024
c9d3dc6
Merge pull request #163 from AutoModality/GV-3524-am-super-improvemen…
ajanani85 Oct 2, 2024
a35244a
feat: close to work with new state machine
HardikSingh97 Oct 8, 2024
bdcc697
Final super changes before autostart image
HardikSingh97 Oct 12, 2024
ae0ac61
feat: update
ajanani85 Nov 25, 2024
48919bb
feat: renamed
ajanani85 Nov 25, 2024
d1357e2
feat: update
ajanani85 Nov 25, 2024
119118a
feat: update
ajanani85 Nov 25, 2024
fcd1a62
feat: udpate
ajanani85 Nov 25, 2024
10efa3c
feat: code refactored
ajanani85 Nov 26, 2024
d19ee87
feat: update
ajanani85 Nov 26, 2024
8e06d57
feat: ip checks
ajanani85 Dec 5, 2024
42d5c3a
feat: update
ajanani85 Dec 5, 2024
3520e7c
feat: update
ajanani85 Dec 5, 2024
cbf706a
feat: update
ajanani85 Dec 5, 2024
4e8d59c
feat: update
ajanani85 Dec 6, 2024
c5a8c2b
feat: update
ajanani85 Dec 6, 2024
af0fa9b
feat: update
ajanani85 Dec 6, 2024
bdbfa04
feat: update
ajanani85 Dec 6, 2024
282fcb7
feat: update
ajanani85 Dec 6, 2024
51ded38
feat: using the old ping method with better options
ajanani85 Dec 6, 2024
6e43738
feat: less trace
ajanani85 Dec 6, 2024
d4c1187
Merge pull request #164 from AutoModality/hardik/john-deere-integration
ajanani85 Dec 24, 2024
c0836a8
Merge pull request #165 from AutoModality/GV-3569/system-info
ajanani85 Dec 24, 2024
742cb8d
Create LICENSE
shpydah Mar 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 74 additions & 214 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,118 +1,42 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(am_super)

## Compile as C++11, supported in ROS melodic and newer
add_compile_options(-std=c++17)
set(CMAKE_BUILD_TYPE Debug)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED
am_utils
diagnostic_msgs
rosbag
roscpp
rospy
std_msgs
std_srvs
am_rostest
)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

#find_package(CUDA)

#if(CUDA_FOUND)
# add_definitions(-DCUDA_FLAG)
# message([STATUS] "CUDA FOUND, am_super will be built with GPU monitoring")
# SET(CUDA_NVCC_FLAGS "-arch=sm_62" CACHE STRING "nvcc flags" FORCE)
# SET(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE)
# CUDA_ADD_LIBRARY(cuda_utility ${LIB_TYPE} src/cuda/cuda_utility.cu)
#endif(CUDA_FOUND)


## System dependencies are found with CMake's conventions


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES super_lib
CATKIN_DEPENDS
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

set(dependencies
am_utils
diagnostic_msgs
rosbag
roscpp
rospy
brain_box_msgs
builtin_interfaces
rclcpp
rclpy
rosbag2
rosbag2_cpp
std_msgs
std_srvs
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
)
# find dependencies
find_package(ament_cmake REQUIRED)

foreach(Dependency IN ITEMS ${dependencies})
find_package(${Dependency} REQUIRED)
endforeach()

file(GLOB super_lib_cpp_files
src/super_lib/*.cpp
include_directories(
include
)

file(GLOB cuda_cpp_files
Expand All @@ -127,119 +51,55 @@ file(GLOB SUPER_MEDIATOR_FILES
src/am_super/*_mediator.cpp
)

## Declare a C++ library
add_library(super_lib
${super_lib_cpp_files}
)
target_link_libraries(super_lib ${catkin_LIBRARIES})
add_dependencies(super_lib ${catkin_EXPORTED_TARGETS})
add_executable(am_super ${am_super_cpp_files})
target_link_libraries(am_super)
ament_target_dependencies(am_super ${dependencies})

#if(CUDA_FOUND)
# add_executable(am_super ${am_super_cpp_files} ${cuda_cpp_files} )
# target_link_libraries(am_super ${catkin_LIBRARIES} super_lib cuda_utility)
#else()
# add_executable(am_super ${am_super_cpp_files})
# target_link_libraries(am_super ${catkin_LIBRARIES} super_lib)
#endif(CUDA_FOUND)
add_executable(resource_monitor src/resource_monitor/resource_status_class.cpp
src/resource_monitor/resource_monitor_main.cpp
src/resource_monitor/resource_monitor_node.cpp)
ament_target_dependencies(resource_monitor ${dependencies})

add_executable(am_super ${am_super_cpp_files})
target_link_libraries(am_super ${catkin_LIBRARIES} super_lib)
add_dependencies(am_super ${catkin_EXPORTED_TARGETS})

#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# Mark libraries for installation
# See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
install(TARGETS super_lib
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

#Mark cpp header files for installation
install(DIRECTORY include/super_lib
DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING AND ENABLE_COVERAGE_TESTING)
find_package(code_coverage REQUIRED)
# Add compiler flags for coverage instrumentation before defining any targets
APPEND_COVERAGE_COMPILER_FLAGS()
endif()
install(DIRECTORY include/
DESTINATION include/
)

install(TARGETS
am_super
resource_monitor
DESTINATION lib/${PROJECT_NAME}
)

file(GLOB TEST_FILES
test/*_tests.cpp
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(ament_lint_auto REQUIRED)
find_package(ros_testing REQUIRED)

# the following lines skip linters
set(ament_cmake_cppcheck_FOUND TRUE)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
set(ament_cmake_flake8_FOUND TRUE)
set(ament_cmake_uncrustify_FOUND TRUE)
ament_lint_auto_find_test_dependencies()

# Run all lint tests in package.xml except those listed above
ament_lint_auto_find_test_dependencies()

# code coverage setup: https://github.com/mikeferguson/code_coverage
if (CATKIN_ENABLE_TESTING)

## Add gtest based cpp test target and link libraries

catkin_add_gtest(${PROJECT_NAME}_test ${TEST_FILES} ${SUPER_MEDIATOR_FILES})

if(TARGET ${PROJECT_NAME}_test)
target_link_libraries(${PROJECT_NAME}_test ${catkin_LIBRARIES} super_lib)
endif()

# For ros testing
find_package(rostest REQUIRED)

#follow test naming convention of files in a folder and the cpp and launch have the test name with _rostest
set(TEST_NAMES abort_to_disarming
abort_to_manual
armed_to_ready
auto_to_abort
auto_to_manual
auto_to_semiauto
error_configure_tolerance
error_forced
error_status
error_status_without_stats
error_terminal_before_config
error_tolerant_before_config
hz_config
manual_to_disarming
param
platform_app_required_fail
platform_app_required_pass
platform_required_fail
platform_required_pass
primary
ready_to_shutdown
semi_auto_to_manual
ament_add_gtest_executable(abort_to_disarming
super_test/abort_to_disarming/abort_to_disarming_rostest.cpp
)
foreach(TEST_NAME ${TEST_NAMES})
set(PROJECT_TEST_NAME ${TEST_NAME}_${PROJECT_NAME}_rostest)
add_rostest_gtest(${PROJECT_TEST_NAME} rostest/${TEST_NAME}/${TEST_NAME}_rostest.test rostest/${TEST_NAME}/${TEST_NAME}_rostest.cpp)
target_link_libraries(${PROJECT_TEST_NAME} ${catkin_LIBRARIES} super_lib)
endforeach()
endif()

target_link_libraries(abort_to_disarming)
ament_target_dependencies(abort_to_disarming ${dependencies})
add_ros_test(super_test/abort_to_disarming/launch/abort_to_disarming.test.py TIMEOUT 120 ARGS "test_binary_dir:=${CMAKE_CURRENT_BINARY_DIR}")
endif()

ament_export_include_directories(include)
ament_export_dependencies(${dependencies})
ament_package()
Loading
Loading