costmap_2d
–> 代价地图
costmap_2d::Costmap2DROS
是 costmap_2d::Costmap2D
的封装
namespace costmap_2d;
构造函数
Costmap2DROS (std::string name, tf::TransformListener &tf)
name
: map的名字
tf
: 一个TransformListener的引用
实例
tf::TransformListener tf(ros::Duration(10));
costmap_2d::Costmap2DROS costmap("my_costmap", tf);
// 来自ros官方
bool getRobotPose(tf::Stamped<tf::Pose>& global_pose) const;
/**
* @brief Get the pose of the robot in the global frame of the costmap
* @param global_pose Will be set to the pose of the robot in the global frame of the costmap
* @return True if the pose was set successfully, false otherwise
*/
bool getRobotPose(tf::Stamped<tf::Pose>& global_pose) const;
返回值 : 是否成功获得机器人的位置
参数 : 一个tf::Stamped<tf::Pose>
以记录位置
std::string getGlobalFrameID()
/**
* @brief Returns the global frame of the costmap
* @return The global frame of the costmap
*/
std::string getGlobalFrameID()
{
return global_frame_;
}
获取全局参考系的名称