c++ - 错误:“IGN_PROFILE”未在此范围内声明
问题描述
在我的代码中,我检查了两次所有大括号是否平衡。缩进为 2 个空格。尽管如此,我还是收到了这个奇怪的编译错误
error: ‘IGN_PROFILE’ was not declared in this scope
我的代码
void amcl::PostUpdate(const ignition::gazebo::UpdateInfo &_info,ignition::gazebo::EntityComponentManager &_ecm)
{
IGN_PROFILE("amcl::PostUpdate"); ---->Error in this line
// Nothing left to do if paused.
if (_info.paused)
{
return;
}
this->dataPtr->updateAmclPose();
}
bool amcl::updateAmclPose()
{
IGN_PROFILE("amcl::updateAmclPose"); ---->Error in this line
bool isok {false};
try
{
if(tfBuffer_.canTransform(fixed_frame_, robot_frame_, ros::Time(0)))
{
read_transformation_ = tfBuffer_.lookupTransform(fixed_frame_, robot_frame_, ros::Time(0), ros::Duration(60.0));
msg_.header.frame_id = fixed_frame_;
msg_.header.stamp = ros::Time::now();
msg_.pose.pose.position.x = read_transformation_.transform.translation.x;
msg_.pose.pose.position.y = read_transformation_.transform.translation.y;
msg_.pose.pose.position.z = read_transformation_.transform.translation.z;
msg_.pose.pose.orientation.x = read_transformation_.transform.rotation.x;
msg_.pose.pose.orientation.y = read_transformation_.transform.rotation.y;
msg_.pose.pose.orientation.z = read_transformation_.transform.rotation.z;
msg_.pose.pose.orientation.w = read_transformation_.transform.rotation.w;
}
isok = true;
}
catch(const tf2::TimeoutException & e)
{
ROS_ERROR_STREAM(ros::this_node::getName() << " " << __func__ <<" timeout exception: " << e.what());
return isok;
}
catch(const tf2::TransformException & e)
{
ROS_ERROR_STREAM(ros::this_node::getName() << " " << __func__ <<" transform exception: " << e.what());
return isok;
}
return isok;
}
PS:我已经在代码中标记了引发此错误的行。我知道这是一个有点愚蠢的问题,但我已经尝试了一切,但仍然无法摆脱这个错误。
有人可以帮忙吗?谢谢
解决方案
推荐阅读
- solr - 如何在 solrj 中添加多值文字
- sqlite - 用于 Sqlite 新记录 GUI 的数据库浏览器
- c++ - 如何强制 GCC 假设浮点表达式是非负的?
- python - tensorflow 在导入窗口上失败
- ios - Deeplink 只是打开应用程序,但不打印快速操作所需的组件
- c - 使用 popen / pclose 的可执行文件作为可执行文件运行良好,但作为服务失败
- node.js - 如何在 LB4 中设置超时?
- javascript - Can't edit the newly added rows
- regex - 如何使正则表达式分组找到所有出现的地方?
- javascript - 如何在 TypeScript/Javascript 中递归地迭代对象数组