ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
vectoridentifier.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 implementation and API
13  ********************************************************************************/
14 
15 
16 #pragma once
17 #include <adore/mad/adoremath.h>
18 #include <boost/geometry.hpp>
19 #include <boost/geometry/geometries/point.hpp>
20 #include <boost/geometry/geometries/box.hpp>
21 
22 namespace adore
23 {
24  namespace env
25  {
30  {
31  public:
32  typedef boost::geometry::model::point<double,6,boost::geometry::cs::cartesian> Tboost_vectors;
33  typedef boost::geometry::model::point<double,3,boost::geometry::cs::cartesian> Tboost_point;
34  private:
37  public:
38  VectorIdentifier(double x0,double y0,double z0,double x1,double y1,double z1)
39  {
40  id_.set<0>(x0);
41  id_.set<1>(y0);
42  id_.set<2>(z0);
43  id_.set<3>(x1);
44  id_.set<4>(y1);
45  id_.set<5>(z1);
46  precision_.set<0>(1.0);
47  precision_.set<1>(1.0);
48  precision_.set<2>(3.0);
49  precision_.set<3>(1.0);
50  precision_.set<4>(1.0);
51  precision_.set<5>(3.0);
52  }
53  bool equals(const VectorIdentifier& other)const
54  {
55  return
56  (std::abs)(this->id_.get<0>()-other.id_.get<0>())<this->precision_.get<0>()
57  && (std::abs)(this->id_.get<1>()-other.id_.get<1>())<this->precision_.get<1>()
58  && (std::abs)(this->id_.get<2>()-other.id_.get<2>())<this->precision_.get<2>()
59  && (std::abs)(this->id_.get<3>()-other.id_.get<3>())<this->precision_.get<3>()
60  && (std::abs)(this->id_.get<4>()-other.id_.get<4>())<this->precision_.get<4>()
61  && (std::abs)(this->id_.get<5>()-other.id_.get<5>())<this->precision_.get<5>();
62  }
63  const Tboost_vectors& getPrecision()const{return precision_;}
64  const Tboost_vectors& getID()const {return id_;}
65  Tboost_point getFrom()const{return Tboost_point(id_.get<0>(),id_.get<1>(),id_.get<2>());}
66  Tboost_point getTo()const {return Tboost_point(id_.get<3>(),id_.get<4>(),id_.get<5>());}
67 
68  };
69  }
70 }
x0
Definition: adore_set_goal.py:25
y0
Definition: adore_set_goal.py:26
z0
Definition: adore_set_goal.py:27
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
z1
Definition: adore_set_pose.py:30
Definition: areaofeffectconverter.h:20
Definition: vectoridentifier.h:30
VectorIdentifier(double x0, double y0, double z0, double x1, double y1, double z1)
Definition: vectoridentifier.h:38
boost::geometry::model::point< double, 3, boost::geometry::cs::cartesian > Tboost_point
Definition: vectoridentifier.h:33
Tboost_vectors precision_
Definition: vectoridentifier.h:36
boost::geometry::model::point< double, 6, boost::geometry::cs::cartesian > Tboost_vectors
Definition: vectoridentifier.h:32
bool equals(const VectorIdentifier &other) const
Definition: vectoridentifier.h:53
Tboost_point getFrom() const
Definition: vectoridentifier.h:65
Tboost_point getTo() const
Definition: vectoridentifier.h:66
const Tboost_vectors & getPrecision() const
Definition: vectoridentifier.h:63
const Tboost_vectors & getID() const
Definition: vectoridentifier.h:64
Tboost_vectors id_
Definition: vectoridentifier.h:35