For whatever reason, every time I try to get the positions from the “camtram” variable from the limelight networktables into the console, it doesn’t return anything.
“camtran” is the only thing that doesn’t return anything into the driver station console; however, when I check in Shuffleboard, networktables there displays the correct data, so I’m not sure what’s going on here. It’s my team’s first year using limelight and my first year programming for the team.
Sure thing. Sorry if this formats weirdly or if I sent too little/too much code- still new to posting on ChiefDelphi.
from networktables import NetworkTables
class Limelight:
def __init__(self):
self.table = NetworkTables.getTable("limelight")
def get_3d_position(self):
'''
Get 3D position (x, y, z) and rotation (pitch, yaw, roll)
'''
position = self.table.getNumber("camtran", 0.0)
print(position) # Printing so I know if I actually am getting the camtran info.
I’m getting 0.0 whenever I print(position), which means that there’s no value for camtran. However, when I check Shuffleboard, there are values for camtran.
I’m running that particular piece of code during robot.py TeleOp, so it continually prints
I’ll check tomorrow to see if we aren’t connected to NetworkTables, though getting any other value works just fine. If I try to get any other value, it returns it correctly. If I run