您的位置:首页 > 其它

简单的ros::tf介绍

2017-02-18 16:27 176 查看
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_;
}


获取全局参考系的名称
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: