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

[Spine Yaw Compensation] Add settings and tracker data #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
153 changes: 147 additions & 6 deletions protocol/cpp/include/solarxr_protocol/generated/all_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -3235,7 +3235,12 @@ struct TrackerData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VT_LINEAR_ACCELERATION = 20,
VT_ROTATION_REFERENCE_ADJUSTED = 22,
VT_ROTATION_IDENTITY_ADJUSTED = 24,
VT_TPS = 26
VT_TPS = 26,
VT_STAY_ALIGNED_YAW_CORRECTION_IN_DEG = 28,
VT_STAY_ALIGNED_LOCKED_ERROR_IN_DEG = 30,
VT_STAY_ALIGNED_CENTER_ERROR_IN_DEG = 32,
VT_STAY_ALIGNED_NEIGHBOR_ERROR_IN_DEG = 34,
VT_STAY_ALIGNED_LOCKED = 36
};
const solarxr_protocol::datatypes::TrackerId *tracker_id() const {
return GetPointer<const solarxr_protocol::datatypes::TrackerId *>(VT_TRACKER_ID);
Expand Down Expand Up @@ -3292,6 +3297,22 @@ struct TrackerData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
flatbuffers::Optional<uint16_t> tps() const {
return GetOptional<uint16_t, uint16_t>(VT_TPS);
}
/// Stay Aligned
float stay_aligned_yaw_correction_in_deg() const {
return GetField<float>(VT_STAY_ALIGNED_YAW_CORRECTION_IN_DEG, 0.0f);
}
float stay_aligned_locked_error_in_deg() const {
return GetField<float>(VT_STAY_ALIGNED_LOCKED_ERROR_IN_DEG, 0.0f);
}
float stay_aligned_center_error_in_deg() const {
return GetField<float>(VT_STAY_ALIGNED_CENTER_ERROR_IN_DEG, 0.0f);
}
float stay_aligned_neighbor_error_in_deg() const {
return GetField<float>(VT_STAY_ALIGNED_NEIGHBOR_ERROR_IN_DEG, 0.0f);
}
bool stay_aligned_locked() const {
return GetField<uint8_t>(VT_STAY_ALIGNED_LOCKED, 0) != 0;
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_TRACKER_ID) &&
Expand All @@ -3308,6 +3329,11 @@ struct TrackerData FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VerifyField<solarxr_protocol::datatypes::math::Quat>(verifier, VT_ROTATION_REFERENCE_ADJUSTED, 4) &&
VerifyField<solarxr_protocol::datatypes::math::Quat>(verifier, VT_ROTATION_IDENTITY_ADJUSTED, 4) &&
VerifyField<uint16_t>(verifier, VT_TPS, 2) &&
VerifyField<float>(verifier, VT_STAY_ALIGNED_YAW_CORRECTION_IN_DEG, 4) &&
VerifyField<float>(verifier, VT_STAY_ALIGNED_LOCKED_ERROR_IN_DEG, 4) &&
VerifyField<float>(verifier, VT_STAY_ALIGNED_CENTER_ERROR_IN_DEG, 4) &&
VerifyField<float>(verifier, VT_STAY_ALIGNED_NEIGHBOR_ERROR_IN_DEG, 4) &&
VerifyField<uint8_t>(verifier, VT_STAY_ALIGNED_LOCKED, 1) &&
verifier.EndTable();
}
};
Expand Down Expand Up @@ -3352,6 +3378,21 @@ struct TrackerDataBuilder {
void add_tps(uint16_t tps) {
fbb_.AddElement<uint16_t>(TrackerData::VT_TPS, tps);
}
void add_stay_aligned_yaw_correction_in_deg(float stay_aligned_yaw_correction_in_deg) {
fbb_.AddElement<float>(TrackerData::VT_STAY_ALIGNED_YAW_CORRECTION_IN_DEG, stay_aligned_yaw_correction_in_deg, 0.0f);
}
void add_stay_aligned_locked_error_in_deg(float stay_aligned_locked_error_in_deg) {
fbb_.AddElement<float>(TrackerData::VT_STAY_ALIGNED_LOCKED_ERROR_IN_DEG, stay_aligned_locked_error_in_deg, 0.0f);
}
void add_stay_aligned_center_error_in_deg(float stay_aligned_center_error_in_deg) {
fbb_.AddElement<float>(TrackerData::VT_STAY_ALIGNED_CENTER_ERROR_IN_DEG, stay_aligned_center_error_in_deg, 0.0f);
}
void add_stay_aligned_neighbor_error_in_deg(float stay_aligned_neighbor_error_in_deg) {
fbb_.AddElement<float>(TrackerData::VT_STAY_ALIGNED_NEIGHBOR_ERROR_IN_DEG, stay_aligned_neighbor_error_in_deg, 0.0f);
}
void add_stay_aligned_locked(bool stay_aligned_locked) {
fbb_.AddElement<uint8_t>(TrackerData::VT_STAY_ALIGNED_LOCKED, static_cast<uint8_t>(stay_aligned_locked), 0);
}
explicit TrackerDataBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
Expand All @@ -3376,8 +3417,17 @@ inline flatbuffers::Offset<TrackerData> CreateTrackerData(
const solarxr_protocol::datatypes::math::Vec3f *linear_acceleration = nullptr,
const solarxr_protocol::datatypes::math::Quat *rotation_reference_adjusted = nullptr,
const solarxr_protocol::datatypes::math::Quat *rotation_identity_adjusted = nullptr,
flatbuffers::Optional<uint16_t> tps = flatbuffers::nullopt) {
flatbuffers::Optional<uint16_t> tps = flatbuffers::nullopt,
float stay_aligned_yaw_correction_in_deg = 0.0f,
float stay_aligned_locked_error_in_deg = 0.0f,
float stay_aligned_center_error_in_deg = 0.0f,
float stay_aligned_neighbor_error_in_deg = 0.0f,
bool stay_aligned_locked = false) {
TrackerDataBuilder builder_(_fbb);
builder_.add_stay_aligned_neighbor_error_in_deg(stay_aligned_neighbor_error_in_deg);
builder_.add_stay_aligned_center_error_in_deg(stay_aligned_center_error_in_deg);
builder_.add_stay_aligned_locked_error_in_deg(stay_aligned_locked_error_in_deg);
builder_.add_stay_aligned_yaw_correction_in_deg(stay_aligned_yaw_correction_in_deg);
builder_.add_rotation_identity_adjusted(rotation_identity_adjusted);
builder_.add_rotation_reference_adjusted(rotation_reference_adjusted);
builder_.add_linear_acceleration(linear_acceleration);
Expand All @@ -3389,6 +3439,7 @@ inline flatbuffers::Offset<TrackerData> CreateTrackerData(
builder_.add_info(info);
builder_.add_tracker_id(tracker_id);
if(tps) { builder_.add_tps(*tps); }
builder_.add_stay_aligned_locked(stay_aligned_locked);
builder_.add_status(status);
return builder_.Finish();
}
Expand All @@ -3407,7 +3458,8 @@ struct TrackerDataMask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VT_LINEAR_ACCELERATION = 18,
VT_ROTATION_REFERENCE_ADJUSTED = 20,
VT_ROTATION_IDENTITY_ADJUSTED = 22,
VT_TPS = 24
VT_TPS = 24,
VT_STAY_ALIGNED = 26
};
bool info() const {
return GetField<uint8_t>(VT_INFO, 0) != 0;
Expand Down Expand Up @@ -3442,6 +3494,9 @@ struct TrackerDataMask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
bool tps() const {
return GetField<uint8_t>(VT_TPS, 0) != 0;
}
bool stay_aligned() const {
return GetField<uint8_t>(VT_STAY_ALIGNED, 0) != 0;
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint8_t>(verifier, VT_INFO, 1) &&
Expand All @@ -3455,6 +3510,7 @@ struct TrackerDataMask FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
VerifyField<uint8_t>(verifier, VT_ROTATION_REFERENCE_ADJUSTED, 1) &&
VerifyField<uint8_t>(verifier, VT_ROTATION_IDENTITY_ADJUSTED, 1) &&
VerifyField<uint8_t>(verifier, VT_TPS, 1) &&
VerifyField<uint8_t>(verifier, VT_STAY_ALIGNED, 1) &&
verifier.EndTable();
}
};
Expand Down Expand Up @@ -3496,6 +3552,9 @@ struct TrackerDataMaskBuilder {
void add_tps(bool tps) {
fbb_.AddElement<uint8_t>(TrackerDataMask::VT_TPS, static_cast<uint8_t>(tps), 0);
}
void add_stay_aligned(bool stay_aligned) {
fbb_.AddElement<uint8_t>(TrackerDataMask::VT_STAY_ALIGNED, static_cast<uint8_t>(stay_aligned), 0);
}
explicit TrackerDataMaskBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
Expand All @@ -3519,8 +3578,10 @@ inline flatbuffers::Offset<TrackerDataMask> CreateTrackerDataMask(
bool linear_acceleration = false,
bool rotation_reference_adjusted = false,
bool rotation_identity_adjusted = false,
bool tps = false) {
bool tps = false,
bool stay_aligned = false) {
TrackerDataMaskBuilder builder_(_fbb);
builder_.add_stay_aligned(stay_aligned);
builder_.add_tps(tps);
builder_.add_rotation_identity_adjusted(rotation_identity_adjusted);
builder_.add_rotation_reference_adjusted(rotation_reference_adjusted);
Expand Down Expand Up @@ -6806,18 +6867,58 @@ struct YawCorrectionSettings FLATBUFFERS_FINAL_CLASS : private flatbuffers::Tabl
typedef YawCorrectionSettingsBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ENABLED = 4,
VT_AMOUNTINDEGPERSEC = 6
VT_AMOUNTINDEGPERSEC = 6,
VT_STANDINGUPPERLEGANGLE = 8,
VT_STANDINGLOWERLEGANGLE = 10,
VT_STANDINGFOOTANGLE = 12,
VT_SITTINGUPPERLEGANGLE = 14,
VT_SITTINGLOWERLEGANGLE = 16,
VT_SITTINGFOOTANGLE = 18,
VT_LYINGONBACKUPPERLEGANGLE = 20,
VT_LYINGONBACKLOWERLEGANGLE = 22
};
bool enabled() const {
return GetField<uint8_t>(VT_ENABLED, 0) != 0;
}
float amountInDegPerSec() const {
return GetField<float>(VT_AMOUNTINDEGPERSEC, 0.0f);
}
float standingUpperLegAngle() const {
return GetField<float>(VT_STANDINGUPPERLEGANGLE, 0.0f);
}
float standingLowerLegAngle() const {
return GetField<float>(VT_STANDINGLOWERLEGANGLE, 0.0f);
}
float standingFootAngle() const {
return GetField<float>(VT_STANDINGFOOTANGLE, 0.0f);
}
float sittingUpperLegAngle() const {
return GetField<float>(VT_SITTINGUPPERLEGANGLE, 0.0f);
}
float sittingLowerLegAngle() const {
return GetField<float>(VT_SITTINGLOWERLEGANGLE, 0.0f);
}
float sittingFootAngle() const {
return GetField<float>(VT_SITTINGFOOTANGLE, 0.0f);
}
float lyingOnBackUpperLegAngle() const {
return GetField<float>(VT_LYINGONBACKUPPERLEGANGLE, 0.0f);
}
float lyingOnBackLowerLegAngle() const {
return GetField<float>(VT_LYINGONBACKLOWERLEGANGLE, 0.0f);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint8_t>(verifier, VT_ENABLED, 1) &&
VerifyField<float>(verifier, VT_AMOUNTINDEGPERSEC, 4) &&
VerifyField<float>(verifier, VT_STANDINGUPPERLEGANGLE, 4) &&
VerifyField<float>(verifier, VT_STANDINGLOWERLEGANGLE, 4) &&
VerifyField<float>(verifier, VT_STANDINGFOOTANGLE, 4) &&
VerifyField<float>(verifier, VT_SITTINGUPPERLEGANGLE, 4) &&
VerifyField<float>(verifier, VT_SITTINGLOWERLEGANGLE, 4) &&
VerifyField<float>(verifier, VT_SITTINGFOOTANGLE, 4) &&
VerifyField<float>(verifier, VT_LYINGONBACKUPPERLEGANGLE, 4) &&
VerifyField<float>(verifier, VT_LYINGONBACKLOWERLEGANGLE, 4) &&
verifier.EndTable();
}
};
Expand All @@ -6832,6 +6933,30 @@ struct YawCorrectionSettingsBuilder {
void add_amountInDegPerSec(float amountInDegPerSec) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_AMOUNTINDEGPERSEC, amountInDegPerSec, 0.0f);
}
void add_standingUpperLegAngle(float standingUpperLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_STANDINGUPPERLEGANGLE, standingUpperLegAngle, 0.0f);
}
void add_standingLowerLegAngle(float standingLowerLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_STANDINGLOWERLEGANGLE, standingLowerLegAngle, 0.0f);
}
void add_standingFootAngle(float standingFootAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_STANDINGFOOTANGLE, standingFootAngle, 0.0f);
}
void add_sittingUpperLegAngle(float sittingUpperLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_SITTINGUPPERLEGANGLE, sittingUpperLegAngle, 0.0f);
}
void add_sittingLowerLegAngle(float sittingLowerLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_SITTINGLOWERLEGANGLE, sittingLowerLegAngle, 0.0f);
}
void add_sittingFootAngle(float sittingFootAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_SITTINGFOOTANGLE, sittingFootAngle, 0.0f);
}
void add_lyingOnBackUpperLegAngle(float lyingOnBackUpperLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_LYINGONBACKUPPERLEGANGLE, lyingOnBackUpperLegAngle, 0.0f);
}
void add_lyingOnBackLowerLegAngle(float lyingOnBackLowerLegAngle) {
fbb_.AddElement<float>(YawCorrectionSettings::VT_LYINGONBACKLOWERLEGANGLE, lyingOnBackLowerLegAngle, 0.0f);
}
explicit YawCorrectionSettingsBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
Expand All @@ -6846,8 +6971,24 @@ struct YawCorrectionSettingsBuilder {
inline flatbuffers::Offset<YawCorrectionSettings> CreateYawCorrectionSettings(
flatbuffers::FlatBufferBuilder &_fbb,
bool enabled = false,
float amountInDegPerSec = 0.0f) {
float amountInDegPerSec = 0.0f,
float standingUpperLegAngle = 0.0f,
float standingLowerLegAngle = 0.0f,
float standingFootAngle = 0.0f,
float sittingUpperLegAngle = 0.0f,
float sittingLowerLegAngle = 0.0f,
float sittingFootAngle = 0.0f,
float lyingOnBackUpperLegAngle = 0.0f,
float lyingOnBackLowerLegAngle = 0.0f) {
YawCorrectionSettingsBuilder builder_(_fbb);
builder_.add_lyingOnBackLowerLegAngle(lyingOnBackLowerLegAngle);
builder_.add_lyingOnBackUpperLegAngle(lyingOnBackUpperLegAngle);
builder_.add_sittingFootAngle(sittingFootAngle);
builder_.add_sittingLowerLegAngle(sittingLowerLegAngle);
builder_.add_sittingUpperLegAngle(sittingUpperLegAngle);
builder_.add_standingFootAngle(standingFootAngle);
builder_.add_standingLowerLegAngle(standingLowerLegAngle);
builder_.add_standingUpperLegAngle(standingUpperLegAngle);
builder_.add_amountInDegPerSec(amountInDegPerSec);
builder_.add_enabled(enabled);
return builder_.Finish();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,16 @@ public final class TrackerData extends Table {
*/
public boolean hasTps() { return 0 != __offset(26); }
public int tps() { int o = __offset(26); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
/**
* Stay Aligned
*/
public float stayAlignedYawCorrectionInDeg() { int o = __offset(28); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
public float stayAlignedLockedErrorInDeg() { int o = __offset(30); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
public float stayAlignedCenterErrorInDeg() { int o = __offset(32); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
public float stayAlignedNeighborErrorInDeg() { int o = __offset(34); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
public boolean stayAlignedLocked() { int o = __offset(36); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }

public static void startTrackerData(FlatBufferBuilder builder) { builder.startTable(12); }
public static void startTrackerData(FlatBufferBuilder builder) { builder.startTable(17); }
public static void addTrackerId(FlatBufferBuilder builder, int trackerIdOffset) { builder.addOffset(0, trackerIdOffset, 0); }
public static void addInfo(FlatBufferBuilder builder, int infoOffset) { builder.addOffset(1, infoOffset, 0); }
public static void addStatus(FlatBufferBuilder builder, int status) { builder.addByte(2, (byte) status, (byte) 0); }
Expand All @@ -96,6 +104,11 @@ public final class TrackerData extends Table {
public static void addRotationReferenceAdjusted(FlatBufferBuilder builder, int rotationReferenceAdjustedOffset) { builder.addStruct(9, rotationReferenceAdjustedOffset, 0); }
public static void addRotationIdentityAdjusted(FlatBufferBuilder builder, int rotationIdentityAdjustedOffset) { builder.addStruct(10, rotationIdentityAdjustedOffset, 0); }
public static void addTps(FlatBufferBuilder builder, int tps) { builder.addShort(11, (short) tps, (short) 0); }
public static void addStayAlignedYawCorrectionInDeg(FlatBufferBuilder builder, float stayAlignedYawCorrectionInDeg) { builder.addFloat(12, stayAlignedYawCorrectionInDeg, 0.0f); }
public static void addStayAlignedLockedErrorInDeg(FlatBufferBuilder builder, float stayAlignedLockedErrorInDeg) { builder.addFloat(13, stayAlignedLockedErrorInDeg, 0.0f); }
public static void addStayAlignedCenterErrorInDeg(FlatBufferBuilder builder, float stayAlignedCenterErrorInDeg) { builder.addFloat(14, stayAlignedCenterErrorInDeg, 0.0f); }
public static void addStayAlignedNeighborErrorInDeg(FlatBufferBuilder builder, float stayAlignedNeighborErrorInDeg) { builder.addFloat(15, stayAlignedNeighborErrorInDeg, 0.0f); }
public static void addStayAlignedLocked(FlatBufferBuilder builder, boolean stayAlignedLocked) { builder.addBoolean(16, stayAlignedLocked, false); }
public static int endTrackerData(FlatBufferBuilder builder) {
int o = builder.endTable();
return o;
Expand Down Expand Up @@ -137,6 +150,16 @@ public void unpackTo(TrackerDataT _o) {
else _o.setRotationIdentityAdjusted(null);
Integer _oTps = hasTps() ? tps() : null;
_o.setTps(_oTps);
float _oStayAlignedYawCorrectionInDeg = stayAlignedYawCorrectionInDeg();
_o.setStayAlignedYawCorrectionInDeg(_oStayAlignedYawCorrectionInDeg);
float _oStayAlignedLockedErrorInDeg = stayAlignedLockedErrorInDeg();
_o.setStayAlignedLockedErrorInDeg(_oStayAlignedLockedErrorInDeg);
float _oStayAlignedCenterErrorInDeg = stayAlignedCenterErrorInDeg();
_o.setStayAlignedCenterErrorInDeg(_oStayAlignedCenterErrorInDeg);
float _oStayAlignedNeighborErrorInDeg = stayAlignedNeighborErrorInDeg();
_o.setStayAlignedNeighborErrorInDeg(_oStayAlignedNeighborErrorInDeg);
boolean _oStayAlignedLocked = stayAlignedLocked();
_o.setStayAlignedLocked(_oStayAlignedLocked);
}
public static int pack(FlatBufferBuilder builder, TrackerDataT _o) {
if (_o == null) return 0;
Expand All @@ -155,6 +178,11 @@ public static int pack(FlatBufferBuilder builder, TrackerDataT _o) {
addRotationReferenceAdjusted(builder, solarxr_protocol.datatypes.math.Quat.pack(builder, _o.getRotationReferenceAdjusted()));
addRotationIdentityAdjusted(builder, solarxr_protocol.datatypes.math.Quat.pack(builder, _o.getRotationIdentityAdjusted()));
if (_o.getTps() != null) { addTps(builder, _o.getTps()); }
addStayAlignedYawCorrectionInDeg(builder, _o.getStayAlignedYawCorrectionInDeg());
addStayAlignedLockedErrorInDeg(builder, _o.getStayAlignedLockedErrorInDeg());
addStayAlignedCenterErrorInDeg(builder, _o.getStayAlignedCenterErrorInDeg());
addStayAlignedNeighborErrorInDeg(builder, _o.getStayAlignedNeighborErrorInDeg());
addStayAlignedLocked(builder, _o.getStayAlignedLocked());
return endTrackerData(builder);
}
}
Expand Down
Loading