ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
tcdconnectionconverter.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 #include <adore_if_ros_msg/TCDConnectionStateTrace.h>
16 
17 namespace adore
18 {
19  namespace if_ROS
20  {
22  {
23  void operator()(adore_if_ros_msg::TCDConnectionStateTraceConstPtr msg , adore::env::ControlledConnection & con)
24  {
25  con.setID(
26  msg.get()->connection.first.x,
27  msg.get()->connection.first.y,
28  msg.get()->connection.first.z,
29  msg.get()->connection.last.x,
30  msg.get()->connection.last.y,
31  msg.get()->connection.last.z
32  );
33  for( auto state: msg.get()->data )
34  {
37  state.minEndTime,
38  state.maxEndTime_present,
39  state.likelyTime_present,
40  state.maxEndTime,
41  state.likelyTime
42  );
43  con.insertStateEvent(e);
44  }
45  }
49  adore_if_ros_msg::TCDConnectionStateTrace operator()(const adore::env::ControlledConnection & con)
50  {
51  adore_if_ros_msg::TCDConnectionStateTrace msg;
52  msg.connection.first.x = con.getID().getFrom().get<0>();
53  msg.connection.first.y = con.getID().getFrom().get<1>();
54  msg.connection.first.z = con.getID().getFrom().get<2>();
55  msg.connection.last.x = con.getID().getTo().get<0>();
56  msg.connection.last.y = con.getID().getTo().get<1>();
57  msg.connection.last.z = con.getID().getTo().get<2>();
58  for( auto& state: con.data_ )
59  {
60  adore_if_ros_msg::TCDConnectionState smsg;
61  smsg.minEndTime = state.getMinEndTime();
62  smsg.maxEndTime = state.getMaxEndTime();
63  smsg.maxEndTime_present = state.hasMaxEndTime();
64  smsg.likelyTime = state.getLikelyTime();
65  smsg.likelyTime_present = state.hasLikelyTime();
66  smsg.state = (int) state.getState();
67  msg.data.push_back(smsg);
68  }
69  return msg;
70  }
71  };
72  }
73 }
Definition: controlledconnection.h:81
void insertStateEvent(const ConnectionStateEvent &e)
Definition: controlledconnection.h:104
void setID(double x0, double y0, double z0, double x1, double y1, double z1)
Definition: controlledconnection.h:96
std::vector< ConnectionStateEvent > data_
Definition: controlledconnection.h:87
const TID & getID() const
Definition: controlledconnection.h:100
EConnectionState
Definition: controlledconnection.h:36
Definition: areaofeffectconverter.h:20
Definition: controlledconnection.h:55
Tboost_point getFrom() const
Definition: vectoridentifier.h:65
Tboost_point getTo() const
Definition: vectoridentifier.h:66
Definition: tcdconnectionconverter.h:22
void operator()(adore_if_ros_msg::TCDConnectionStateTraceConstPtr msg, adore::env::ControlledConnection &con)
Definition: tcdconnectionconverter.h:23
adore_if_ros_msg::TCDConnectionStateTrace operator()(const adore::env::ControlledConnection &con)
Definition: tcdconnectionconverter.h:49