ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
speedlimitconverter.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  * Thomas Lobig - initial API and implementation
13  ********************************************************************************/
14 #pragma once
15 
16 #include <adore/env/afactory.h>
17 #include <adore_if_ros_msg/SpeedLimitBundle.h>
18 #include <adore_if_ros_msg/SpeedLimit.h>
19 
20 namespace adore
21 {
22  namespace if_ROS
23  {
25  {
29  adore_if_ros_msg::SpeedLimit operator()(const adore::env::SpeedLimit& data)
30  {
31  adore_if_ros_msg::SpeedLimit msg;
32  msg.speedLimitVelocity = data.value;
33  msg.validFromTo.first.x = data.startX;
34  msg.validFromTo.first.y = data.startY;
35  msg.validFromTo.first.z = 0.0;
36  msg.validFromTo.last.x = data.stopX;
37  msg.validFromTo.last.y = data.stopY;
38  msg.validFromTo.last.z = 0.0;
39  msg.id = data.id;
40  return msg;
41  }
45  void operator()(adore_if_ros_msg::SpeedLimitConstPtr msg,adore::env::SpeedLimit& data)
46  {
47  data.value = msg->speedLimitVelocity;
48  data.startX = msg->validFromTo.first.x;
49  data.startY = msg->validFromTo.first.y;
50  data.stopX = msg->validFromTo.last.x;
51  data.stopY = msg->validFromTo.last.y;
52  data.id = msg->id;
53  }
54 
55  };
56  }
57 }
58 
59 
60 
Definition: areaofeffectconverter.h:20
Definition: speedlimit.h:31
double startX
Definition: speedlimit.h:41
double value
Definition: speedlimit.h:40
double stopY
Definition: speedlimit.h:44
TSpeedLimitID id
Definition: speedlimit.h:45
double stopX
Definition: speedlimit.h:43
double startY
Definition: speedlimit.h:42
Definition: speedlimitconverter.h:25
void operator()(adore_if_ros_msg::SpeedLimitConstPtr msg, adore::env::SpeedLimit &data)
Definition: speedlimitconverter.h:45
adore_if_ros_msg::SpeedLimit operator()(const adore::env::SpeedLimit &data)
Definition: speedlimitconverter.h:29