Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87a3c5f

Browse files
authored
Added optional Velocity fields to Protobuf Position Message (Natural Locomotion Support) (#64)
* Add NaLo velocity/acceleration support with spike clamping * Revert "Add NaLo velocity/acceleration support with spike clamping" This reverts commit da988e3. * Added support for derived Velocity in Protobuf Message
1 parent ef2c9ed commit 87a3c5f

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/TrackerDevice.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ void SlimeVRDriver::TrackerDevice::PositionMessage(messages::Position &position)
5555
pose.qRotation.y = position.qy();
5656
pose.qRotation.z = position.qz();
5757

58+
if (position.has_vx()) {
59+
pose.vecVelocity[0] = position.vx();
60+
pose.vecVelocity[1] = position.vy();
61+
pose.vecVelocity[2] = position.vz();
62+
}
63+
else { // If velocity isn't being sent, don't keep stale values
64+
pose.vecVelocity[0] = 0.0f; pose.vecVelocity[1] = 0.0f; pose.vecVelocity[2] = 0.0f;
65+
}
66+
5867
auto current_universe = GetDriver()->GetCurrentUniverse();
5968
if (current_universe.has_value()) {
6069
auto trans = current_universe.value();

src/bridge/ProtobufMessages.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ message Position {
7474
FULL = 3;
7575
}
7676
optional DataSource data_source = 9;
77+
optional float vx = 10;
78+
optional float vy = 11;
79+
optional float vz = 12;
7780
}
7881

7982
message UserAction {

0 commit comments

Comments
 (0)