Skip to content

Commit

Permalink
test capabilities are a go
Browse files Browse the repository at this point in the history
  • Loading branch information
Loeing committed Feb 24, 2016
1 parent 8b63cc4 commit 3f86602
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 14 deletions.
8 changes: 6 additions & 2 deletions include/LocalMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
#include "Tracking.h"
#include <boost/thread.hpp>
#include "KeyFrameDatabase.h"
//#include "ProbabilityMapping.h"


class ProbabilityMapping;

namespace ORB_SLAM
{

Expand Down Expand Up @@ -89,14 +92,15 @@ class LocalMapping

LoopClosing* mpLoopCloser;
Tracking* mpTracker;

ProbabilityMapping* mpProbabilityMapper;

std::list<KeyFrame*> mlNewKeyFrames;

KeyFrame* mpCurrentKeyFrame;

std::list<MapPoint*> mlpRecentAddedMapPoints;

boost::mutex mMutexNewKFs;
boost::mutex mMutexNewKFs;

bool mbAbortBA;

Expand Down
5 changes: 3 additions & 2 deletions include/ProbabilityMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@

namespace ORB_SLAM {
class KeyFrame;
}
}

namespace cv {
class Mat;
}


class ProbabilityMapping {
public:

struct depthHo {
float depth;
float sigma;
};
};

ProbabilityMapping();
/* * \brief void first_loop(ORB_SLAM::KeyFrame kf, depthHo**, std::vector<depthHo>*): return results of epipolar search (depth hypotheses) */
Expand Down
19 changes: 14 additions & 5 deletions src/LocalMapping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace ORB_SLAM

LocalMapping::LocalMapping(Map *pMap):
mbResetRequested(false), mpMap(pMap), mbAbortBA(false), mbStopped(false), mbStopRequested(false), mbAcceptKeyFrames(true)
{
}
{
}

void LocalMapping::SetLoopCloser(LoopClosing* pLoopCloser)
{
Expand Down Expand Up @@ -82,14 +82,23 @@ void LocalMapping::Run()
// Tracking will see Local Mapping idle
if(!CheckNewKeyFrames())
{
cout << "No new keyframes\n";
SetAcceptKeyFrames(true);

//TODO actually turn this into a Thread
/* vector<KeyFrame*> vpKFs = mpMap -> GetAllKeyFrames();
ProbabilityMapping::detphHo*** hypothesisMatrix;
vector<ProbabilityMapping::depthHo*>* hypothesisSupport;
for(size_t i=0; i<vpKFs.size(); i++)
{
cout << "We have keyframes\n";
ORB_SLAM::KeyFrame* pKF = vpKFs[i];
if(pKF->isBad())
continue;
ProbabilityMapper.FirstLoop(pKF,hypothesisMatrix,hypothesisSupport);
}
continue;
cout << "we are doing the Mapping\n";
mpProbabilityMapper -> FirstLoop(pKF,hypothesisMatrix,hypothesisSupport);
}
*/
}
}

Expand Down
24 changes: 19 additions & 5 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,30 @@ int main(int argc, char **argv)
fps=30;

ros::Rate r(fps);


int count = 0;
std::vector<ProbabilityMapping::depthHo*> *hypothesisSupport;
ProbabilityMapping::depthHo ***hypothesisMatrix;//FIXME
while (ros::ok())
{
FramePub.Refresh();
MapPub.Refresh();
Tracker.CheckResetByPublishers();
r.sleep();
r.sleep();
if(count%300000 == 0){
cout << "Loop!\n";
vector<ORB_SLAM::KeyFrame*> vpKFs = World.GetAllKeyFrames();
for(size_t i = 0; i <vpKFs.size(); i++)
{
cout << "We have keyframes!\n";
ORB_SLAM::KeyFrame* pKF = vpKFs[i];
if(pKF->isBad())
continue;
cout << "Mapping...\n";
ProbabilityMapper.FirstLoop(pKF,hypothesisMatrix,hypothesisSupport);
}

}
}

// Save keyframe poses at the end of the execution
Expand Down Expand Up @@ -187,9 +204,6 @@ int main(int argc, char **argv)

}

std::vector<ProbabilityMapping::depthHo*> *hypothesisSupport;
ProbabilityMapping::depthHo ***hypothesisMatrix;//FIXME

f.close();

ros::shutdown();
Expand Down

0 comments on commit 3f86602

Please sign in to comment.