-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17bef5b
commit 642265e
Showing
10 changed files
with
351 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"git.ignoreLimitWarning": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@echo off | ||
SETLOCAL | ||
:: ********************************************************** | ||
:: 2024 : Arthur JEULIN | ||
:: Copyright (c) Coast Autonomous | ||
:: Created by Arthur JEULIN on 07/03/2024. | ||
:: ********************************************************** | ||
:: | ||
:: Module : Install VCPKG Folder for Windows User | ||
:: | ||
|
||
:: to run this script on windows | ||
:: open powershell and run: | ||
:: ./install_vcpkg.bat | ||
:: | ||
:: Définition du répertoire d'installation de vcpkg | ||
set VCPKG_DIR=%~dp0vcpkg | ||
|
||
:: Clonage de vcpkg | ||
echo Clonage de vcpkg... | ||
git clone https://github.com/microsoft/vcpkg.git "%VCPKG_DIR%" | ||
if %errorlevel% neq 0 ( | ||
echo Échec du clonage de vcpkg. | ||
exit /b 1 | ||
) | ||
|
||
:: Exécution de bootstrap-vcpkg.bat | ||
echo Execution of bootstrap-vcpkg.bat... | ||
cd /d "%VCPKG_DIR%" | ||
call bootstrap-vcpkg.bat | ||
if %errorlevel% neq 0 ( | ||
echo Fail to intialize vcpkg. | ||
exit /b 1 | ||
) | ||
|
||
echo vcpkg has been install and initiate with success. | ||
ENDLOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /bin/bash | ||
# ********************************************************** | ||
# 2024 : Arthur JEULIN | ||
# Copyright (c) Coast Autonomous | ||
# Created by Arthur JEULIN on 07/02/2024. | ||
# ********************************************************** | ||
# | ||
# Module : Install VCPKG Folder for Linux User | ||
# | ||
|
||
# to run this script on windows | ||
# open wsl terminal and go to cd /mnt/c/dev/rtmaps/inventory | ||
# ./install_vcpkg.sh | ||
# | ||
# CAUTION: THE FILE HAS TO BE LF AND NOTE CRLF | ||
# | ||
|
||
|
||
git clone https://github.com/microsoft/vcpkg.git | ||
cd vcpkg | ||
./bootstrap-vcpkg.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# ********************************************************** | ||
# 2024 : Arthur JEULIN | ||
# Copyright (c) Coast Autonomous | ||
# Created by Arthur JEULIN on 05/05/2024. | ||
# ********************************************************** | ||
cmake_minimum_required(VERSION 3.27.5) | ||
|
||
|
||
# RTMaps Package Name | ||
set(PCK pck) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY C:/dev/rtmaps/user_sdk/packages/${PCK}) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(POSITION_INDEPENDENT_CODE ON) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) # Enforce the C++ standard requirement | ||
set(CMAKE_CXX_EXTENSIONS OFF) # Non-portable compiler-specific extensions are NOT required | ||
|
||
if(UNIX) | ||
set(RTMAPS_SDKDIR "/opt/rtmaps") | ||
endif() | ||
if(WIN32) | ||
set(RTMAPS_SDKDIR "C:/Program Files/Intempora/RTMaps 4") | ||
set(rtmaps_input_reader "C:/Program Files/Intempora/RTMaps 4/packages/rtmaps_input_reader") | ||
endif() | ||
|
||
|
||
project("${PCK}.u" | ||
VERSION 0.0.1 | ||
DESCRIPTION "pck RTMaps package" | ||
LANGUAGES C CXX | ||
) | ||
|
||
|
||
# If -D"RTMAPS_SDKDIR=<RTMaps Install Dir>" has NOT been passed to | ||
# the "cmake" command | ||
if (NOT DEFINED RTMAPS_SDKDIR) | ||
# Try to use the default RTMaps installation | ||
if (DEFINED ENV{RTMAPS_SDKDIR}) | ||
set(RTMAPS_SDKDIR "$ENV{RTMAPS_SDKDIR}" | ||
CACHE PATH "Path the RTMaps installation directory") | ||
else() | ||
message(FATAL_ERROR | ||
"RTMAPS_SDKDIR not defined. Either pass -D/"RTMAPS_SDKDIR=.../" | ||
to CMake or define an RTMAPS_SDKDIR environment variable") | ||
endif() | ||
endif() | ||
|
||
if (NOT TARGET rtmaps_input_reader) | ||
# In this particular example, we know the path of of the rtmaps_input_readerConfig.cmake file. | ||
# In your custom components, you might want to use something like: | ||
set(rtmaps_input_reader_DIR "${RTMAPS_SDKDIR}/packages/rtmaps_input_reader/lib/cmake/rtmaps_input_reader" CACHE PATH "") | ||
if (NOT rtmaps_input_reader_DIR) | ||
get_filename_component(rtmaps_input_reader_DIR "${CMAKE_CURRENT_LIST_DIR}/../lib/cmake/rtmaps_input_reader" ABSOLUTE CACHE) | ||
endif() | ||
find_package(rtmaps_input_reader CONFIG REQUIRED NO_DEFAULT_PATH) | ||
endif() | ||
|
||
|
||
|
||
# REQUIRED: Include the RTMaps CMake configuration file | ||
include("${RTMAPS_SDKDIR}/templates.u/rtmaps.cmake") | ||
|
||
|
||
add_rtmaps_package(${PCK} PCKINFO "${PCK}.pckinfo" | ||
# add sources, headers and/or directories | ||
"local_interfaces" | ||
"src" | ||
) | ||
|
||
|
||
target_include_directories(${PCK} PRIVATE | ||
${PROJECT_SOURCE_DIR}/rtmaps/local_interfaces | ||
) | ||
|
||
# HIGHLY RECOMMENDED: Append useful compiler flags | ||
if (MSVC) | ||
# Winmm.lib Needed in Windows to Gettime (API of Windows) | ||
target_link_libraries(${PCK} | ||
Winmm.lib | ||
kernel32.lib | ||
rtmaps_input_reader | ||
) | ||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
# NE BUILD PAS EN DEBUG AVEC RTMAPS | ||
# Options pour le mode Debug | ||
# Ne peut pas utiliser se flag pour une raison que j'igonre /MPd | ||
# rtmaps_pck.lib est compiler en release donc on ne peut pas utliser | ||
# certains flags de debug car non compatible => rechercher a faire | ||
target_compile_options(${PCK} PRIVATE /W3 /WX /MD ) | ||
elseif(CMAKE_BUILD_TYPE STREQUAL "Release") | ||
# Options pour le mode Release | ||
target_compile_options(${PCK} PRIVATE /MD /MP /GL /W3 /WX -DNDEBUG) | ||
endif() | ||
# TO IMPROVE IN THE FUTURE | ||
# Trouver un moyen de ne pas à copier manuellement le nom des dll | ||
# Attention *.dll ne fonctionne pas sur windows | ||
# add_custom_command(TARGET ${PCK} POST_BUILD | ||
# # Create the bin folder next to the pck | ||
# COMMAND ${CMAKE_COMMAND} -E make_directory C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/bin | ||
# # Copy the dll in the bin folder | ||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
# C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/gflags.dll | ||
# C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/glog.dll | ||
# # Destination | ||
# C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/bin | ||
|
||
|
||
# # Delete the dll the where in the same folder as CMAKE_RUNTIME_OUTPUT_DIRECTORY | ||
# COMMAND ${CMAKE_COMMAND} -E remove | ||
# C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/gflags.dll | ||
# C:/dev/rtmaps/user_sdk/packages/${PCK}/$<CONFIG>/glog.dll | ||
# VERBATIM | ||
# ) | ||
|
||
else() | ||
# LINUX | ||
target_link_libraries(${PCK}) | ||
target_compile_options(${PCK} PRIVATE | ||
-Wall -Wextra -Wpedantic -finline-functions -fexceptions | ||
-O3 -fdiagnostics-show-option -pedantic) | ||
endif() | ||
|
||
|
||
if(WIN32) | ||
install(TARGETS ${PCK} | ||
CONFIGURATIONS Release | ||
RUNTIME DESTINATION ${RTMAPS_SDKDIR}/user_sdk/packages/${PCK} | ||
) | ||
# this copies more than strictly necessary but I don't know how to do it better | ||
install(DIRECTORY | ||
"C:/dev/rtmaps/user_sdk/packages/${PCK}/Release/bin" | ||
# Destination (pas besoin d'ajouter bin dans le chemin on copie le dossier bin) | ||
DESTINATION ${RTMAPS_SDKDIR}/user_sdk/packages/${PCK} | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ********************************************************** | ||
// 2024 : Arthur JEULIN | ||
// Copyright (c) Coast Autonomous | ||
// Created by Arthur JEULIN on 07/05/2024. | ||
// ********************************************************** | ||
// | ||
// Module : To be define | ||
// | ||
|
||
#if defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
# pragma once | ||
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | ||
|
||
#ifndef MAPS_TEMPLATE_H | ||
#define MAPS_TEMPLATE_H | ||
|
||
//#define __IPL_H__ | ||
#include <maps.hpp> | ||
// Includes the MAPS::InputReader class and its dependencies | ||
#include <maps/input_reader/maps_input_reader.hpp> | ||
|
||
// Declares a new MAPSComponent child class | ||
class MAPS_TEMPLATE : public MAPSComponent | ||
{ | ||
// Use standard header definition macro | ||
MAPS_COMPONENT_STANDARD_HEADER_CODE(MAPS_TEMPLATE) | ||
|
||
|
||
private : | ||
// Declare an input reader | ||
std::unique_ptr<MAPS::InputReader> _inputReader; | ||
|
||
int _log_destination; | ||
|
||
/** | ||
* IL faut toujours MAPSTimestamp ts en premier argument de la callback. | ||
* Sinon erreur de compilation | ||
*/ | ||
void ProcessData(MAPSTimestamp ts, const MAPS::InputElt<double> input); | ||
}; | ||
|
||
#endif /*MAPS_TEMPLATE_H*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Package information | ||
VERSION=0.0.1 | ||
DESCRIPTION=User package | ||
|
||
# LOG | ||
# 0.0.1: initial development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// ********************************************************** | ||
// 2024 : Arthur JEULIN | ||
// Copyright (c) Coast Autonomous | ||
// Created by Arthur JEULIN on 07/05/2024. | ||
// ********************************************************** | ||
// | ||
// Module : To be define | ||
// | ||
|
||
#include "maps_template.h" // Includes the header of this component | ||
|
||
// Use the macros to declare the inputs | ||
MAPS_BEGIN_INPUTS_DEFINITION(MAPS_TEMPLATE) | ||
MAPS_INPUT("Input", MAPS::FilterFloat64,MAPS::FifoReader) | ||
MAPS_END_INPUTS_DEFINITION | ||
|
||
// Use the macros to declare the outputs | ||
MAPS_BEGIN_OUTPUTS_DEFINITION(MAPS_TEMPLATE) | ||
MAPS_OUTPUT("Output", MAPS::Float64, NULL,NULL,1) | ||
MAPS_END_OUTPUTS_DEFINITION | ||
|
||
// Use the macros to declare the properties | ||
MAPS_BEGIN_PROPERTIES_DEFINITION(MAPS_TEMPLATE) | ||
MAPS_PROPERTY_ENUM("LogDestination", "Log|Console",0, false, false) | ||
MAPS_PROPERTY("LoggingPath", "C:/dev/log", false, false) | ||
MAPS_END_PROPERTIES_DEFINITION | ||
|
||
// Use the macros to declare the actions | ||
MAPS_BEGIN_ACTIONS_DEFINITION(MAPS_TEMPLATE) | ||
MAPS_END_ACTIONS_DEFINITION | ||
|
||
|
||
// Use the macros to declare this component (SaveRFID) behaviour | ||
MAPS_COMPONENT_DEFINITION(MAPS_TEMPLATE,"save_rfid","1.0",128, | ||
MAPS::Threaded,MAPS::Threaded, | ||
-1, // Nb of inputs. Leave -1 to use the number of declared input definitions | ||
-1, // Nb of outputs. Leave -1 to use the number of declared output definitions | ||
-1, // Nb of properties. Leave -1 to use the number of declared property definitions | ||
-1) // Nb of actions. Leave -1 to use the number of declared action definitions | ||
|
||
//Initialization: Birth() will be called once at diagram execution startup. | ||
void MAPS_TEMPLATE::Birth() | ||
{ | ||
|
||
_inputReader = MAPS::MakeInputReader::Triggered( | ||
this, | ||
// The input reader will first wait for data on this input | ||
Input("Input"), | ||
|
||
// TriggerKind::DataInput means that we want to access the "value" of the data of the trigger input in the callback. | ||
// In this case, the trigger input MUST be added to the list of data inputs (see the next argument) | ||
MAPS::InputReaderOption::Triggered::TriggerKind::DataInput, | ||
// SamplingBehavior::WaitForAllInputs means that the data callback will be called | ||
// only if there are data samples on all inputs | ||
MAPS::InputReaderOption::Triggered::SamplingBehavior::WaitForAllInputs, | ||
|
||
MAPS::MakeArray(&Input("Input")), | ||
|
||
// This callback will be called when data was read from the trigger AND the data inputs. | ||
&MAPS_TEMPLATE::ProcessData | ||
); | ||
|
||
} | ||
|
||
|
||
void MAPS_TEMPLATE::Core() | ||
{ | ||
_inputReader->Read(); | ||
} | ||
|
||
void MAPS_TEMPLATE::Death() | ||
{ | ||
_inputReader.reset(); | ||
} | ||
|
||
void MAPS_TEMPLATE::ProcessData(MAPSTimestamp ts, const MAPS::InputElt<double> input) | ||
{ | ||
|
||
MAPS::OutputGuard<double> outGuard{this, Output("oRFID")}; | ||
outGuard.Data() = input.Data() * 2; | ||
// As always, set the VectorSize and the Timestamp | ||
outGuard.VectorSize() = 1; | ||
// outGuard.VectorSize() = (MAPSInt32)output_string.size(); | ||
outGuard.Timestamp() = MAPS::CurrentTime(); | ||
} |
Oops, something went wrong.