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

setTimestamp on EntityStatePdu #94

Open
AJPerriello opened this issue Feb 29, 2024 · 2 comments
Open

setTimestamp on EntityStatePdu #94

AJPerriello opened this issue Feb 29, 2024 · 2 comments
Labels

Comments

@AJPerriello
Copy link

I've done reading and haven't found a good code example.
But from what I read in the standard is that DIS servers may reject EntityStatePdu is the timestamp is not 0 (relative) or valid.
So using this open-dis library I'm not sure how this would work properly.
I've seen other dis implementations that manage more code and logic to handle timestamps and updating them for persistent entities. In other words, if timestamps are not relevant or too latent then it could be perceived that the entity is no longer existing.
Unix time in milliseconds since epoch fits in 64 bit long, but not 32 bit int, furthermore, it seems timestamps need to be DIS compliant by setting the least significant bit too 0 or 1. (relative or absolute) and then the next 31 bits could hold at most (2^31) - 1 values. This will not work for epoch time without significant loss, so I think it means that time values are how many ticks since the top of the hour. I can't see how this would be used with the current library APIs on Pdu::setTimestamp(). An example would help. But I can't find one. For now, I'll just keep trying different techniques to see what works. If you have more info or a good example in C++ thank you.

@leif81
Copy link
Member

leif81 commented Jul 1, 2024

@AJPerriello there's a class in the Java library named disTime that may help answer your questions

https://github.com/open-dis/open-dis-java/blob/master/src%2Fmain%2Fjava%2Fedu%2Fnps%2Fmoves%2Fdisutil%2FDisTime.java

@leif81 leif81 added the question label Jul 1, 2024
@leif81
Copy link
Member

leif81 commented Jul 1, 2024

@AJPerriello 's a class in the Java library named disTime may help answer your questions

https://github.com/open-dis/open-dis-java/blob/master/src%2Fmain%2Fjava%2Fedu%2Fnps%2Fmoves%2Fdisutil%2FDisTime.java

Many simulations, especially the in-house kind, ignore timestamp and handle packets the order they are received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants