ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
precedenceruleconverter.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/env/afactory.h>
17 #include <adore_if_ros_msg/Precedence.h>
18 
19 namespace adore
20 {
21  namespace if_ROS
22  {
24  {
28  adore_if_ros_msg::Precedence operator()(const adore::env::PrecedenceRule& rule)
29  {
30  adore_if_ros_msg::Precedence msg;
31  msg.high_priority.first.x = rule.high_.from_(0);
32  msg.high_priority.first.y = rule.high_.from_(1);
33  msg.high_priority.first.z = rule.high_.from_(2);
34  msg.high_priority.last.x = rule.high_.to_(0);
35  msg.high_priority.last.y = rule.high_.to_(1);
36  msg.high_priority.last.z = rule.high_.to_(2);
37 
38  msg.unary = rule.unary_;
39 
40  msg.low_priority.first.x = rule.low_.from_(0);
41  msg.low_priority.first.y = rule.low_.from_(1);
42  msg.low_priority.first.z = rule.low_.from_(2);
43  msg.low_priority.last.x = rule.low_.to_(0);
44  msg.low_priority.last.y = rule.low_.to_(1);
45  msg.low_priority.last.z = rule.low_.to_(2);
46  return msg;
47  }
51  void operator()(adore_if_ros_msg::PrecedenceConstPtr msg,adore::env::PrecedenceRule& rule)
52  {
53  rule.high_.from_(0) = msg->high_priority.first.x;
54  rule.high_.from_(1) = msg->high_priority.first.y;
55  rule.high_.from_(2) = msg->high_priority.first.z;
56  rule.high_.to_(0) = msg->high_priority.last.x;
57  rule.high_.to_(1) = msg->high_priority.last.y;
58  rule.high_.to_(2) = msg->high_priority.last.z;
59 
60  rule.unary_ = msg->unary;
61 
62  rule.low_.from_(0) = msg->low_priority.first.x;
63  rule.low_.from_(1) = msg->low_priority.first.y;
64  rule.low_.from_(2) = msg->low_priority.first.z;
65  rule.low_.to_(0) = msg->low_priority.last.x;
66  rule.low_.to_(1) = msg->low_priority.last.y;
67  rule.low_.to_(2) = msg->low_priority.last.z;
68  }
69  };
70  }
71 }
72 
73 
74 
Definition: areaofeffectconverter.h:20
The PrecedenceRule defines a precedence relationship between two routes. Vehicles on the low_ priorit...
Definition: precedence.h:108
bool unary_
Definition: precedence.h:112
PriorityRoute low_
Definition: precedence.h:110
PriorityRoute high_
Definition: precedence.h:111
adoreMatrix< double, 3, 1 > to_
Definition: precedence.h:40
adoreMatrix< double, 3, 1 > from_
Definition: precedence.h:39
Definition: precedenceruleconverter.h:24
adore_if_ros_msg::Precedence operator()(const adore::env::PrecedenceRule &rule)
Definition: precedenceruleconverter.h:28
void operator()(adore_if_ros_msg::PrecedenceConstPtr msg, adore::env::PrecedenceRule &rule)
Definition: precedenceruleconverter.h:51