From 275b6258ec1f1c81488ac2667a35d320dab8f62a Mon Sep 17 00:00:00 2001 From: Jade Snr Date: Wed, 25 Oct 2023 11:33:08 +0200 Subject: [PATCH] the node is working and running, need to discuss how the other teams are going to get the parameters from it --- asv_setup/CMakeLists.txt | 15 ++++++++++++--- asv_setup/launch/launch_to_erase.yaml | 6 +++--- asv_setup/package.xml | 12 ++++++++---- asv_setup/scripts/__init__.py | 0 asv_setup/scripts/parameter_manager_node.py | 8 +++++--- 5 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 asv_setup/scripts/__init__.py diff --git a/asv_setup/CMakeLists.txt b/asv_setup/CMakeLists.txt index 8a67f88d..2a1e9336 100644 --- a/asv_setup/CMakeLists.txt +++ b/asv_setup/CMakeLists.txt @@ -5,13 +5,22 @@ 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(ament_cmake_python REQUIRED) +find_package(rclpy REQUIRED) +find_package(sensor_msgs REQUIRED) +find_package(geometry_msgs REQUIRED) + +ament_python_install_package(scripts) # Install launch files. install(DIRECTORY launch - DESTINATION share/${PROJECT_NAME}/ + DESTINATION share/${PROJECT_NAME} +) + +install(PROGRAMS + scripts/parameter_manager_node.py + DESTINATION lib/${PROJECT_NAME} ) ament_package() diff --git a/asv_setup/launch/launch_to_erase.yaml b/asv_setup/launch/launch_to_erase.yaml index 3ee807f6..9a1c6772 100644 --- a/asv_setup/launch/launch_to_erase.yaml +++ b/asv_setup/launch/launch_to_erase.yaml @@ -1,10 +1,10 @@ launch: - node: - pkg: test_pkg - exec: test_node + pkg: asv_setup + exec: parameter_manager_node.py name: parameter_manager_node output: screen param: - - from: /home/jade/ros2_ws/src/test_pkg/test_pkg/config/params.yaml + - from: /home/jade/ros2_vortex_ws/src/vortex-asv/asv_setup/config/freya.yaml diff --git a/asv_setup/package.xml b/asv_setup/package.xml index 97057113..39ea37e8 100644 --- a/asv_setup/package.xml +++ b/asv_setup/package.xml @@ -4,13 +4,17 @@ asv_setup 0.0.0 The asv_setup package + alekskl01 + MIT + + ament_cmake_python + + rclpy + geometry_msgs + sensor_msgs - ament_cmake - - ament_lint_auto - ament_lint_common ament_cmake diff --git a/asv_setup/scripts/__init__.py b/asv_setup/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/asv_setup/scripts/parameter_manager_node.py b/asv_setup/scripts/parameter_manager_node.py index 30fb80b4..1275d6be 100644 --- a/asv_setup/scripts/parameter_manager_node.py +++ b/asv_setup/scripts/parameter_manager_node.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import rclpy from rclpy.node import Node import ast @@ -36,12 +37,13 @@ def StringInto2DArray(input_string): def main(): rclpy.init() parameter_manager_node = ParameterManagerNode() - test = parameter_manager_node.asv_thruster_manager_output + test = parameter_manager_node.configuration_matrix + print(test) #rclpy.spin(joystick_interface) - #parameter_manager_node.destroy_node() + parameter_manager_node.destroy_node() rclpy.shutdown() if __name__ == "__main__": - main() \ No newline at end of file + main()