EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
output.hpp
1// Copyright 2026 Intelligent Robotics Lab
2//
3// This file is part of the project EasyFleet
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef EASYFLEET_MISSION_MANAGER__OUTPUT_HPP_
17#define EASYFLEET_MISSION_MANAGER__OUTPUT_HPP_
18
19#include <iostream>
20#include <mutex>
21#include <string>
22
23namespace easyfleet_mission_manager
24{
25
29inline std::mutex g_output_mutex;
30
31inline void safe_print(const std::string & line)
32{
33 std::lock_guard<std::mutex> lock(g_output_mutex);
34 std::cout << line << std::endl;
35}
36
37} // namespace easyfleet_mission_manager
38
39#endif // EASYFLEET_MISSION_MANAGER__OUTPUT_HPP_