Comments (12)
I actually don't think it's that inefficient.. we're writing single bytes but it is buffered by socket.makefile(). I can do some network captures to confirm.
from robotpy-wpilib.
Maybe.
Another problem that I think I just noticed (I could be wrong) is that you're writing to the network from the robot thread, so the robot will block on network delays. The C++ library had this problem too.
from robotpy-wpilib.
Actually, there might be a thread in there somewhere.
from robotpy-wpilib.
It's in a separate thread (WriteManager). I agree the code is very convoluted (the original is a prime example of violating you-aint-gonna-need-it). I've simplified it somewhat from the Java version, but it is still hard to trace how things like updates actually happen.
from robotpy-wpilib.
Yeah, it is somewhat simpler, but it's still very confusing.
At some point, I'd like to refactor it so it's easier to follow, because there's way too much indirection happening everywhere. I'll change the title of this bug for that.
First though, probably makes sense to get the tests working to validate that the implementation is working, before refactoring.
from robotpy-wpilib.
I've already started to do some "easy" refactors (merging classes that are only used in one place and the like). Agreed tests are needed, but right now it's almost too convoluted to test efficiently.
from robotpy-wpilib.
I've also confirmed (with wireshark) we are NOT sending 1-byte payload packets - it's properly buffering and flushing.
from robotpy-wpilib.
Ok, cool.
from robotpy-wpilib.
Also, Patrick from WPI had started on a reimplementation of NetworkTables in C++. It could be useful to look at: https://bitbucket.org/byteit101/nwtpp/src
from robotpy-wpilib.
A good simplification would be to change some (or all) of the listeners to accept callables, instead of requiring overriding a class. Definitely more pythonic.
from robotpy-wpilib.
We should move this ticket (or rather, close this one and create a new one) to the pynetworktables repo.
from robotpy-wpilib.
from robotpy-wpilib.
Related Issues (20)
- Command based robot? HOT 1
- Reported segfault in SmartDashboard.putStringArray HOT 3
- TrajectoryGenerator and SplineParameterizer don't get units type caster
- Design physics/simulation support HOT 2
- Add Swerve Drive support HOT 5
- Auto-generated type annotations? HOT 2
- Broken link in readme.md
- 2021 - import wpilib and sim issues after pip install -U robotpy[all] HOT 2
- SmartDashboard::putData doesn't keep objects alive HOT 10
- CTRL-C in gui on Linux segfaults HOT 1
- wpilib.shuffleboard not implemented HOT 4
- `OSError: Failure` on Linux HOT 2
- Fix Mechanism2D HOT 2
- wpilib.simulation.DCMotorSim missing
- [BUG]: OSError with robotpy-hal library HOT 1
- Unable to find wpilib.shuffleboard in 2021 or 2022 libraries HOT 3
- [BUG]: makeCompressor crashes HOT 1
- [BUG]: Broken Implementation of WPILib SPI HOT 7
- [BUG]: Exceptions from startCompetition don't terminate code on roboRIO HOT 2
- [BUG]: bad error message for SpeedControllerGroup construction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotpy-wpilib.