Apollo  6.0
Open source self driving car software
mlf_motion_refiner.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 The Apollo Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *****************************************************************************/
16 #pragma once
17 
18 #include <string>
19 
21 
22 namespace apollo {
23 namespace perception {
24 namespace lidar {
25 
27 
29 
31  public:
32  MlfMotionRefiner() = default;
33  ~MlfMotionRefiner() = default;
34 
35  bool Init(const MlfMotionRefinerInitOptions& options =
37 
38  // @brief: refine velocity of new object
39  // @params [in]: history track data
40  // @params [in]: new object to be updated
41  // @return: true if velocity is changed
42  bool Refine(const MlfTrackDataConstPtr& track_data,
43  TrackedObjectPtr new_object);
44 
45  std::string Name() const { return "MlfMotionRefiner"; }
46 
47  protected:
48  // @brief: check whether new observed object is static or not
49  // @params[in]: latest history object
50  // @params[in]: new object to be updated
51  // @return: true if new object is static
52  bool CheckStaticHypothesisByState(
53  const TrackedObjectConstPtr& latest_object,
54  const TrackedObjectConstPtr& new_object) const;
55 
56  // @brief: check whether new observed object is static or not via
57  // considering the angle velocity change
58  // @params [in]: latest history object
59  // @params [in]: new object to be updated
60  // @params [in]: max allowed angle change threshold
61  // @return: true if new object is static
62  bool CheckStaticHypothesisByVelocityAngleChange(
63  const TrackedObjectConstPtr& latest_object,
64  const TrackedObjectConstPtr& new_object,
65  double reasonable_angle_change_maximum) const;
66 
67  protected:
68  double claping_acceleration_threshold_ = 10;
69  double claping_speed_threshold_ = 1.0;
70  const double EPSION_TIME = 1e-3;
71 }; // class MlfMotionRefiner
72 
73 } // namespace lidar
74 } // namespace perception
75 } // namespace apollo
std::string Name() const
Definition: mlf_motion_refiner.h:45
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: mlf_motion_refiner.h:30
std::shared_ptr< const MlfTrackData > MlfTrackDataConstPtr
Definition: mlf_track_data.h:118
bool Init(const char *binary_name)
Definition: mlf_motion_refiner.h:28
std::shared_ptr< const TrackedObject > TrackedObjectConstPtr
Definition: tracked_object.h:157
std::shared_ptr< TrackedObject > TrackedObjectPtr
Definition: tracked_object.h:156