Giter VIP home page Giter VIP logo

visionserver's Introduction

VisionServer

This is the LigerBots Python vision server, intended to run on a coprocessor on the robot.

The server can be "controlled" through NetworkTables. The NT variables are all under /SmartDashboard/vision. Some interesting NT variables:

  • /SmartDashboard/vision/target_info = results of the target search. (to retrieve the array from NT, use 'vision/target_info') All values are floats, because NT arrays need to be a uniform type. Values are:

    • target_info[0] = timestamp of image in seconds.
    • target_info[1] = success (1.0) OR failure (0.0)
    • target_info[2] = mode (1=driver, 2=rrtarget)
    • target_info[3] = distance to target (inches)
    • target_info[4] = angle1 to target (radians) -- angle displacement of robot to target
    • target_info[5] = angle2 of target (radians) -- angle displacement of target to robot
  • /SmartDashboard/vision/active_mode = current vision processing mode This is a "sendablechooser", so it appears as a dropdown in ShuffleBoard. The Java code needs to use a monitor the value /SmartDashboard/vision/active_mode/selected

  • /SmartDashboard/vision/camera_height = current height of Front camera (inches)

(The cube mode needs to know the height of the intake camera off the ground. This needs to come from the RoboRio, based on the winch position.)

Indicators (will only be present on the final stream, 1190):

  • Test Mode (text): The Odroid is in test mode and set up a local set of NT. WARNING: The Odroid will not commmunicate its NT with the Roborio's NT, since they are completely different tables. To change the mode, go into the Odroid and change start_server so that args includes/not include the tag '--test'
  • Recording images (red dot): When the NT variable 'write_images' is turned on, images will be saved every 1/2 second to the directory saved_images under the server directory
  • Tuning On (text): When the NT variable 'tuning' is turned on, the server's NT variables will communicate with the individual finders' attributes such as HSV values. However, only tuning for HSV values is currently set up.

visionserver's People

Contributors

danrlavoie avatar degman1 avatar flying-toast avatar ladlad5 avatar lq1234 avatar mnazzaro avatar prensing avatar xeniarose avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

visionserver's Issues

New Camera class

I think we might want to add our own Camera class. This would simplify a few things in VisionServer, by pulling some of the code into one place. Eg Camera would "own" both the cscore.Camera and cscore.Sink instances (which are really tied together).

In the future, if we have different cameras on the robot, it would be easier to auto-sense which brand each one is.

Create small class for the contour info

Right now, we use a dictionary to hold a bunch of things about a contour, such as bounding box values, area, etc. This is done so that we don't calculate these values multiple times.

We should create a small class to handle this. For each value, it can see if it has it, if not calculate it, and then return it.

Also, the class can hold extra info such as the reason that contour was cut (eg see 2021 galactic_search).

Enhance all finders to support visionserver.switch_mode()

The finders should have 1-2 new variables to support making visionserver.switch_mode() generic. Probably need things like:
finder.desired_camera (better variable name?)
finder.exposure

To support this, probably want the new genericfinder to have init variable for these, so they can be set on creation.

Enhance genericfinder

Good start on genericfinder. I think we can go a little further (sorry if you are already planning this):

  • include a rotation. Parameter would be the image rotation parameter from OpenCV

Use logging facility

Definitely low priority.

We should generally use the Python "logging" facility, although it might depend on what is done inside cscore and the related Python code.

logging let you have messages with different priority (debug, warning, etc) and you can set what is recorded. You can still send it to a file as needed.

One thing to remember though: if you have "logging.debug("foo")" everywhere, it will still slow down your code even if the "debug" messages are not saved. So low level logging code should still be used sparingly and/or commented out for "production".

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.