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

ntcore: TimestampedRaw should provide bytes, not list[int] #45

Closed
auscompgeek opened this issue Dec 17, 2023 · 3 comments
Closed

ntcore: TimestampedRaw should provide bytes, not list[int] #45

auscompgeek opened this issue Dec 17, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@auscompgeek
Copy link
Member

Mentioned in passing by Photonvision folks, but I don't know any of the details.

Inherited from how NT4 returns the raw bytes topic value

Originally posted by @gerth2 in PhotonVision/photonvision#1040 (comment)

@auscompgeek auscompgeek added the bug Something isn't working label Dec 17, 2023
@virtuald
Copy link
Member

virtuald commented Dec 17, 2023

I just tried it by modifying the simple_*.py examples to getRaw/setRaw and this isn't the case, it returns bytes. Closing unless there's a reproducer.

@gerth2
Copy link

gerth2 commented Dec 17, 2023

image
ntcore 2024.0.0b3.post1 - TimestampedRaw is typehinted to lists of ints, not bytes

@gerth2
Copy link

gerth2 commented Dec 17, 2023

At runtime on a roboRIO - looks like the type does indeed come back as int -
image

@virtuald virtuald reopened this Dec 17, 2023
@virtuald virtuald changed the title ntcore sometimes returns list[int] instead of bytes? ntcore: TimestampedRaw should provide bytes, not list[int] Dec 17, 2023
virtuald added a commit that referenced this issue Dec 17, 2023
- std::vector<uint8_t> is only used in raw contexts, so the type caster
  intercepts and converts the value automatically to/from bytes
- Fixes #45
- There may be other places we could use this technique?
virtuald added a commit that referenced this issue Dec 18, 2023
- std::vector<uint8_t> is only used in raw contexts, so the type caster
  intercepts and converts the value automatically to/from bytes
- Fixes #45
- There may be other places we could use this technique?
@github-project-automation github-project-automation bot moved this from Todo to Done in 2024 Season Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants