Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scale estimation calculation #62

Open
wants to merge 1 commit into
base: indigo-devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/stateestimation/PTAMWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,6 @@ void PTAMWrapper::HandleFrame()
filterPosePostPTAM = filter->getCurrentPoseSpeedAsVec();
pthread_mutex_unlock( &filter->filter_CS );

TooN::Vector<6> filterPosePostPTAMBackTransformed = filter->backTransformPTAMObservation(filterPosePostPTAM.slice<0,6>());


// if interval is started: add one step.
int includedTime = mimFrameTime_workingCopy - ptamPositionForScaleTakenTimestamp;
Expand All @@ -451,7 +449,7 @@ void PTAMWrapper::HandleFrame()

if(includedTime >= 2000 && framesIncludedForScaleXYZ > 1) // ADD! (if too many, was resetted before...)
{
TooN::Vector<3> diffPTAM = filterPosePostPTAMBackTransformed.slice<0,3>() - PTAMPositionForScale;
TooN::Vector<3> diffPTAM = PTAMResult.slice<0,3>() - PTAMPositionForScale;
bool zCorrupted, allCorrupted;
float pressureStart = 0, pressureEnd = 0;
TooN::Vector<3> diffIMU = evalNavQue(ptamPositionForScaleTakenTimestamp - filter->delayVideo + filter->delayXYZ,mimFrameTime_workingCopy - filter->delayVideo + filter->delayXYZ,&zCorrupted, &allCorrupted, &pressureStart, &pressureEnd);
Expand Down Expand Up @@ -484,7 +482,7 @@ void PTAMWrapper::HandleFrame()
if(framesIncludedForScaleXYZ == -1) // RESET!
{
framesIncludedForScaleXYZ = 0;
PTAMPositionForScale = filterPosePostPTAMBackTransformed.slice<0,3>();
PTAMPositionForScale = PTAMResult.slice<0,3>();
//predIMUOnlyForScale->resetPos(); // also resetting z corrupted flag etc. (NOT REquired as reset is done in eval)
ptamPositionForScaleTakenTimestamp = mimFrameTime_workingCopy;
}
Expand Down