Skip to content

Commit

Permalink
Disable jump filter for eye gaze
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra committed Oct 25, 2024
1 parent 3c1d8f2 commit 96baf8b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/devices/openxrheadset/FilteredPosePublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ void FilteredPosePublisher::updateInputPose(const OpenXrInterface::NamedPoseVelo
{
return;
}

PosePublisher::updateInputPose(filterJumps(input));
switch (input.filterType)
{
case PoseFilterType::JumpFilter:
PosePublisher::updateInputPose(filterJumps(input));
break;
default:
PosePublisher::updateInputPose(input);
break;
}
}
2 changes: 1 addition & 1 deletion src/devices/openxrheadset/OpenXrInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ bool OpenXrInterface::prepareXrActions()

gazeInputs.poses =
{
{"/input/gaze_ext/pose", "pose"}
{"/input/gaze_ext/pose", "pose", PoseFilterType::None}
};

TopLevelPathDeclaration gaze;
Expand Down
7 changes: 7 additions & 0 deletions src/devices/openxrheadset/OpenXrInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ class IOpenXrQuadLayer
virtual void setEnabled(bool enabled) = 0;
};

enum class PoseFilterType
{
None,
JumpFilter,
};

struct OpenXrInterfaceSettings
{
double posesPredictionInMs{0.0};
Expand Down Expand Up @@ -142,6 +148,7 @@ class OpenXrInterface
std::string name;
Pose pose;
Velocity velocity;
PoseFilterType filterType;

static NamedPoseVelocity Identity(const std::string& name);
};
Expand Down
1 change: 1 addition & 0 deletions src/devices/openxrheadset/impl/OpenXrInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ bool OpenXrInterface::Implementation::fillActionBindings(const std::vector<Inter
bindings.emplace_back();
bindings.back().action = newAction.xrAction;
bindings.back().binding = xrPath;
newAction.filterType = input.filterType;
}

for (auto& input : actionDeclaration.buttons)
Expand Down
7 changes: 6 additions & 1 deletion src/devices/openxrheadset/impl/OpenXrInterfaceImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,14 @@ struct ActionDeclaration
std::string nameSuffix;
};

struct PoseActionDeclaration : public ActionDeclaration
{
PoseFilterType filterType{ PoseFilterType::JumpFilter };
};

struct InputActionsDeclaration
{
std::vector<ActionDeclaration> poses;
std::vector<PoseActionDeclaration> poses;

std::vector<ActionDeclaration> buttons;

Expand Down

0 comments on commit 96baf8b

Please sign in to comment.