GithubHelp home page GithubHelp logo

limelightlib-wpijava's Introduction

Limelightlib (WPILIB Java)

https://github.com/LimelightVision/limelightlib-wpijava/releases

Usage

This is a single-file library. All you need to do is copy the LimelightHelpers.java file from the latest release (https://github.com/LimelightVision/limelightlib-wpijava/releases) into your Java project's "robot" folder. You don't need to create any objects for your Limelights - the library is designed to be used in a functional manner.

Basic Usage

Every method in Limelightlib accepts a string parameter indicating the correct Limelight to use. If left blank or null, the name is assumed to be "limelight"

LimelightHelpers.setLEDMode_PipelineControl("");
LimelightHelpers.setLEDMode_ForceBlink("")
LimelightHelpers.setCropWindow("",-1,1,-1,1);
double tx = LimelightHelpers.getTX("");

Tips

  • For simple targeting applications, use getTX() and getTY()
  • For Pose estimation, use getBotPoseEstimate_wpiBlue() and see the tutorials section in our documentation.

JSON Parsing

getLatestResults() parses the latest Limelight JSON dump into a LimelightResults object. Takes up to 2.5ms on RoboRIO 1.0. Parsing latency is logged in results.targetingresults.latency_jsonParse and may be added to latency_pipeline and latency_capture.

LimelightHelpers.LimelightResults llresults = LimelightHelpers.getLatestResults("");

Each LimelightResults instance contains a Results object. Each Results object contains data such as botpose, an array for each target type, etc. With getLatestResults(), you now have easy access to 100% of your Limelight's output.

double[] botposeRed = llresults.botpose_wpired;
double pipelineLatency = llresults.latency_pipeline;
LimelightHelpers.LimelightTarget_Fiducial = llresults.targets_Fiducials;

Taking snapshots

LimelightHelpers.takeSnapshot("","snapshotname");

Classes

LimelightHelpers.PoseEstimate
LimelightHelpers.LimelightTarget_Retro
LimelightHelpers.LimelightTarget_Fiducial
LimelightHelpers.LimelightTarget_Barcode
LimelightHelpers.LimelightTarget_Classifier
LimelightHelpers.LimelightTarget_Detector
LimelightHelpers.LimelightResults
(Pure Static) LimelightHelpers

LimelightHelpers Methods

double getTX()
double getTY()
double getTA()

PoseEstimate getBotPoseEstimate()
PoseEstimate getBotPoseEstimate_wpiBlue()
PoseEstimate getBotPoseEstimate_wpiRed()

double getLatency_Pipeline()
double getLatency_Capture()
int getCurrentPipelineIndex()

Pose3D getBotPose3d()
Pose3D getBotPose3d_wpiRed()
Pose3D getBotPose3d_wpiBlue()

Pose2D getBotPose2d()
Pose2D getBotPose2d_wpiBlue()
Pose2D getBotPose2d_wpiRed()

double[] getBotpose()
double[] getBotpose_wpiRed()
double[] getBotpose_wpiBlue()
double[] getBotpose_TargetSpace
double[] getCameraPose_TargetSpace()
double[] getTargetPose_CameraSpace()
double[] getTargetPose_RobotSpace()

double[] getTargetColor()
int getFiducialID()
String getNeuralClassID()
String getJsonDump()

setPipelineIndex()

setLEDMode_PipelineControl()
setLEDMode_ForceOff()
setLEDMode_ForceBlink()
setLEDMode_ForceOn()

setStreamMode_Standard()
setStreamMode_PiPMain()
setStreamMode_PiPSecondary()

setCropWindow()

setPythonScriptData()
getPythonScriptData()

takeSnapshot()
getLatestResults()

getLimelightNTTable()
getLimelightNTTableEntry()
getLimelightNTDouble()
setLimelightNTDouble()
setLimelightNTDoubleArray()
getLimelightNTDouleArray()
getLimelightNTString()
getLimelightURLString()

limelightlib-wpijava's People

Contributors

bhjelstrom avatar agasser avatar hollisms avatar jacksonelia avatar nyxiad avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.