ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
envvehiclemotionstateconverter.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 
15 #pragma once
16 #include <math.h>
17 #include <tf/tf.h>
18 #include "quaternion.h"
19 #include <adore/env/afactory.h>
21 #include <adore_if_ros_msg/Border.h>
22 #include <adore_if_ros_msg/NavigationGoal.h>
23 #include <adore_if_ros_msg/SetPointRequest.h>
24 #include <adore_if_ros_msg/TerminalRequest.h>
25 #include <adore_if_ros_msg/WheelSpeed.h>
26 #include <std_msgs/Float64.h>
27 #include <std_msgs/Float32.h>
28 #include <std_msgs/Int8.h>
29 #include <std_msgs/Bool.h>
30 #include <nav_msgs/Odometry.h>
31 
32 namespace adore
33 {
34  namespace if_ROS
35  {
40  {
41  public:
46  void operator()(nav_msgs::OdometryConstPtr msg, adore::env::VehicleMotionState9d * state)
47  {
48  state->setTime(msg->header.stamp.toSec());
49  state->setX(msg->pose.pose.position.x);
50  state->setY(msg->pose.pose.position.y);
51  state->setZ(msg->pose.pose.position.z);
53  state->setPSI(qc.quaternionToHeading(msg->pose.pose));
54  state->setvx(msg->twist.twist.linear.x);
55  state->setvy(msg->twist.twist.linear.y);
56  state->setOmega(msg->twist.twist.angular.z);
57  }
58  };
59 
60 
61 
62 
63  }
64 }
Definition: areaofeffectconverter.h:20
This struct holds the motion state of the vehicle in 9d.
Definition: vehiclemotionstate9d.h:39
void setZ(double value)
Set the z-coordinate.
Definition: vehiclemotionstate9d.h:127
void setY(double value)
Set the y-coordinate.
Definition: vehiclemotionstate9d.h:121
void setvx(double value)
set the longitudinal velocity
Definition: vehiclemotionstate9d.h:139
void setOmega(double value)
Set the yaw rate.
Definition: vehiclemotionstate9d.h:151
void setX(double value)
Set the x-coordinate.
Definition: vehiclemotionstate9d.h:115
void setPSI(double value)
set the heading
Definition: vehiclemotionstate9d.h:133
void setvy(double value)
set the lateral velocity
Definition: vehiclemotionstate9d.h:145
void setTime(double value)
Set the time.
Definition: vehiclemotionstate9d.h:109
Definition: quaternion.h:28
double quaternionToHeading(const geometry_msgs::Pose &p) const
convert quaternion to heading
Definition: quaternion.h:49
Definition: envvehiclemotionstateconverter.h:40
void operator()(nav_msgs::OdometryConstPtr msg, adore::env::VehicleMotionState9d *state)
Definition: envvehiclemotionstateconverter.h:46