-
Notifications
You must be signed in to change notification settings - Fork 6
Apriltag Vision
Setting Up the Apriltag Detector
We need parameters for the Apriltag detector in order to accurately detect tags.
Use the following parameters (tested on Microsoft LifeCam HD-3000)
at_detector = Detector(
families="tag16h5",
nthreads=1,
quad_decimate=0.3,
quad_sigma=0.35,
refine_edges=1,
decode_sharpening=0.25,
debug=0
)Recoloring
To detect Apriltags we must be in a grayscale color space.
imgGrayscale = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
Checking For Apriltag
First we check for apriltags in the image, then we take only the apriltags that the program is most confident in seeing.
****`apriltags = at_detector.detect(imgGrayscale)
apriltags = [x for x in apriltags if x.hamming == 0]`
Locating Apriltag Positions
for i in range(len(apriltags)):
centerXY = ast.literal_eval((re.sub(" +", " ", ((str(apriltags[i].center).replace("[", "")).replace("]", "")).strip())).replace(" ", ", "))
centerXY = list(centerXY)
centerXY[0] = centerXY[0] - 320
centerXY[1] = centerXY[1] - 240centerXY[0] is the X position of the Apriltag. centerXY[1] is the Y position of the Apriltag.
Finding Tag ID
for i in range(len(apriltags)):
tagID = apriltags[i].tag_idThis is an officially licensed product of Team 4026. Decatur Robotics 2024 is not sponsored by any other Team, and is not responsible for any damages caused by using this product or trusting the programming team, which is by far the least most trustworthy team(Shadow owen money gang, we love coding the robot). By using this product, you are consenting to your information, and thus your identity to be stolen and first-born child taken.
- Editing Documentation & Markdown Syntax
- Code Team to-do List
- Code Standards
- Common Library Structure
- Interfaces
- General Setup
- Branching System
- How to Create Pull Requests
- How to Switch Branches
- Code Reviews
- Reverting Commits
- Singleton Pattern
- Software Installations
- Necessary IntelliJ Plugins
- Vendordeps
- Setting Up New Projects
- Autoformatter Set Up
- Showbot Requirements
- Autonomous
- Calling a Command Based on a Button Press
- CAN
- Clearing Sticky Faults
- Current Limits
- PID Config and Usage
- Robot.java, TeleopInit, DisabledInit
- RoboRio Ports
- SetDefaultCommand
- Wait for Time
- SlewRateLimiter
- LEDs
- InstantCommand
- PhotonVision
- Apriltags
- Camera Display on Shuffleboard
- Object Detection
- Raspberry Pi
- Network Tables
- List of Network Tables (2023)
Up to date as of SJ2, end of 2023 season