當前位置: 首頁>>代碼示例>>Java>>正文


Java NetworkTable.getTable方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.networktables.NetworkTable.getTable方法的典型用法代碼示例。如果您正苦於以下問題:Java NetworkTable.getTable方法的具體用法?Java NetworkTable.getTable怎麽用?Java NetworkTable.getTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.networktables.NetworkTable的用法示例。


在下文中一共展示了NetworkTable.getTable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: VisionAlignment

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public VisionAlignment() {
	
	table = NetworkTable.getTable("Vision");
	double dist = table.getNumber("est_distance", 0);

	double incr = 0.5;
	int reps = (int) (dist / incr);
	
	for(int i = 0; i<reps; i++) {
		addSequential(new VisionGyroAlign(), 1.5);
		addSequential(new WaitCommand(0.7));
		addSequential(new DriveForwardDistance(-.2,-.2, -incr/1.5, -incr/1.5, true));
		addSequential(new WaitCommand(0.5));
	}
	
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:17,代碼來源:VisionAlignment.java

示例2: Vision

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
/**
 * Creates the instance of VisionSubsystem.
 */
public Vision() {
  logger.trace("Initialize");

  ledRing0 = new Relay(RobotMap.RELAY_LED_RING_0);
  ledRing1 = new Relay(RobotMap.RELAY_LED_RING_1);

  gearVision.table = NetworkTable.getTable("Vision_Gear");
  boilerVision.table = NetworkTable.getTable("Vision_Boiler");

  initPhoneVars(gearVision, DEFAULT_GEAR_TARGET_WIDTH, DEFAULT_GEAR_TARGET_HEIGHT);
  initPhoneVars(boilerVision, DEFAULT_BOILER_TARGET_WIDTH, DEFAULT_BOILER_TARGET_HEIGHT);

  Thread forwardThread = new Thread(this::packetForwardingThread);
  forwardThread.setDaemon(true);
  forwardThread.setName("Packet Forwarding Thread");
  forwardThread.start();

  Thread dataThread = new Thread(this::dataThread);
  dataThread.setDaemon(true);
  dataThread.setName("Vision Data Thread");
  dataThread.start();
}
 
開發者ID:ligerbots,項目名稱:Steamworks2017Robot,代碼行數:26,代碼來源:Vision.java

示例3: DFDSMove

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public DFDSMove(double speedL, double speedR, double distanceL, double distanceR) {
	requires(Robot.driveTrain);
	_initLeftSpeed = speedL;
	_initRightSpeed = speedR;
	_initDistanceL = distanceL*TICKSPERMETER;
	_initDistanceR = distanceR*TICKSPERMETER;
	table = NetworkTable.getTable("Console");
	if(speedL > 0)
		table.putString("Message", "Backwards DFD Speed");
	else
		table.putString("Message", "Forwards DFD Speed");
	Robot.driveTrain.resetEnc();
	Robot.driveTrain.resetGyro();
	Robot.driveTrain.speedControl();
	Robot.driveTrain.setBrakeMode();
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:17,代碼來源:DFDSMove.java

示例4: init

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public static void init() {
        nt = NetworkTable.getTable("vision");
        nt.addTableListener((source, key, value, isNew) -> {
//          System.out.println("Value changed. Key = " + key + ", Value = " + value);
            switch (key) {
                case FOUND_TARGET_KEY:
                    foundTarget = (Boolean) value;
                    break;
                case AREA_KEY:
                    area = (Double) value;
                    break;
                case OFFSET_KEY:
                    offset = (Double) value;
                    break;
                case SKEW_KEY:
                    skew = (Double) value;
                    break;
                case ANGLE_KEY:
                    angle = (Double) value;
                    break;
            }
        });
    }
 
開發者ID:Team334,項目名稱:R2017,代碼行數:24,代碼來源:VisionData.java

示例5: SplinePlannerWidget

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public SplinePlannerWidget()
{
    super(false, 10);
    setLayout(new BorderLayout());
    mPanel = new SplinePlotterPanel();
    add(mPanel);

    mTable = NetworkTable.getTable(SmartDashBoardNames.sSPLINE_NAMESPACE);

    mLastIndex = 0;

    mIdealSplineName = SmartDashBoardNames.sSPLINE_IDEAL_POINTS;
    mRealSplineName = SmartDashBoardNames.sSPLINE_REAL_POINT;

    addPathListener();
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:17,代碼來源:SplinePlannerWidget.java

示例6: AutonomousFactory

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public AutonomousFactory(Snobot2017 aSnobot, IDriverJoystick aDriverJoystick)
{
    mPositionChooser = new SendableChooser<StartingPositions>();
    mCommandParser = new CommandParser(aSnobot, mPositionChooser);
    mAutoModeTable = NetworkTable.getTable(SmartDashBoardNames.sAUTON_TABLE_NAME);
    
    mPositioner = aSnobot.getPositioner();

    mAutonModeChooser = new SnobotAutonCrawler(Properties2017.sAUTON_FILE_FILTER.getValue())
            .loadAutonFiles(Properties2017.sAUTON_DIRECTORY.getValue() + "/", Properties2017.sAUTON_DEFAULT_FILE.getValue());

    SmartDashboard.putData(SmartDashBoardNames.sAUTON_CHOOSER, mAutonModeChooser);
    

    for (StartingPositions pos : StartingPositions.values())
    {
        mPositionChooser.addObject(pos.toString(), pos);
    }
    
    SmartDashboard.putData(SmartDashBoardNames.sPOSITION_CHOOSER, mPositionChooser);
    addListeners();    
    }
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:23,代碼來源:AutonomousFactory.java

示例7: main

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    NetworkTable.setClientMode();
    InetAddress address = InetAddress.getByName("roborio-1458-frc.local");
    NetworkTable.setIPAddress(address.getHostAddress());

    NetworkTable SmartDashboard = NetworkTable.getTable("SmartDashboard");

    Scanner s = new Scanner(System.in);

    //SmartDashboard.putNumber("TestValueJetson", 42);

    while(true) {
        if(s.hasNextInt()) {
            SmartDashboard.putNumber("TestValueJetson", s.nextInt());
        }
    }
}
 
開發者ID:FRC1458,項目名稱:turtleshell,代碼行數:18,代碼來源:Main.java

示例8: AimWithCamera

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public AimWithCamera()
{
    requires((Subsystem) driveTrain);
    requires((Subsystem) shooterArticulator);       
    
    if (CommandBase.lightSystem != null)
        requires((Subsystem) lightSystem);
    
    table = NetworkTable.getTable("IMGPROC");   
    
    TOLERANCE = Double.parseDouble(BadPreferences.getValue(toleranceKey, "" + TOLERANCE));
    TURN_SPEED = Double.parseDouble(BadPreferences.getValue(turnKey, "" + TURN_SPEED));
    NUMBER_CYCLES_TO_VERIFY = Integer.parseInt(
            BadPreferences.getValue(neededCyclesKey, "" + NUMBER_CYCLES_TO_VERIFY));
    
    SWEET_SPOT_X = Double.parseDouble(BadPreferences.getValue(sweetXKey, "" + SWEET_SPOT_X));
    SWEET_SPOT_Y = Double.parseDouble(BadPreferences.getValue(sweetYKey, "" + SWEET_SPOT_Y));
}
 
開發者ID:BadRobots1014,項目名稱:BadRobot2013,代碼行數:19,代碼來源:AimWithCamera.java

示例9: robotInit

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public void robotInit() {
        // instantiate the command used for the autonomous period
        //autonomousCommand = new ExampleCommand();
        
        // Initialize all subsystems
        CommandBase.init();
        
        table = NetworkTable.getTable("CRIO");
        table.putBoolean("bool", true);
        table.putNumber("double", 3.1415927);
        table.putString("sring", "a string");
        
        LogDebugger.log("robot init!!!");
	
//	LiveWindow.addActuator("compressor", "alt relay", RobotMap.testCompRelay);
//	LiveWindow.addActuator("compressor", "act compressor", RobotMap.airCompressor);
//	LiveWindow.addSensor("compressor", "sensor compressor", RobotMap.airCompressor);
    }
 
開發者ID:Team3574,項目名稱:RKellyBot,代碼行數:19,代碼來源:Robot.java

示例10: getNetworkTable

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
/**
 * Setup Network Tables, and get the NetworkTable for the SmartDashboard.
 * @return The network table for the SmartDashboard.
 */
private NetworkTable getNetworkTable()
{
    NetworkTable.setTeam(1899);
    NetworkTable.setServerMode();
    try
    {
        NetworkTable.initialize();
    }
    catch (IOException exception)
    {
        Logger.log(exception);
    }

    return NetworkTable.getTable("SmartDashboard");
}
 
開發者ID:SaintsRobotics,項目名稱:Woodchuck-2013,代碼行數:20,代碼來源:Robot.java

示例11: RightPeg

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public RightPeg() {
	Robot.driveTrain.resetEnc();
	table = NetworkTable.getTable("Vision");
	
	addSequential(new DFDSpeed(-200, -200, 1.60, 1.60));
	addSequential(new WaitCommand(0.2));
	addSequential(new GyroTurn(-150, -50), 2); //CHECK + AND -
	addSequential(new WaitCommand(0.2));
	addSequential(new VisionGyroAlign(), 1);
	addSequential(new WaitCommand(0.2));
	addSequential(new MovingVisionAlignment(), 5); //removed timeout
	addSequential(new WaitCommand(0.2));
	
	//Move back retry
	addSequential(new DFDSMove(200, 200, 1.0, 1.0), 2);
	addSequential(new WaitCommand(0.1));
	addSequential(new MovingVisionAlignment(), 5); //removed timeout
	addSequential(new WaitCommand(0.1));
	addSequential(new DFDSMove(200, 200, 1.0, 1.0), 2);
	addSequential(new WaitCommand(0.1));
	addSequential(new MovingVisionAlignment(), 5); //removed timeout
	addSequential(new WaitCommand(0.1));
	addSequential(new DFDSMove(200, 200, 1.0, 1.0), 2);
	addSequential(new WaitCommand(0.1));
	addSequential(new MovingVisionAlignment()); //removed timeout
	addSequential(new WaitCommand(0.1));
	addSequential(new GearOn(false, false), 1);
	addSequential(new WaitCommand(0.5));
	addSequential(new DFDSpeed(200, 200, 1.4, 1.4));
	
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:32,代碼來源:RightPeg.java

示例12: VisionGyroAlign

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public VisionGyroAlign () {
	requires(Robot.driveTrain);
	table = NetworkTable.getTable("Vision");
	Robot.driveTrain.resetLeftEnc();
	Robot.driveTrain.resetRightEnc();
	Robot.driveTrain.resetGyro();
	_turnPower = -125;
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:9,代碼來源:VisionGyroAlign.java

示例13: AutoDrive

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public AutoDrive(double speed) {
	requires(Robot.driveTrain);
	table = NetworkTable.getTable("Vision");
	_leftSpeed = speed*1.15;
	_rightSpeed = speed;
	Robot.driveTrain.percentVbusControl();
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:8,代碼來源:AutoDrive.java

示例14: DriveForwardDistance

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
public DriveForwardDistance(double speedL, double speedR, double distanceL, double distanceR, boolean slow) {
	requires(Robot.driveTrain);
	_initLeftSpeed = speedL;
	_initRightSpeed = speedR;
	_initDistanceL = distanceL*TICKSPERMETER;
	_initDistanceR = distanceR*TICKSPERMETER;
	_slow = slow;
	Robot.driveTrain.percentVbusControl();
	table = NetworkTable.getTable("Console");
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:11,代碼來源:DriveForwardDistance.java

示例15: updateContoursReport

import edu.wpi.first.wpilibj.networktables.NetworkTable; //導入方法依賴的package包/類
/**
 * Updates the local contoursReport table. WARNING, this has to be somewhat
 * syncrhonized so one thing doesn't update the table while another tries to
 * access an element that might not exist in the updated table
 *
 */
public void updateContoursReport() {
	// A contours report contains centerX[], centerY[], solidity[],
	// height[], area[], and width[]

	// I think that it publishes the contours with the smallest area first
	// in the array
	contoursReport = NetworkTable.getTable("GRIP/myContoursReport");
}
 
開發者ID:1757WestwoodRobotics,項目名稱:2017-Steamworks,代碼行數:15,代碼來源:Vision.java


注:本文中的edu.wpi.first.wpilibj.networktables.NetworkTable.getTable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。