From 3ee01ccb51288fbf0b9184972119d841eb8f3233 Mon Sep 17 00:00:00 2001 From: Minh Nguyen Date: Sat, 4 Jul 2020 00:25:16 +0200 Subject: [PATCH] create executable targets, update README * create executable targets for all cpp file under executables directory * move control_kinova to executables dir * explain where ABAG implementation comes from --- CMakeLists.txt | 23 +++++++++++++++---- README.md | 5 +++- .../control_kinova_pos.cpp | 0 3 files changed, 22 insertions(+), 6 deletions(-) rename src/control_kinova.cpp => executables/control_kinova_pos.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60420f3..faee34c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,11 @@ include_directories( ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/generated ) + +list(APPEND control_kinova_SOURCES + ${PROJECT_SOURCE_DIR}/generated/abag.c + ${PROJECT_SOURCE_DIR}/src/kinova_util.cpp +) set_source_files_properties(generated/abag.c PROPERTIES LANGUAGE CXX) link_libraries( @@ -58,8 +63,16 @@ link_libraries( pthread ) -add_executable(control_kinova - src/control_kinova.cpp - src/kinova_util.cpp - generated/abag.c -) +# find all CPP files in the ./executables directory and create a executable target +# for each of them +file(GLOB EXE_LIST RELATIVE ${PROJECT_SOURCE_DIR} "executables/*.cpp") +foreach ( SRC_FILE ${EXE_LIST} ) + MESSAGE(${SRC_FILE}) + string(REPLACE ".cpp" "" TARGET_EXE_NAME ${SRC_FILE}) + string(REPLACE "executables/" "" TARGET_EXE_NAME ${TARGET_EXE_NAME}) + + MESSAGE("creating TARGET_EXE_NAME: '${TARGET_EXE_NAME}'") + + add_executable(${TARGET_EXE_NAME} ${SRC_FILE} ${control_kinova_SOURCES}) + +endforeach() diff --git a/README.md b/README.md index 02349bf..71af406 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # kinova_control_experiments Simple impedance controller for Kinova Gen 3 arm which was tested on a real robot. This requries ROS to work because of -`kdl_parser` for URDF files. +`kdl_parser` for URDF files. The ABAG implementation is generated using Domain-Specific languages realized in +[Jetbrains MPS](https://www.jetbrains.com/mps/), which can be found at the +[`rosym-project/controller-dsl`](https://github.com/rosym-project/controller-dsl) and +[`rosym-project/algorithm-dsl`](https://github.com/rosym-project/algorithm-dsl) repositories. ## Contents diff --git a/src/control_kinova.cpp b/executables/control_kinova_pos.cpp similarity index 100% rename from src/control_kinova.cpp rename to executables/control_kinova_pos.cpp