Go to Post Getting a swerve to drive predictably and effectively is arguably harder than designing and building it. - Holtzman [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 12-02-2012, 01:22
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 347
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
NetworkTable : Tables, SubTables

We are developing cRio software in C++, and using SmartDashboard with a custom Java extension we are developing. Our goal is to have the C++ cRio code detect targets, and display information within a custom WPICameraExtension on the smart dashboard.

On the robot, we create a "Camera" table via NetworkTable::GetTable("Camera"). So far, so good.

Our next step: creating a "SubTable" for each detected Target (via NetworkTable::GetSubTable("Target<TargetNum>").

Some questions are coming up:

1) Within the C++ code, it's not clear how to *create* a SubTable. Do we "new" a NetworkTable and then use PutSubTable()? Or do we invoke NetworkTable::GetTable(subtablename) and then PutSubTable() w/the table that is returned?

2) On the SmartDashboard side, we are retrieving the "Camera" Table via Robot.getTable().getTable("Camera"). Is that correct? The hierarchy does not seem parallel between the Java and C++ code (e.g., the Java API seems to imply a "top-level, unnamed" table, whereas the C++ API seems to imply a set of named tables at the top-level.

3) If we wanted to retrieve a sub-table on the SmartDashboard side, would we retrieve it via:

Robot.getTable().getTable("Camera").getSubTable("T arget<targetnum>")

Or

Robot.getTable().getTable("Target<targetnum>")

I would prefer to use sub-tables, as it seems a more clear way of expressing the "sub-tables" for detected targets. But I'm unclear as to the appropriate method for creating sub-tables before calling "putSubTable()".

Perhaps some diagram showing the hierarchy of "top-level-table", "named table" and "named sub-table" would be helpful.... Or perhaps a code sample?
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 17:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi