From a370bada7897a24ae09019fee6f4b89b03e28ce9 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:02:06 +0100 Subject: [PATCH 01/10] =?UTF-8?q?=F0=9F=94=A7=20change=20127.0.0.0=20to=20?= =?UTF-8?q?0.0.0.0=20in=20mavros=20launch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suave/launch/simulation.launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suave/launch/simulation.launch.py b/suave/launch/simulation.launch.py index 5be1023..49efeb8 100644 --- a/suave/launch/simulation.launch.py +++ b/suave/launch/simulation.launch.py @@ -34,7 +34,7 @@ def generate_launch_description(): mavros_node = IncludeLaunchDescription( AnyLaunchDescriptionSource(mavros_launch_path), launch_arguments={ - 'fcu_url': 'udp://127.0.0.1:14551@14555', + 'fcu_url': 'udp://0.0.0.0:14551@14555', 'gcs_url': 'udp://@localhost:14550', 'system_id': '255', 'component_id': '240', From f0c4e44f2ce98d0d0f9b7aeddc9eb3ee0bb4bd0a Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:05:11 +0100 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=94=A7=20merge=20metacontrol=20laun?= =?UTF-8?q?chfiles=20into=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launch/launch_reasoner.launch.py | 61 -------------- .../launch/metacontrol.launch.py | 32 -------- .../launch/suave_metacontrol.launch.py | 79 +++++++++++++++---- 3 files changed, 62 insertions(+), 110 deletions(-) delete mode 100644 suave_managing/suave_metacontrol/launch/launch_reasoner.launch.py delete mode 100644 suave_managing/suave_metacontrol/launch/metacontrol.launch.py diff --git a/suave_managing/suave_metacontrol/launch/launch_reasoner.launch.py b/suave_managing/suave_metacontrol/launch/launch_reasoner.launch.py deleted file mode 100644 index 7655839..0000000 --- a/suave_managing/suave_metacontrol/launch/launch_reasoner.launch.py +++ /dev/null @@ -1,61 +0,0 @@ -import os - -from ament_index_python.packages import get_package_share_directory - -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument -from launch.substitutions import LaunchConfiguration -from launch_ros.actions import Node - - -def generate_launch_description(): - # Get the launch directory - pkg_mc_mdl_tomasys_path = get_package_share_directory('mc_mdl_tomasys') - pkg_mros_ontology_path = get_package_share_directory('mros_ontology') - - # Create the launch configuration variables - tomasys_file = LaunchConfiguration('tomasys_file') - model_file = LaunchConfiguration('model_file') - desired_configuration = LaunchConfiguration('desired_configuration') - - tomasys_files_array = [ - os.path.join(pkg_mc_mdl_tomasys_path, 'owl', 'tomasys.owl'), - os.path.join(pkg_mros_ontology_path, 'owl', 'mros.owl')] - - tomasys_file_arg = DeclareLaunchArgument( - 'tomasys_file', - default_value=str(tomasys_files_array), - description='tomasys ontologies' - ) - - mock_ontology_path = os.path.join( - pkg_mros_ontology_path, 'owl', 'mock.owl') - - model_file_arg = DeclareLaunchArgument( - 'model_file', - default_value=mock_ontology_path, - description='File name for the Working ontology file') - - desired_configuration_arg = DeclareLaunchArgument( - 'desired_configuration', - default_value='', - description='Desired inital configuration (system mode)') - - mros_reasoner_node = Node( - package='suave_metacontrol', - executable='suave_reasoner', - name='suave_reasoner', - output='screen', - parameters=[{ - 'tomasys_file': tomasys_file, - 'model_file': model_file, - 'desired_configuration': desired_configuration, - }], - ) - - return LaunchDescription([ - tomasys_file_arg, - model_file_arg, - desired_configuration_arg, - mros_reasoner_node - ]) diff --git a/suave_managing/suave_metacontrol/launch/metacontrol.launch.py b/suave_managing/suave_metacontrol/launch/metacontrol.launch.py deleted file mode 100644 index b3c5787..0000000 --- a/suave_managing/suave_metacontrol/launch/metacontrol.launch.py +++ /dev/null @@ -1,32 +0,0 @@ -import os - -from ament_index_python.packages import get_package_share_directory - -from launch import LaunchDescription -from launch.actions import IncludeLaunchDescription -from launch.launch_description_sources import PythonLaunchDescriptionSource - - -def generate_launch_description(): - - pkg_suave_metacontrol_path = get_package_share_directory( - 'suave_metacontrol') - - reasoner_launch_path = os.path.join( - pkg_suave_metacontrol_path, - 'launch', - 'launch_reasoner.launch.py') - - suave_ontology_path = os.path.join( - pkg_suave_metacontrol_path, - 'config', - 'suave.owl') - - mros2_reasoner_node = IncludeLaunchDescription( - PythonLaunchDescriptionSource(reasoner_launch_path), - launch_arguments={ - 'model_file': suave_ontology_path}.items()) - - return LaunchDescription([ - mros2_reasoner_node, - ]) diff --git a/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py b/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py index eb3e120..e83d506 100644 --- a/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py +++ b/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py @@ -3,31 +3,78 @@ from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource - +from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node def generate_launch_description(): - pkg_suave_path = get_package_share_directory( - 'suave') + tomasys_file = LaunchConfiguration('tomasys_file') + model_file = LaunchConfiguration('model_file') + reasoning_time_filename = LaunchConfiguration('reasoning_time_filename') + + pkg_mc_mdl_tomasys_path = get_package_share_directory('mc_mdl_tomasys') + pkg_mros_ontology_path = get_package_share_directory('mros_ontology') + + tomasys_files_array = [ + os.path.join(pkg_mc_mdl_tomasys_path, 'owl', 'tomasys.owl'), + os.path.join(pkg_mros_ontology_path, 'owl', 'mros.owl')] + + tomasys_file_arg = DeclareLaunchArgument( + 'tomasys_file', + default_value=str(tomasys_files_array), + description='Path for the tomasys ontologies' + ) + pkg_suave_metacontrol_path = get_package_share_directory( 'suave_metacontrol') - metacontrol_launch_path = os.path.join( + suave_ontology_path = os.path.join( pkg_suave_metacontrol_path, - 'launch', - 'metacontrol.launch.py') + 'config', + 'suave.owl') + + model_file_arg = DeclareLaunchArgument( + 'model_file', + default_value=suave_ontology_path, + description='Path for the application-specific ontology file') - metacontrol_launch = IncludeLaunchDescription( - PythonLaunchDescriptionSource(metacontrol_launch_path)) + reasoning_time_filename_arg = DeclareLaunchArgument( + 'reasoning_time_filename', + default_value='metacontrol_reasoning_time', + description='File name for saving metacontrol reasoning time') + + metacontrol_config = os.path.join( + pkg_suave_metacontrol_path, + 'config', + 'metacontrol_config.yaml') + + mros_reasoner_node = Node( + package='suave_metacontrol', + executable='suave_reasoner', + name='suave_reasoner', + output='screen', + parameters=[metacontrol_config, { + 'tomasys_file': tomasys_file, + 'model_file': model_file, + 'reasoning_time_filename': reasoning_time_filename, + }], + ) - mros2_system_modes_bridge_node = Node( + mros_system_modes_bridge_node = Node( package='mros2_reasoner', executable='mros2_system_modes_bridge', ) + task_bridge_node = Node( + package='suave_metacontrol', + executable='task_bridge_metacontrol', + ) + + pkg_suave_path = get_package_share_directory( + 'suave') suave_launch_path = os.path.join( pkg_suave_path, 'launch', @@ -39,14 +86,12 @@ def generate_launch_description(): 'task_bridge': 'False'}.items() ) - task_bridge_node = Node( - package='suave_metacontrol', - executable='task_bridge_metacontrol', - ) - return LaunchDescription([ - suave_launch, - metacontrol_launch, - mros2_system_modes_bridge_node, + tomasys_file_arg, + model_file_arg, + reasoning_time_filename_arg, + mros_reasoner_node, + mros_system_modes_bridge_node, task_bridge_node, + suave_launch, ]) From 8e1e17d50ceb540956f6f5e96ba00d701350d395 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:06:11 +0100 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=94=A7=20adjust=20suave=5Fmission?= =?UTF-8?q?=20launchfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suave_missions/launch/mission.launch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/suave_missions/launch/mission.launch.py b/suave_missions/launch/mission.launch.py index d394673..ee64a63 100644 --- a/suave_missions/launch/mission.launch.py +++ b/suave_missions/launch/mission.launch.py @@ -18,6 +18,7 @@ def generate_launch_description(): result_filename = LaunchConfiguration('result_filename') battery_constraint = LaunchConfiguration('battery_constraint') battery_constraint_value = LaunchConfiguration('battery_constraint_value') + mc_reasoning_time_filename = LaunchConfiguration('mc_reasoning_time_filename') adaptation_manager_arg = DeclareLaunchArgument( 'adaptation_manager', @@ -45,12 +46,19 @@ def generate_launch_description(): description='Desired battery functionality' + '[True or False]' ) + battery_constraint_value_arg = DeclareLaunchArgument( 'battery_constraint_value', default_value='0.2', description='battery constraint value' ) + mc_reasoning_time_filename_arg = DeclareLaunchArgument( + 'mc_reasoning_time_filename', + default_value='metacontrol_reasoning_time', + description='metacontrol reasoning time filename' + ) + pkg_suave_path = get_package_share_directory( 'suave_missions') @@ -124,6 +132,8 @@ def generate_launch_description(): suave_metacontrol_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource(suave_metacontrol_launch_path), + launch_arguments = { + 'reasoning_time_filename' : mc_reasoning_time_filename}.items(), condition=LaunchConfigurationEquals( 'adaptation_manager', 'metacontrol')) From 159a9278723a701cb63abfc3e890efe3718fca88 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:06:35 +0100 Subject: [PATCH 04/10] =?UTF-8?q?=E2=9C=A8=20add=20metacontrol=5Fconfig.ya?= =?UTF-8?q?ml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suave_metacontrol/config/metacontrol_config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 suave_managing/suave_metacontrol/config/metacontrol_config.yaml diff --git a/suave_managing/suave_metacontrol/config/metacontrol_config.yaml b/suave_managing/suave_metacontrol/config/metacontrol_config.yaml new file mode 100644 index 0000000..79bc54a --- /dev/null +++ b/suave_managing/suave_metacontrol/config/metacontrol_config.yaml @@ -0,0 +1,5 @@ +/suave_reasoner: + ros__parameters: + reasoning_time_save: True + reasoning_time_file_path: '~/suave/results' #Path to save results + reasoning_period: 1.5 From 1445a4c7b85e5282b45520565a6bf1c1a3fcbc77 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:07:05 +0100 Subject: [PATCH 05/10] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20=20adjust=20SuaveRea?= =?UTF-8?q?soner=20analyze=20method=20to=20match=20new=20mc=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suave_metacontrol/suave_reasoner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py b/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py index 9819994..30a5325 100755 --- a/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py +++ b/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py @@ -12,10 +12,16 @@ class SuaveReasoner(RosReasoner): def __init__(self): super().__init__() - def analyze(self): + def analyze(self, + save_reasoning_time = False, + reasoning_time_filename='metacontrol_reasoning_time', + reasoning_time_file_path='~/metacontrol/results'): objectives_in_error = [] try: - objectives_in_error = super().analyze() + objectives_in_error = super().analyze( + save_reasoning_time, + reasoning_time_filename, + reasoning_time_file_path) except Exception as err: self.logger.info("In Analyze, exception returned: {}".format(err)) try: From ed0f7cf16252f369da67eefd36b315495aff8caa Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 15:20:44 +0100 Subject: [PATCH 06/10] =?UTF-8?q?=E2=9A=A1=20improvements=20to=20mission?= =?UTF-8?q?=5Fmetrics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suave_metrics/suave_metrics/mission_metrics.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/suave_metrics/suave_metrics/mission_metrics.py b/suave_metrics/suave_metrics/mission_metrics.py index 8333a13..86dd7bf 100644 --- a/suave_metrics/suave_metrics/mission_metrics.py +++ b/suave_metrics/suave_metrics/mission_metrics.py @@ -233,6 +233,8 @@ def check_altitude(self, diagnostic_status, time): if value.key == 'water_visibility': self.measured_wv = float(value.value) altitude = self.get_spiral_altitude() + if altitude is None: + return expected = self.get_expected_spiral_altitude(value.value) correct_altitude = altitude == expected if self.battery_low is False and self.wrong_altitude is False \ @@ -244,7 +246,7 @@ def check_altitude(self, diagnostic_status, time): def get_spiral_altitude(self): req = GetParameters.Request(names=['spiral_altitude']) res = self.call_service(self.get_spiral_altitude_cli, req) - return res.values[0].double_value if len(res.values) > 0 else None + return res.values[0].double_value if res is not None and len(res.values) > 0 else None def get_expected_spiral_altitude(self, measured_wv): wv_threshold = self.get_parameter('water_visibiity_threshold').value @@ -353,7 +355,7 @@ def save_mission_results(self) -> None: 'mean reaction time (s)', ] - date = datetime.now().strftime("%b-%d-%Y-%H-%M-%S") + date = datetime.now().strftime("%d-%b-%Y-%H-%M-%S") mission_data = [ self.mission_name, date, @@ -402,8 +404,7 @@ def save_mission_results(self) -> None: [self.mission_name, date, t] ) - # TODO: make this a parameter - os.system("touch ~/suave_ws/mission.done") + os.system("touch /tmp/mission.done") def save_metrics( self, From ddf86d05b0f8b1b84ad5aa8ab1f0eeee75956c77 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 18:51:05 +0100 Subject: [PATCH 07/10] =?UTF-8?q?=F0=9F=94=A5=20remove=20SuaveReasoner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launch/suave_metacontrol.launch.py | 4 +- suave_managing/suave_metacontrol/setup.py | 3 - .../suave_metacontrol/suave_reasoner.py | 70 ------------------- .../task_bridge_metacontrol.py | 5 ++ 4 files changed, 7 insertions(+), 75 deletions(-) delete mode 100755 suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py diff --git a/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py b/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py index e83d506..36a547a 100644 --- a/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py +++ b/suave_managing/suave_metacontrol/launch/suave_metacontrol.launch.py @@ -52,8 +52,8 @@ def generate_launch_description(): 'metacontrol_config.yaml') mros_reasoner_node = Node( - package='suave_metacontrol', - executable='suave_reasoner', + package='mros2_reasoner', + executable='mros2_reasoner_node', name='suave_reasoner', output='screen', parameters=[metacontrol_config, { diff --git a/suave_managing/suave_metacontrol/setup.py b/suave_managing/suave_metacontrol/setup.py index 2bb7b21..59d460f 100644 --- a/suave_managing/suave_metacontrol/setup.py +++ b/suave_managing/suave_metacontrol/setup.py @@ -26,9 +26,6 @@ tests_require=['pytest'], entry_points={ 'console_scripts': [ - 'fake_managed_system = ' + - 'suave_metacontrol.fake_managed_system:main', - 'suave_reasoner = suave_metacontrol.suave_reasoner:main', 'task_bridge_metacontrol = ' + ' suave_metacontrol.task_bridge_metacontrol:main', ], diff --git a/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py b/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py deleted file mode 100755 index 30a5325..0000000 --- a/suave_managing/suave_metacontrol/suave_metacontrol/suave_reasoner.py +++ /dev/null @@ -1,70 +0,0 @@ -import rclpy - -from mros2_reasoner.ros_reasoner import RosReasoner -from rclpy.executors import MultiThreadedExecutor - -# TODO: I don't it is a good pratice to import something from tomasys -from mros2_reasoner.tomasys import get_current_function_design -from mros2_reasoner.tomasys import get_measured_qa - - -class SuaveReasoner(RosReasoner): - def __init__(self): - super().__init__() - - def analyze(self, - save_reasoning_time = False, - reasoning_time_filename='metacontrol_reasoning_time', - reasoning_time_file_path='~/metacontrol/results'): - objectives_in_error = [] - try: - objectives_in_error = super().analyze( - save_reasoning_time, - reasoning_time_filename, - reasoning_time_file_path) - except Exception as err: - self.logger.info("In Analyze, exception returned: {}".format(err)) - try: - objectives = self.search_objectives() - for objective in objectives: - if str(objective.name) not in objectives_in_error and \ - self.get_function_name_from_objective_id(objective.name) == \ - "f_generate_search_path": - measured_water_visibility = get_measured_qa( - 'water_visibility', self.tomasys) - current_fd = get_current_function_design( - objective, self.tomasys) - if current_fd is not None: - for qa in current_fd.hasQAestimation: - if str(qa.isQAtype.name) == 'water_visibility' \ - and (qa.hasValue - measured_water_visibility) < 0: - objectives_in_error.append(str(objective.name)) - self.update_objective_status( - objective, 'IN_ERROR_NFR') - except Exception as err: - self.logger.info( - "In custom Analyze, exception returned: {}".format(err)) - return objectives_in_error - - -def main(args=None): - - rclpy.init(args=args) - - pipeline_inspection_reasoner = SuaveReasoner() - - mt_executor = MultiThreadedExecutor() - - if pipeline_inspection_reasoner.is_initialized is not True: - pipeline_inspection_reasoner.get_logger().info( - "There was an error in the reasoner initialization") - return - - # Spin until the process in terminated - rclpy.spin(pipeline_inspection_reasoner, executor=mt_executor) - pipeline_inspection_reasoner.destroy_node() - rclpy.shutdown() - - -if __name__ == '__main__': - main() diff --git a/suave_managing/suave_metacontrol/suave_metacontrol/task_bridge_metacontrol.py b/suave_managing/suave_metacontrol/suave_metacontrol/task_bridge_metacontrol.py index 2280efe..a49fecf 100644 --- a/suave_managing/suave_metacontrol/suave_metacontrol/task_bridge_metacontrol.py +++ b/suave_managing/suave_metacontrol/suave_metacontrol/task_bridge_metacontrol.py @@ -26,6 +26,8 @@ def __init__(self): 'inspect_pipeline': ['f_maintain_motion', 'f_follow_pipeline'], } + self.always_improve = ['f_generate_search_path'] + def forward_task_request(self, function): future = self.send_mros_objective(function) @@ -72,6 +74,9 @@ def send_mros_objective(self, function, nfrs=[]): nfr.key = str(required_nfr[0]) nfr.value = str(required_nfr[1]) goal_msg.qos_expected.qos.append(nfr) + + goal_msg.qos_expected.always_improve = function in self.always_improve + while not self.mros_action_client.wait_for_server(timeout_sec=1.0): self.get_logger().info('waiting for /mros/objective action ...') self.get_logger().info( From c18125864877c8d1b116b5b114ba378b4bea6738 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 18:52:42 +0100 Subject: [PATCH 08/10] =?UTF-8?q?=E2=9C=A8=20add=20support=20for=20bt=20in?= =?UTF-8?q?=20the=20runner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runner/runner.sh | 12 ++++++------ runner/scripts/launch_mc.sh | 4 ---- runner/scripts/launch_mission.sh | 15 ++++++++++++--- 3 files changed, 18 insertions(+), 13 deletions(-) delete mode 100755 runner/scripts/launch_mc.sh diff --git a/runner/runner.sh b/runner/runner.sh index ad28866..f9ba601 100755 --- a/runner/runner.sh +++ b/runner/runner.sh @@ -3,7 +3,7 @@ if [ $# -lt 1 ]; then echo "usage: $0 gui adaptation_manager mission_type runs" echo example: - echo " "$0 "[true | false] [metacontrol | random | none] [time | distance] runs(integer)" + echo " "$0 "[true | false] [metacontrol | random | none | bt] [time | distance] runs(integer)" exit 1 fi @@ -30,7 +30,7 @@ else exit 1 fi -if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [[ "$2" == "none" ]]; +if [ "$2" == "metacontrol" ] || [ "$2" == "random" ] || [[ "$2" == "none" ]] || [[ "$2" == "bt" ]]; then MANAGER=$2 else @@ -106,18 +106,18 @@ run_missions(){ xfce4-terminal --execute ./scripts/launch_sim.sh $GUI & sleep 30 #let it boot up - rm -f ~/suave_ws/mission.done + rm -f /tmp/mission.done xfce4-terminal --execute ./scripts/launch_mission.sh $MANAGER $MTYPE $FILENAME & sleep 30 #let it boot up echo "start waiting for mission to finish" start_time=$SECONDS - while [ ! -f ~/suave_ws/mission.done ] + while [ ! -f /tmp/mission.done ] do - if [ -f ~/suave_ws/mission.done ] + if [ -f /tmp/mission.done ] then echo "mission done" - rm ~/suave_ws/mission.done + rm /tmp/mission.done break; fi current_time=$SECONDS diff --git a/runner/scripts/launch_mc.sh b/runner/scripts/launch_mc.sh deleted file mode 100755 index e8cd499..0000000 --- a/runner/scripts/launch_mc.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -source ~/.bashrc -source ~/suave_ws/install/setup.bash -ros2 launch suave_metacontrol suave_metacontrol.launch.py diff --git a/runner/scripts/launch_mission.sh b/runner/scripts/launch_mission.sh index 8a56221..8e52a0f 100755 --- a/runner/scripts/launch_mission.sh +++ b/runner/scripts/launch_mission.sh @@ -5,14 +5,14 @@ source ~/suave_ws/install/setup.bash if [ $# -lt 1 ]; then echo "usage: $0 adaptation_manager mission_type" echo example: - echo " "$0 "[metacontrol | random | none] [time | distance]" + echo " "$0 "[metacontrol | random | none | bt] [time | distance]" exit 1 fi MANAGER="" MTYPE="" -if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [[ "$1" == "none" ]]; +if [ "$1" == "metacontrol" ] || [ "$1" == "random" ] || [[ "$1" == "none" ]] || [[ "$1" == "bt" ]]; then MANAGER=$1 else @@ -33,4 +33,13 @@ else fi fi -ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$3 +FILE=$3 +MCFILE=${FILE}"_mc_reasoning_time" + +if [ "$MANAGER" == "metacontrol" ] || [ "$MANAGER" == "random" ] || [[ "$MANAGER" == "none" ]]; +then + ros2 launch suave_missions mission.launch.py adaptation_manager:=$MANAGER mission_type:=$MTYPE result_filename:=$FILE mc_reasoning_time_filename:=$MCFILE +elif [ "$MANAGER" == "bt" ]; +then + ros2 launch suave_bt suave_bt.launch.py result_filename:=$3 +fi From bd342670673f98691c09690e69a36fad42c66b17 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 18:54:22 +0100 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=94=A5=20remove=20suave=20from=20su?= =?UTF-8?q?ave.rosinstall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suave.rosinstall | 4 ---- 1 file changed, 4 deletions(-) diff --git a/suave.rosinstall b/suave.rosinstall index fb0a5f1..f508ec1 100644 --- a/suave.rosinstall +++ b/suave.rosinstall @@ -15,10 +15,6 @@ repositories: type: git url: https://github.com/remaro-network/remaro_worlds.git version: 2650f19 - suave: - type: git - url: https://github.com/kas-lab/suave.git - version: main mc_mdl_tomasys: type: git url: https://github.com/meta-control/mc_mdl_tomasys.git From 3a04c4ad367b163cf21e684f188ea4be3710f06a Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Jun 2024 18:55:31 +0100 Subject: [PATCH 10/10] =?UTF-8?q?=E2=9A=A1=20get=20time=20from=20msg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suave_metrics/suave_metrics/mission_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suave_metrics/suave_metrics/mission_metrics.py b/suave_metrics/suave_metrics/mission_metrics.py index 86dd7bf..f55bd07 100644 --- a/suave_metrics/suave_metrics/mission_metrics.py +++ b/suave_metrics/suave_metrics/mission_metrics.py @@ -212,7 +212,7 @@ def gazebo_pos_cb(self, msg): self.destroy_subscription(self.gazebo_pos_sub) def diagnostics_cb(self, msg): - time = self.get_clock().now() + time = Time.from_msg(msg.header.stamp) measurement_messages = [ 'qa status', 'qa measurement',