ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
gearselectioncommandconverter.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  * Jan Lauermann - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 
17 #include <adore/fun/afactory.h>
19 #include <adore_if_ros_msg/NavigationGoal.h>
20 #include <adore_if_ros_msg/SetPointRequest.h>
21 #include <adore_if_ros_msg/TerminalRequest.h>
22 #include <adore_if_ros_msg/WheelSpeed.h>
23 #include <tf/tf.h>
24 #include <tf/LinearMath/Quaternion.h>
25 #include <std_msgs/Float64.h>
26 #include <std_msgs/Float32.h>
27 #include <std_msgs/Int8.h>
28 #include <std_msgs/Bool.h>
29 #include <nav_msgs/Odometry.h>
30 
31 namespace adore
32 {
33  namespace if_ROS
34  {
39  {
40 
44  std_msgs::Int8 operator()(const adore::fun::GearSelectionCommand& cmd)
45  {
46  std_msgs::Int8 msg;
47  switch(cmd.getGear())
48  {
50  msg.data = 0;
51  break;
53  msg.data = 1;
54  break;
56  msg.data = 2;
57  break;
59  msg.data = 3;
60  break;
61  default:
62  msg.data = 0;
63  break;
64  }
65  return msg;
66  }
67 
71  void operator()(std_msgs::Int8ConstPtr msg,adore::fun::GearSelectionCommand* cmd)
72  {
73  switch(msg.get()->data)
74  {
75  case 0:
77  break;
78  case 1:
80  break;
81  case 2:
83  break;
84  case 3:
86  break;
87  default:
89  break;
90  }
91  }
92 
93  };
94  }
95 }
@ Drive
Definition: vehicleextendedstate.h:30
@ Park
Definition: vehicleextendedstate.h:30
@ Neutral
Definition: vehicleextendedstate.h:30
@ Reverse
Definition: vehicleextendedstate.h:30
Definition: areaofeffectconverter.h:20
Definition: gearselectioncommand.h:26
void setGear(VehicleExtendedState::GearState gear)
Definition: gearselectioncommand.h:35
VehicleExtendedState::GearState getGear() const
Definition: gearselectioncommand.h:31
Definition: gearselectioncommandconverter.h:39
std_msgs::Int8 operator()(const adore::fun::GearSelectionCommand &cmd)
Definition: gearselectioncommandconverter.h:44
void operator()(std_msgs::Int8ConstPtr msg, adore::fun::GearSelectionCommand *cmd)
Definition: gearselectioncommandconverter.h:71