update
This commit is contained in:
@@ -27,20 +27,30 @@ void amr_control::TfConverter::tfWorker()
|
|||||||
std::string tree;
|
std::string tree;
|
||||||
std::string line;
|
std::string line;
|
||||||
|
|
||||||
|
int count_tf_receive_done = 0;
|
||||||
ros::Rate rate(20);
|
ros::Rate rate(20);
|
||||||
while (ros::ok() && !stop_tf_thread_)
|
while (ros::ok() && !stop_tf_thread_)
|
||||||
{
|
{
|
||||||
tree = tfBuffer.allFramesAsString();
|
ros::spinOnce();
|
||||||
|
tree = tfBuffer.allFramesAsString();
|
||||||
|
if (!tree.empty() && tree == last_tree)
|
||||||
|
{
|
||||||
|
count_tf_receive_done++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
count_tf_receive_done = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!tree.empty() && tree == last_tree)
|
if(count_tf_receive_done > 2)
|
||||||
{
|
{
|
||||||
// ROS_WARN("TF tree stabilized: \n%s", tree.c_str());
|
ROS_WARN("TF tree stabilized: \n%s", tree.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
last_tree = tree;
|
last_tree = tree;
|
||||||
ros::spinOnce();
|
|
||||||
rate.sleep();
|
rate.sleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::istringstream iss(tree);
|
std::istringstream iss(tree);
|
||||||
|
|||||||
Submodule pnkx_nav_core updated: b7e4c73c14...34cabd2083
Reference in New Issue
Block a user