linear_pose_filter_2d.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Fetch Robotics Inc.
3  * Author: Griswald Brooks
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef FETCH_AUTO_DOCK_LINEAR_POSE_FILTER_H
20 #define FETCH_AUTO_DOCK_LINEAR_POSE_FILTER_H
21 
22 // STL includes.
23 #include <vector>
24 #include <deque>
25 
26 // ROS includes.
27 #include <geometry_msgs/Pose.h>
28 
29 // Boost includes.
30 #include <boost/shared_ptr.hpp>
31 
33 {
34 public:
43  LinearPoseFilter2D(const std::vector<float>& b, const std::vector<float>& a);
44 
53  void setCoeff(const std::vector<float>& b, const std::vector<float>& a);
54 
61  geometry_msgs::Pose filter(const geometry_msgs::Pose& pose);
62 
67  void reset();
68 
75  void setFilterState(const geometry_msgs::Pose& input_pose, const geometry_msgs::Pose& output_pose);
76 
96  void setFilterState(const std::vector<geometry_msgs::Pose>& input_poses,
97  const std::vector<geometry_msgs::Pose>& output_poses);
98 
104  void setFilterState(const geometry_msgs::Pose& input_pose);
105  void setFilterState(const std::vector<geometry_msgs::Pose>& input_poses);
106 private:
112  geometry_msgs::Pose originPose();
113 
126  float getUnnormalizedYaw(geometry_msgs::Pose pose, float reference_yaw);
127 
133  float getNewestOutputYaw();
134 
135  std::deque<geometry_msgs::Pose> out_;
136  std::deque<geometry_msgs::Pose> in_;
137  std::deque<float> yaw_out_;
138  std::deque<float> yaw_in_;
139  std::vector<float> b_;
140  std::vector<float> a_;
141 };
142 
144 
145 #endif // FETCH_AUTO_DOCK_LINEAR_POSE_FILTER_H
float getNewestOutputYaw()
Method to get the most recent filtered unnormalized yaw. If the filter has never produced an output b...
void reset()
Method to reset the filter to ensure that if the filter is being reused, it is not corrupted by old v...
geometry_msgs::Pose filter(const geometry_msgs::Pose &pose)
Method to filter pose objects. Filter only filters position.x, position.y and the yaw of the pose...
std::deque< geometry_msgs::Pose > in_
Vector of previous output poses.
float getUnnormalizedYaw(geometry_msgs::Pose pose, float reference_yaw)
Method to return the unnormalized/wrapped-up yaw.
std::deque< geometry_msgs::Pose > out_
std::deque< float > yaw_in_
Vector of previous output yaws that aren&#39;t normalized.
void setCoeff(const std::vector< float > &b, const std::vector< float > &a)
Method to set the filter coefficients.
pose
std::vector< float > b_
Vector of previous input yaws that aren&#39;t normalized.
geometry_msgs::Pose originPose()
Method to get origin pose.
void setFilterState(const geometry_msgs::Pose &input_pose, const geometry_msgs::Pose &output_pose)
Method to set the sample history of the filter to some state. All of the sample histories will be set...
std::vector< float > a_
Vector of input coefficients.
LinearPoseFilter2D(const std::vector< float > &b, const std::vector< float > &a)
Constructor for LinearPoseFilter2D.
std::deque< float > yaw_out_
Vector of previous input poses.
boost::shared_ptr< LinearPoseFilter2D > LinearPoseFilter2DPtr


caster_app
Author(s): Ye Tian
autogenerated on Wed Dec 18 2019 03:34:44