ros_robot_localization_listener.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, TNO IVS Helmond.
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
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following
13  * disclaimer in the documentation and/or other materials provided
14  * with the distribution.
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ROBOT_LOCALIZATION_ROS_ROBOT_LOCALIZATION_LISTENER_H
34 #define ROBOT_LOCALIZATION_ROS_ROBOT_LOCALIZATION_LISTENER_H
35 
37 
38 #include <string>
39 
40 #include <ros/ros.h>
43 #include <nav_msgs/Odometry.h>
44 #include <geometry_msgs/AccelWithCovarianceStamped.h>
46 
47 namespace RobotLocalization
48 {
49 
59 {
60 public:
67 
73 
85  bool getState(const double time, const std::string& frame_id,
86  Eigen::VectorXd& state, Eigen::MatrixXd& covariance,
87  std::string world_frame_id = "") const;
88 
100  bool getState(const ros::Time& ros_time, const std::string& frame_id,
101  Eigen::VectorXd& state, Eigen::MatrixXd& covariance,
102  const std::string& world_frame_id = "") const;
103 
108  const std::string& getBaseFrameId() const;
109 
114  const std::string& getWorldFrameId() const;
115 
116 private:
125  void odomAndAccelCallback(const nav_msgs::Odometry& odom, const geometry_msgs::AccelWithCovarianceStamped& accel);
126 
131 
135 
139 
143 
147 
151 
154  std::string base_frame_id_;
155 
158  std::string world_frame_id_;
159 
163 
167 };
168 
169 } // namespace RobotLocalization
170 
171 #endif // ROBOT_LOCALIZATION_ROS_ROBOT_LOCALIZATION_LISTENER_H
std::string world_frame_id_
Frame id received from the odometry message.
bool getState(const double time, const std::string &frame_id, Eigen::VectorXd &state, Eigen::MatrixXd &covariance, std::string world_frame_id="") const
Get a state from the localization estimator.
ros::NodeHandle nh_p_
A private handle to the ROS node.
message_filters::Subscriber< geometry_msgs::AccelWithCovarianceStamped > accel_sub_
Subscriber to the acceleration state topic (output of a filter node)
ros::NodeHandle nh_
A public handle to the ROS node.
const std::string & getBaseFrameId() const
getBaseFrameId Returns the base frame id of the localization listener
void odomAndAccelCallback(const nav_msgs::Odometry &odom, const geometry_msgs::AccelWithCovarianceStamped &accel)
Callback for odom and accel.
tf2_ros::TransformListener tf_listener_
Transform listener to fill the tf_buffer.
message_filters::TimeSynchronizer< nav_msgs::Odometry, geometry_msgs::AccelWithCovarianceStamped > sync_
Waits for both an Odometry and an Accel message before calling a single callback function.
RobotLocalizationEstimator * estimator_
The core state estimator that facilitates inter- and extrapolation between buffered states...
const std::string & getWorldFrameId() const
getWorldFrameId Returns the world frame id of the localization listener
tf2_ros::Buffer tf_buffer_
Tf buffer for looking up transforms.
std::string base_frame_id_
Child frame id received from the Odometry message.
message_filters::Subscriber< nav_msgs::Odometry > odom_sub_
Subscriber to the odometry state topic (output of a filter node)


robot_localization
Author(s): Tom Moore
autogenerated on Wed Feb 3 2021 03:34:02