32 op_mode_.value = OperationModes::UNKNOWN;
53 const int8_t last_op_mode_value {
op_mode_.value};
57 if (new_op_mode.value != last_op_mode_value)
60 << static_cast<int>(last_op_mode_value)
62 << static_cast<int>(new_op_mode.value) );
68 GetOperationMode::Response& res)
ros::NodeHandle & nh_
The node handle.
void publish(const boost::shared_ptr< M > &message) const
OperationModes op_mode_
Store the current operation mode according to OperationModes.msg.
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
bool getOperationMode(GetOperationMode::Request &, GetOperationMode::Response &response)
void updateOperationMode(const OperationModes &mode)
Stores the operation mode and publishes it, if it has changed.
ros::Publisher operation_mode_pub_
Informs about operation mode changes via topic.
void initOperationModeService()
Initializes the operation mode service.
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
static const std::string SERVICE_NAME_GET_OPERATION_MODE
#define ROS_INFO_STREAM(args)
static constexpr int DEFAULT_QUEUE_SIZE
AdapterOperationMode(ros::NodeHandle &nh)
std::mutex op_mode_mutex_
Protects read/write of the operation mode.
ros::ServiceServer operation_mode_server_
Server serving a service to ask whether a brake test is currently required.
static const std::string TOPIC_OPERATION_MODE