Exemplo n.º 1
0
bool loadKeyframes(
  KeyframeVector& keyframes, 
  const std::string& path)
{
  keyframes.clear();

  int kf_idx = 0;

  while(true)
  {
    std::stringstream ss_idx;
    ss_idx << std::setw(4) << std::setfill('0') << kf_idx;

    std::string path_kf = path + "/" + ss_idx.str();

    if (boost::filesystem::exists(path_kf))
    {
      ROS_INFO("Loading %s", path_kf.c_str());
      RGBDKeyframe keyframe;
      bool result_load = RGBDKeyframe::load(keyframe, path_kf);
      if (result_load) keyframes.push_back(keyframe);
      else
      {
        ROS_WARN("Error loading"); 
        return false;
      }
    } 
    else return true;

    kf_idx++;
  }
}