diff --git a/rosbot_bringup/launch/bringup.launch.py b/rosbot_bringup/launch/bringup.launch.py index 2e0ecb0d..c7f65934 100644 --- a/rosbot_bringup/launch/bringup.launch.py +++ b/rosbot_bringup/launch/bringup.launch.py @@ -13,7 +13,12 @@ # limitations under the License. from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription +from launch.actions import ( + DeclareLaunchArgument, + IncludeLaunchDescription, + LogInfo, + TimerAction, +) from launch.conditions import IfCondition from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import ( @@ -57,12 +62,6 @@ def generate_launch_description(): }.items(), ) - healthcheck_launch = IncludeLaunchDescription( - PythonLaunchDescriptionSource( - PathJoinSubstitution([rosbot_bringup, "launch", "healthcheck.launch.py"]) - ) - ) - microros_launch = IncludeLaunchDescription( PythonLaunchDescriptionSource( PathJoinSubstitution([rosbot_bringup, "launch", "microros.launch.py"]) @@ -98,14 +97,22 @@ def generate_launch_description(): namespace=namespace, ) + green_color = "\033[92m" + reset_color = "\033[0m" + + status_info = TimerAction( + period=15.0, + actions=[LogInfo(msg=f"{green_color}All systems are up and running!{reset_color}")], + ) + actions = [ declare_microros_arg, declare_namespace_arg, controller_launch, - healthcheck_launch, microros_launch, laser_filter_node, robot_localization_node, + status_info, ] return LaunchDescription(actions) diff --git a/rosbot_bringup/launch/healthcheck.launch.py b/rosbot_bringup/launch/healthcheck.launch.py deleted file mode 100644 index 3c171889..00000000 --- a/rosbot_bringup/launch/healthcheck.launch.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 ros2_control Development Team -# Copyright 2024 Husarion sp. z o.o. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from launch import LaunchDescription -from launch.actions import OpaqueFunction, TimerAction - - -def check_controller_status(context): - green_color = "\033[92m" - reset_color = "\033[0m" - - print(f"{green_color}All systems are up and running!{reset_color}") - with open("/var/tmp/rosbot_status.txt", "w") as status_file: - status_file.write("healthy") - - -def generate_launch_description(): - with open("/var/tmp/rosbot_status.txt", "w") as status_file: - status_file.write("unhealthy") - - check_controller = TimerAction( - period=15.0, - actions=[OpaqueFunction(function=check_controller_status)], - ) - - return LaunchDescription([check_controller])