diff --git a/src/custom_interfaces/CMakeLists.txt b/src/custom_interfaces/CMakeLists.txt deleted file mode 100644 index fc551d6..0000000 --- a/src/custom_interfaces/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(custom_interfaces) - -# Default to C99 -if(NOT CMAKE_C_STANDARD) - set(CMAKE_C_STANDARD 99) -endif() - -# Default to C++14 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(std_msgs REQUIRED) -find_package(builtin_interfaces REQUIRED) - - - - - - -# --> -# ADD THESE LINES: START HERE - -find_package(rosidl_default_generators REQUIRED) -find_package(rclcpp REQUIRED) - -# CUSTOM LINES: CHANGE FOR YOUR FILENAMES -rosidl_generate_interfaces(${PROJECT_NAME} - "msg/CustomMsg1.msg" - "msg/CustomMsg2.msg" - "srv/CustomSrv1.srv" - "srv/StateMachineSrv.srv" - DEPENDENCIES builtin_interfaces - ) - -# END HERE -# <-- - - - - - - - - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # uncomment the line when a copyright and license is not present in all source files - #set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # uncomment the line when this package is not in a git repo - #set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/src/custom_interfaces/Readme.md b/src/custom_interfaces/Readme.md deleted file mode 100644 index 2e8883f..0000000 --- a/src/custom_interfaces/Readme.md +++ /dev/null @@ -1,40 +0,0 @@ -Use this ROS2 package to create custom interfaces, eg. topic (*.msg) and/or service (*.srv) files. -This package must only be used for interface files and __no__ Python scripts. - -The following steps describe how to create a new custom topic or service. - -## 1. Create new interface file -Topic *.msg files got into `msg` directory, -Service *.srv files got into `srv` directory. - -Create these files according to the example on this [instructions page](https://docs.ros.org/en/foxy/Tutorials/Writing-A-Simple-Py-Service-And-Client.html). - -## 2. CMakeLists.txt -Edit the `CMakeLists.txt` file by adding the newly created *.msg or *.srv files to this part: -```cmake -rosidl_generate_interfaces(${PROJECT_NAME} - "msg/CustomMsg1.msg" - "msg/CustomMsg2.msg" - "srv/CustomSrv1.srv" - DEPENDENCIES builtin_interfaces - ) -``` - -## 3. Build colcon workspace -Move back to the root of your _colcon_ workspace and rebuild it: `colcon build --symlink-install` -It should build without any errors. If you encounter errors fix these before continuing. - -After a successful build you must __close and reopen all terminals__ in order to source the newly built workspace. For this to happen you must have edited _.bashrc_ and added your current workspace (`sudo nano ~/.bashrc` and follow [this example](https://egit.irs.uni-stuttgart.de/RoverLehre/ROS2_pubsub/src/branch/master/non-ros-files/bashrc_overlay.bash)). - -## 4. Import interfaces -Import the newly created interfaces into the Python scripts. These scripts must be located in _Python packages_ inside the same workspace (or another _sourced_ workspace): -* Topics: -```python -from custom_interfaces.msg import CustomMsg1 -``` - -* Services: -```python -from custom_interfaces.srv import CustomSrv1 -``` -Now you can work with your custom interface in order to exchange custom information between nodes. diff --git a/src/custom_interfaces/msg/CustomMsg1.msg b/src/custom_interfaces/msg/CustomMsg1.msg deleted file mode 100644 index 66a846b..0000000 --- a/src/custom_interfaces/msg/CustomMsg1.msg +++ /dev/null @@ -1,8 +0,0 @@ -# Header data, eg timestamp -# Problem: "header__struct.hpp: No such file or directory" -#Header header - -# Sensor Data coming back from an array of atmospheric sensors -float32[] temperature -float32[] pressure -float32[] humidity diff --git a/src/custom_interfaces/msg/CustomMsg2.msg b/src/custom_interfaces/msg/CustomMsg2.msg deleted file mode 100644 index 2e9603d..0000000 --- a/src/custom_interfaces/msg/CustomMsg2.msg +++ /dev/null @@ -1,7 +0,0 @@ -# Header data, eg timestamp -# Problem: "header__struct.hpp: No such file or directory" -#Header header - -# User inputs, eg. for controlling a camera mast , eg. set angles [rad] -float32 pitch_ctrl -float32 yaw_ctrl diff --git a/src/custom_interfaces/package.xml b/src/custom_interfaces/package.xml deleted file mode 100644 index 8c22c2a..0000000 --- a/src/custom_interfaces/package.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - custom_interfaces - 0.0.0 - TODO: Package description - rosmobile - TODO: License declaration - - ament_cmake - ament_lint_auto - ament_lint_common - - - - - - builtin_interfaces - rosidl_default_generators - - builtin_interfaces - rosidl_default_runtime - - rosidl_interface_packages - - - - - - - - std_msgs - - - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/src/custom_interfaces/srv/CustomSrv1.srv b/src/custom_interfaces/srv/CustomSrv1.srv deleted file mode 100644 index 2a0fa0e..0000000 --- a/src/custom_interfaces/srv/CustomSrv1.srv +++ /dev/null @@ -1,3 +0,0 @@ -string command ---- -bool success diff --git a/src/custom_interfaces/srv/StateMachineSrv.srv b/src/custom_interfaces/srv/StateMachineSrv.srv deleted file mode 100644 index 608f8b5..0000000 --- a/src/custom_interfaces/srv/StateMachineSrv.srv +++ /dev/null @@ -1,4 +0,0 @@ -string command -float32 value ---- -bool success diff --git a/src/pubsub/package.xml b/src/pubsub/package.xml index 1d20916..5ff1f3a 100644 --- a/src/pubsub/package.xml +++ b/src/pubsub/package.xml @@ -15,7 +15,8 @@ - pubsub_msg + + custom_interfaces diff --git a/src/pubsub_msg/CMakeLists.txt b/src/pubsub_msg/CMakeLists.txt deleted file mode 100644 index 583a2cd..0000000 --- a/src/pubsub_msg/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(pubsub_msg) - -# Default to C99 -if(NOT CMAKE_C_STANDARD) - set(CMAKE_C_STANDARD 99) -endif() - -# Default to C++14 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 14) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - - - - -# --> -# ADD THESE LINES: START HERE - -find_package(builtin_interfaces REQUIRED) -find_package(rosidl_default_generators REQUIRED) -find_package(std_msgs REQUIRED) -find_package(rclcpp REQUIRED) - -# CUSTOM LINES: CHANGE FOR YOUR FILENAMES -rosidl_generate_interfaces(${PROJECT_NAME} - "msg/CustomMsg1.msg" - "msg/CustomMsg2.msg" - DEPENDENCIES builtin_interfaces - ) - -# END HERE -# <-- - - - - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # uncomment the line when a copyright and license is not present in all source files - #set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # uncomment the line when this package is not in a git repo - #set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/src/pubsub_msg/msg/CustomMsg1.msg b/src/pubsub_msg/msg/CustomMsg1.msg deleted file mode 100644 index 66a846b..0000000 --- a/src/pubsub_msg/msg/CustomMsg1.msg +++ /dev/null @@ -1,8 +0,0 @@ -# Header data, eg timestamp -# Problem: "header__struct.hpp: No such file or directory" -#Header header - -# Sensor Data coming back from an array of atmospheric sensors -float32[] temperature -float32[] pressure -float32[] humidity diff --git a/src/pubsub_msg/msg/CustomMsg2.msg b/src/pubsub_msg/msg/CustomMsg2.msg deleted file mode 100644 index 2e9603d..0000000 --- a/src/pubsub_msg/msg/CustomMsg2.msg +++ /dev/null @@ -1,7 +0,0 @@ -# Header data, eg timestamp -# Problem: "header__struct.hpp: No such file or directory" -#Header header - -# User inputs, eg. for controlling a camera mast , eg. set angles [rad] -float32 pitch_ctrl -float32 yaw_ctrl diff --git a/src/pubsub_msg/package.xml b/src/pubsub_msg/package.xml deleted file mode 100644 index 1592b75..0000000 --- a/src/pubsub_msg/package.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - pubsub_msg - 0.0.0 - TODO: Package description - patrick - TODO: License declaration - - ament_cmake - ament_lint_auto - ament_lint_common - - - - - - builtin_interfaces - rosidl_default_generators - - builtin_interfaces - rosidl_default_runtime - - rosidl_interface_packages - - - - - - - - ament_cmake - -