Git Product home page Git Product logo

2023vision's Introduction

2023Vision

This repository contains python scripts that use duckie-town apriltags and the zed sdk and run on a Jetson Xavier

https://github.com/duckietown/lib-dt-apriltags

https://www.stereolabs.com/docs/

Vision Processign Algorithm

flowchart TD
    A[Vision Program Starts] --> B[Initialize Zed]
    B --> C[If runtime == success and tracking_state == OK]
    C -- No --> D[Vision Program Stops]
    C -- Yes -->E[Track distance from starting point]
    C -- Yes -->F[Find apriltags]
    F -- No Apriltags Found --> G[Do nothing]
    F -- Apriltags Found --> H[Is hamming equal to zero?]
    H -- No --> I[Do nothing]
    H -- Yes --> J[Calculate pose and yaw]
    E --> K[Pulish VIO pose]
    J --> L[Publish pose and yaw]
    L --> C
    K --> C

Math

The scripts in this program use extremely basic linear algebra.

Equation for finding robot pose: TF,R = TF,A * TZ,A-1 * TZ,ZP * TZP,R

The T in each matrix simply means transformation.

TF,R = Tranformation matrix of field to robot also know as pose

TF,A = Transformation matrix of field to apriltag also know as the location of an apriltag

TZ,A -1 = the inverse of the matrix of zed to apriltag

TZ,ZP = The zed on the robot will be mounted at a negative 20 degree angle. This translation matrix will acount for that

TZP,R = Transformation matrix of the zed position of the robot to the center of the robot. This is so that the everything calculated will be relative to the center of the robot.

Further math explanation:

  1. TZ,A-1 = TA,Z

    TF,A * TA,Z = TF,Z

    The As cancel out a lot like train track multiplication. When multiplied together, these matrices now represent a transformation matrix of field to zed.

  2. TF,Z * TZ,ZP = TF,ZP

    The Zs cancel out so now the new transfomration matrix represents field to zed prime

    the word prime is added to something to show that something has been translated or rotated.

  3. TF,ZP * TZP,R = TF,R

    the ZPs cancel out to get the pose.

Prerequisites

In order to use these scripts, the Zed SDK, duckietown apriltags, numpy, opencv, and RobotPy NetworkTables must be installed on the device or computer that will be using them.

They can be installed by running the commands:

install numpy

pip install numpy

install opencv

pip install opencv-python

install Networktables

pip install pynetworktables

Instead of installing everything manually, the setup script could be run to install all dependencies. This script is found in the scripts folder.

make the script executable

chmod +x setup.sh

run the script

./setup.sh

Setup

In order to get the repo on the xavier, connect a computer to the xavier using the default IP address for the USB device server.

Then the files can be moved between the two systems using Secure Copy Protocol

scp -r .\Path_To_Code\ [email protected]:~

The tilda can be replaced by the directory in which the user would like the repository to be copied to

Ex:

scp -r .\Path_To_Code\ [email protected]:~/filepath/

2023vision's People

Contributors

silentschnitzel avatar suvamkonar avatar markcfong561 avatar al10029 avatar spazzinq 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.