Skip to content

Comments

Update networktables to ntcore 2019.2.1#916

Merged
SamCarlberg merged 9 commits intoWPIRoboticsProjects:masterfrom
SamCarlberg:update-networktables
Apr 18, 2019
Merged

Update networktables to ntcore 2019.2.1#916
SamCarlberg merged 9 commits intoWPIRoboticsProjects:masterfrom
SamCarlberg:update-networktables

Conversation

@SamCarlberg
Copy link
Member

Removes dependency on old networktables

Call flush after entire pipeline runs to keep all published values synchronized as much as possible - old behavior was to flush for every publisher (before the publisher would make its changes)

Removes the auto-shutdown behavior for NTHandler since clients now only maintain entries set on them (eg from publishers). I believe this behavior was present to prevent GRIP from keeping phantom entries around that it had no business using.

Since NetworkTables now requires libc 2.2.7, GRIP will not run on Ubuntu-based distros older than 18.04.

Removes dependency on old networktables
Increase update rate to 100Hz (from 10Hz) to keep latencies low
Call flush after entire pipeline runs to keep all published values synchronized as much as possible
jobs:
- job: Linux
pool:
vmImage: 'Ubuntu 16.04'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this was changed to 18.04 in commit 5e8ee9d but changed back to 16.04 in 63797a9 Since other changes also happened in 63797a9 it wasn't clear to me if this reset was intentional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was. Azure pipelines only has Ubuntu 16.04, not 18.04

@JLLeitschuh
Copy link
Member

This totally cans Travis CI right?

/*
* Nasty hack that is unavoidable because of how NetworkTables works.
*/
private static final AtomicInteger count = new AtomicInteger(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget why this was required. Can you remind me why we had it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, just tracking usages of the NetworkTables connection. The client would only run if there was at least one source or one publishing operation that used it - if not, then the client would be shut down. I believe this was to prevent GRIP from keeping old entries around, but ntcore makes it so that clients only keep around entries that they have written to (the old library would make the client keep around all entries and re-send them to a server on a reconnect).

@JLLeitschuh
Copy link
Member

What do you want to do with Travis CI at this point?

@SamCarlberg
Copy link
Member Author

I think Travis can be removed now. It's just doing the javadoc push to the github site, but I think that's broken anyway. Azure has everything else.

There has been some chatter about compiling ntcore with compatibility for 14.04 or 16.04... I'm tempted to hold out to see if that goes anywhere - or maybe wait until Azure has an 18.04 image (issue here) instead of mucking around with Docker

Copy link
Member

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamCarlberg I'm going to leave this up to you to either wait on or merge.
Totally up to you.

@SamCarlberg SamCarlberg added this to the v1.6.0 milestone Apr 2, 2019
@SamCarlberg SamCarlberg force-pushed the update-networktables branch from 7895462 to 32330e1 Compare April 18, 2019 02:35
@codecov-io
Copy link

Codecov Report

Merging #916 into master will increase coverage by 0.07%.
The diff coverage is 36.17%.

@@             Coverage Diff              @@
##             master     #916      +/-   ##
============================================
+ Coverage     52.75%   52.82%   +0.07%     
  Complexity        1        1              
============================================
  Files           327      327              
  Lines          8853     8852       -1     
  Branches        564      560       -4     
============================================
+ Hits           4670     4676       +6     
+ Misses         3980     3972       -8     
- Partials        203      204       +1

@SamCarlberg SamCarlberg requested a review from JLLeitschuh April 18, 2019 19:11
ntInstance.deleteAllEntries();
ntInstance.startClient();
ntInstance.setServer(projectSettings.getPublishAddress());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance that any of these things could hang?

testTable.putBoolean(BOOLEAN_PATH, true);
testTable.putDouble(NUMBER_PATH, TEST_NUMBER);
testTable.putString(STRING_PATH, TEST_STRING);
ntInstance = NetworkTableInstance.create();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hate this dam singleton pattern.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a singleton? There's a default instance, but create() will return a new instance. Makes it useful for tests since there's no global state

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Cool!

Copy link
Member

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM!

@SamCarlberg SamCarlberg merged commit 73884fe into WPIRoboticsProjects:master Apr 18, 2019
@SamCarlberg SamCarlberg deleted the update-networktables branch April 18, 2019 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants