rtabmapviz: automatically read parameters from ros param server when receiving a map (fixing occupancy grid cell size not correctly set if rtabmapviz is started before rtabmap node, without having to open Preferences dialog and click apply to refresh the gui parameters)

This commit is contained in:
matlabbe
2022-01-26 15:42:07 -05:00
parent 293cfcf654
commit 5ce48e201a
4 changed files with 59 additions and 6 deletions
+4 -2
View File
@@ -741,6 +741,7 @@ void MapCloudDisplay::update( float wall_dt, float ros_dt )
cloudInfoIt->second->pose_ = it->second;
Ogre::Vector3 framePosition;
Ogre::Quaternion frameOrientation;
std::string error;
if (context_->getFrameManager()->getTransform(cloudInfoIt->second->message_->header, framePosition, frameOrientation))
{
// Multiply frame with pose
@@ -761,11 +762,12 @@ void MapCloudDisplay::update( float wall_dt, float ros_dt )
cloudInfoIt->second->scene_node_->setVisible(true);
++totalNodesShown;
}
else
else if(context_->getFrameManager()->frameHasProblems(cloudInfoIt->second->message_->header.frame_id, cloudInfoIt->second->message_->header.stamp, error))
{
ROS_ERROR("MapCloudDisplay: Could not update pose of node %d (cannot transform pose in target frame id \"%s\", set fixed frame in global options to \"%s\")",
ROS_ERROR("MapCloudDisplay: Could not update pose of node %d (cannot transform pose in target frame id \"%s\" (reason=%s), set fixed frame in global options to \"%s\")",
it->first,
cloudInfoIt->second->message_->header.frame_id.c_str(),
error.c_str(),
cloudInfoIt->second->message_->header.frame_id.c_str());
}
}