-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot.py
32 lines (25 loc) · 1.15 KB
/
robot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ntcore
import wpilib
class EasyNetworkTableExample(wpilib.TimedRobot):
def robotInit(self) -> None:
# # Get the default instance of NetworkTables that was created automatically
# # when the robot program starts
# inst = ntcore.NetworkTableInstance.getDefault()
# # Get the table within that instance that contains the data. There can
# # be as many tables as you like and exist to make it easier to organize
# # your data. In this case, it's a table called datatable.
# table = inst.getTable("datatable")
# # Start publishing topics within that table that correspond to the X and Y values
# # for some operation in your program.
# # The topic names are actually "/datatable/x" and "/datatable/y".
# self.xPub = table.getDoubleTopic("x").publish()
# self.yPub = table.getDoubleTopic("y").publish()
# self.x = 0
# self.y = 0
pass
# def teleopPeriodic(self) -> None:
# # Publish values that are constantly increasing.
# self.xPub.set(self.x)
# self.yPub.set(self.y)
# self.x += 0.05
# self.y += 1.0