operation_mode_setup_executor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 Pilz GmbH & Co. KG
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13 
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef OPERATION_MODE_SETUP_EXECUTOR_H
19 #define OPERATION_MODE_SETUP_EXECUTOR_H
20 
21 #include <atomic>
22 
23 #include <ros/ros.h>
24 
25 #include <prbt_hardware_support/OperationModes.h>
26 #include <prbt_hardware_support/GetSpeedOverride.h>
29 
30 
31 namespace prbt_hardware_support
32 {
33 
39 {
40 public:
51  OperationModeSetupExecutor(const double& speed_limit_t1,
52  const double& speed_limit_auto,
53  const SetSpeedLimitFunc& set_speed_limit_func);
54 
55 public:
59  void updateOperationMode(const OperationModes& operation_mode);
60 
61  bool getSpeedOverride(GetSpeedOverride::Request& /*req*/, GetSpeedOverride::Response& response);
62 
63 private:
65  const double speed_limit_t1_;
67  const double speed_limit_auto_;
68 
70  std::atomic<double> speed_override_{0.0};
71 
76 };
77 
78 
79 } // namespace prbt_hardware_support
80 
81 #endif // OPERATION_MODE_SETUP_EXECUTOR_H
std::atomic< double > speed_override_
The active speed override.
bool getSpeedOverride(GetSpeedOverride::Request &, GetSpeedOverride::Response &response)
ros::Time time_stamp_last_op_mode_
Time stamp of the last received operation mode.
SetSpeedLimitFunc set_speed_limit_func_
Function used to propagate speed limit changes into the system.
const double speed_limit_t1_
The allowed speed limit in operation mode T1.
Sets the allowed speed limit for each frame based on the current operation mode.
const double speed_limit_auto_
The allowed speed limit in operation mode AUTOMATIC.
OperationModeSetupExecutor(const double &speed_limit_t1, const double &speed_limit_auto, const SetSpeedLimitFunc &set_speed_limit_func)
Ctor.
std::function< bool(const double &)> SetSpeedLimitFunc
void updateOperationMode(const OperationModes &operation_mode)
Function to be called whenever a new operation mode is set.


prbt_hardware_support
Author(s):
autogenerated on Tue Feb 2 2021 03:50:17