mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
fix wierd calibration effect due to low velocity filter
This commit is contained in:
parent
6b12e17cfc
commit
b0fa26e390
1 changed files with 1 additions and 3 deletions
|
@ -18,7 +18,7 @@ namespace controller {
|
|||
|
||||
Pose LowVelocityFilter::apply(Pose newPose) const {
|
||||
Pose finalPose = newPose;
|
||||
if (finalPose.isValid()) {
|
||||
if (finalPose.isValid() && _oldPose.isValid()) {
|
||||
float rotationFilter = glm::clamp(1.0f - (glm::length(_oldPose.getVelocity() / _rotationConstant)), 0.0f, 1.0f);
|
||||
float translationFilter = glm::clamp(1.0f - (glm::length(_oldPose.getVelocity() / _translationConstant)), 0.0f, 1.0f);
|
||||
finalPose.translation = _oldPose.getTranslation() * translationFilter + newPose.getTranslation() * (1.0f - translationFilter);
|
||||
|
@ -35,11 +35,9 @@ namespace controller {
|
|||
if (obj.contains(JSON_ROTATION) && obj.contains(JSON_TRANSLATION)) {
|
||||
_rotationConstant = obj[JSON_ROTATION].toDouble();
|
||||
_translationConstant = obj[JSON_TRANSLATION].toDouble();
|
||||
qDebug() << "--------->Successfully parsed low velocity filter";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
qDebug() << "--------->failed parsed low velocity filter";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue