Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
Refactor Repo into a ROS Package (#15)
Browse files Browse the repository at this point in the history
* Create new ros package and execute Hello World

* added gitignore to keep colcon build files out of repo

* change gitignore to files
  • Loading branch information
samdai01 authored Jan 8, 2024
1 parent ecb7eaf commit d0e7f88
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 153 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
out/
diagnostics
build/
install/
log/
29 changes: 19 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# Top level CMake file for entire Diagnostics app

# Set CMake version and create project
cmake_minimum_required(VERSION 3.22)
cmake_minimum_required(VERSION 3.8)
project(diagnostics)

# Set C++ Standard
set(CMAKE_CXX_STANDARD 20)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Import rapidYaml
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ryml REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)

add_executable(diagnostics src/main/diagnostics.cpp)
target_include_directories(diagnostics PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(diagnostics PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17

install(TARGETS diagnostics
DESTINATION lib/${PROJECT_NAME})

# Add source files
add_subdirectory(config)
add_subdirectory(src)
ament_package()
14 changes: 0 additions & 14 deletions build.sh

This file was deleted.

4 changes: 0 additions & 4 deletions config/CMakeLists.txt

This file was deleted.

11 changes: 0 additions & 11 deletions config/yaml/sampleTest.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>diagnostics</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="[email protected]">ros</maintainer>
<license>TODO: License declaration</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
3 changes: 0 additions & 3 deletions src/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
# Add main.exe
add_executable(diagnostics main.cpp)

# List of required header files
target_include_directories(diagnostics PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

# Modules that main depends on
# ex: target_link_libraries(SailbotDiagnostics_main PRIVATE module1 module2)
target_link_libraries(diagnostics PRIVATE
yaml
ryml::ryml
)

# Import configuration file
target_compile_definitions(
diagnostics PUBLIC YAML_TEST_PATH="${YAML_TEST_PATH}"
)
10 changes: 10 additions & 0 deletions src/main/diagnostics.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <cstdio>

int main(int argc, char ** argv)
{
(void)argc;
(void)argv;

printf("Welcome to UBC Sailbot diagnostics!\n");
return 0;
}
34 changes: 0 additions & 34 deletions src/main/main.cpp

This file was deleted.

19 changes: 0 additions & 19 deletions src/yaml/CMakeLists.txt

This file was deleted.

29 changes: 0 additions & 29 deletions src/yaml/parse_yaml.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions src/yaml/parse_yaml.h

This file was deleted.

0 comments on commit d0e7f88

Please sign in to comment.