Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include "mbf_abstract_nav/robot_information.h"
00040 #include "mbf_utility/navigation_utility.h"
00041
00042 namespace mbf_abstract_nav{
00043
00044 RobotInformation::RobotInformation(TF &tf_listener,
00045 const std::string &global_frame,
00046 const std::string &robot_frame,
00047 const ros::Duration &tf_timeout)
00048 : tf_listener_(tf_listener), global_frame_(global_frame), robot_frame_(robot_frame), tf_timeout_(tf_timeout)
00049 {
00050
00051 }
00052
00053
00054
00055 bool RobotInformation::getRobotPose(geometry_msgs::PoseStamped &robot_pose) const
00056 {
00057 bool tf_success = mbf_utility::getRobotPose(tf_listener_, robot_frame_, global_frame_,
00058 ros::Duration(tf_timeout_), robot_pose);
00059 robot_pose.header.stamp = ros::Time::now();
00060 if (!tf_success)
00061 {
00062 ROS_ERROR_STREAM("Can not get the robot pose in the global frame. - robot frame: \""
00063 << robot_frame_ << "\" global frame: \"" << global_frame_ << std::endl);
00064 return false;
00065 }
00066 return true;
00067 }
00068
00069 bool RobotInformation::getRobotVelocity(geometry_msgs::TwistStamped &robot_velocity, ros::Duration look_back_duration) const
00070 {
00071
00072 return false;
00073 }
00074
00075 const std::string& RobotInformation::getGlobalFrame() const {return global_frame_;};
00076
00077 const std::string& RobotInformation::getRobotFrame() const {return robot_frame_;};
00078
00079 const TF& RobotInformation::getTransformListener() const {return tf_listener_;};
00080
00081 const ros::Duration& RobotInformation::getTfTimeout() const {return tf_timeout_;}
00082
00083 }