l_shape_tracker.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, Robobrain.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 /* Author: Konstantinos Konstantinidis */
31 
32 #pragma once
33 
34 #include "kalman-cpp/kalman.hpp"
35 #include <Eigen/Dense>
36 #include <ros/console.h>
37 
38 using namespace Eigen;
39 
40 typedef std::pair<double, double> Point;
41 typedef Eigen::Matrix<double, 6, 1> Vector6d;
42 
43 const double pi = 3.141592653589793238463;
44 
46 public:
47 
48  LshapeTracker(const double& x_corner, const double& y_corner, const double& L1, const double& L2, const double& theta, const double& dt);
49  LshapeTracker();
50  void update(const double& thetaL1, const double& x_corner, const double& y_corner, const double& L1, const double& L2, const double& dt, const int cluster_size);
51  void BoxModel(double& x, double& y,double& vx, double& vy,double& theta, double& psi, double& omega, double& L1, double& L2, double& length, double& width);
52 
53 private:
55  double test1, test2, test3;
56  double x_old, y_old, L1_old, L2_old, old_thetaL1;
57 
60 
61  void ClockwisePointSwitch();
62  void CounterClockwisePointSwitch();
63  double findTurn(const double& new_angle, const double& old_angle);
64  void detectCornerPointSwitch(const double& from, const double& to, const double dt);
65  void detectCornerPointSwitchMahalanobis(const double& from, const double& to, const double dt);
66  void detectCornerPointSwitchMahalanobis(const double& from, const double& to, const double L1, const double L2, const double x_corner, const double y_corner);
77  void findOrientation(double& psi, double& length, double& width);
78 };
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
KalmanFilter shape_kf
const double pi
KalmanFilter dynamic_kf
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
std::pair< double, double > Point
Eigen::Matrix< double, 6, 1 > Vector6d


datmo
Author(s): Kostas Konstantinidis
autogenerated on Tue May 2 2023 02:58:06