ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
propositionconverter.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Daniel Heß - initial API and implementation
13  ********************************************************************************/
14 #pragma once
15 
16 #include <adore_if_ros_msg/Proposition.h>
18 
19 namespace adore
20 {
21  namespace if_ROS
22  {
24  {
25 
26  // unsigned char order_; /**< order of calculus, (zero/first), or enum value for others if used */
27  // std::string term_; /**< logical term, e.g. GOAL_REACHED in 0-order */
28  // bool value_; /**< boolean value of term, e.g. GOAL_REACHED=true */
29  // double timeout_; /**< UTC time, after which value shall be considered undefined */
30  // bool has_timeout_; /**< if false, timeout shall be considered infinite */
31 
32  // uint8 order #order of calculus, (zero/first), or enum value for others if used
33  // string term #logical term, e.g. GOAL_REACHED in 0-order
34  // bool value #boolean value of term, e.g. GOAL_REACHED=true
35  // double timeout #UTC time, after which value shall be considered undefined
36  // bool has_timeout #if false, timeout shall be considered infinite
37 
41  adore_if_ros_msg::Proposition operator()(const adore::env::Proposition & p)
42  {
43  adore_if_ros_msg::Proposition msg;
44 
45  msg.order=p.order_;
46  msg.term=p.term_;
47  msg.value=p.value_;
48  msg.timeout=p.timeout_;
49  msg.has_timeout=p.has_timeout_;
50 
51  return msg;
52  }
56  void operator()(adore_if_ros_msg::PropositionConstPtr msg,adore::env::Proposition& p)
57  {
58  p.order_=msg->order;
59  p.term_=msg->term;
60  p.value_=msg->value;
61  p.timeout_=msg->timeout;
62  p.has_timeout_=msg->has_timeout;
63  }
64  };
65  }
66 }
Definition: areaofeffectconverter.h:20
A logical proposition, with a possible timeout for the information.
Definition: proposition.h:27
unsigned char order_
Definition: proposition.h:28
std::string term_
Definition: proposition.h:29
double timeout_
Definition: proposition.h:31
bool has_timeout_
Definition: proposition.h:32
bool value_
Definition: proposition.h:30
Definition: propositionconverter.h:24
adore_if_ros_msg::Proposition operator()(const adore::env::Proposition &p)
Definition: propositionconverter.h:41
void operator()(adore_if_ros_msg::PropositionConstPtr msg, adore::env::Proposition &p)
Definition: propositionconverter.h:56