Git Product home page Git Product logo

brandonhanner / vrc-2021-phase-ii Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bellflight/vrc-2021-phase-ii

0.0 0.0 0.0 9.06 MB

The Vertical Robotics Competition is a robotics competition put on by Bell Flight to challenge high school students to develop STEM skills outside of the classroom and work together to solve engineering challenges in a fun robotics competition in the vertical dimension.

Home Page: https://bellflight.gitbook.io/vertical-robotics-competition-phase-ii/

License: MIT License

Shell 0.23% Python 37.11% Dockerfile 0.08% Lua 62.36% CMake 0.01% C++ 0.20%

vrc-2021-phase-ii's Introduction

VRC-2021-Phase-II

Setup

Before you run the setup script, ensure that you are able to connect to the following domains. Some schools or networks may block these:

# used for linux system packages
https://repo.download.nvidia.com
http://ports.ubuntu.com
http://ppa.launchpad.net
https://librealsense.intel.com
http://keyserver.ubuntu.com or http://keys.gnupg.net
# used for python packages
https://pypi.org
https://files.pythonhosted.org
# used for downloading code
https://github.com
https://github-releases.githubusercontent.com
https://developer.nvidia.com
# used for Docker containers
https://nvcr.io
https://index.docker.io
https://ghcr.io

Run the following commands:

sudo apt update # Update the apt sources
sudo apt install git -y # Install git
git clone https://github.com/bellflight/VRC-2021-Phase-II ~/Documents/VRC-2021-Phase-II # Clone the repo
cd ~/Documents/VRC-2021-Phase-II # Change to the directory the repo was cloned to
chmod +x setup.sh # Make the setup script executable
./setup.sh # Run the setup script

Please note, this setup script WILL take a while the first time (depending on your download speed), and you may need to re-enter your sudo password a few times.

Usage

To start the VRC software, just run:

# Start the Docker Compose stack
sudo docker-compose up -d

To stop the VRC software, run:

# Stop the Docker Compose stack
sudo docker-compose down

If you ever need to update the VRC software, run:

# Update the git repo
git pull
# Re-run the setup script
./setup.sh

Additionally, if you have problems with the VIO module not connecting to the T265 camera, try the following in order:

  1. Run the command rs-enumerate-devices. This seems to help librealsense pick up the camera.
  2. Run the script reset_usb.sh (you may need to do chmod +x reset_usb.sh first). This resets all the USB devices.
  3. Unplug the T265 camera and plug it back in.
  4. Restart the Jetson.

MQTT Topics

For each topic in the list, the sublist are the keys available in the dictionary that is sent on the topic.

This is a list of topics you can subscribe to, to obtain telemetry information.

  • vrc/battery
    • "voltage": Battery voltage
    • "soc": State of charge, aka percent full
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/status
    • "armed": True/False if the drone is currently armed
    • "mode": Current flight mode, which is one of the following:
      • "UNKNOWN"
      • "READY"
      • "TAKEOFF"
      • "HOLD"
      • "MISSION"
      • "RETURN_TO_LAUNCH"
      • "LAND"
      • "OFFBOARD"
      • "FOLLOW_ME"
      • "MANUAL"
      • "ALTCTL"
      • "POSCTL"
      • "ACRO"
      • "STABILIZED"
      • "RATTITUDE"
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/location/local
    • "dX": X position in a local North/East/Down coordinate system
    • "dY": Y position in a local North/East/Down coordinate system
    • "dZ": Z position in a local North/East/Down coordinate system
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/location/global
    • "lat": Latitude in global coordinates
    • "lon": Longitude in global coordinates
    • "alt": Relative altitude in global coordinates
    • "hdg": Heading
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/location/global
    • "lat": Latitude relative to the home position
    • "lon": Longitude relative to the home position
    • "alt": Relative altitude to the home position
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/attitude/euler
    • "roll": Roll in degrees
    • "pitch": Pitch in degrees
    • "yaw": Yaw in degrees
    • "timestamp": Time the message was sent in ISO 8601 format
  • vrc/velocity
    • "vX": X velocity in a local North/East/Down coordinate system
    • "vY": Y velocity in a local North/East/Down coordinate system
    • "vZ": Z velocity in a local North/East/Down coordinate system
    • "timestamp": Time the message was sent in ISO 8601 format

This is a list of topics you can send data to, to make things happen on the drone:

  • vrc/pcc/set_base_color
    • "wrgb": A list of 4 ints between 0 and 255 to set the base color of the LEDs. Example: [255, 0, 128, 255].
  • vrc/pcc/set_temp_color
    • "wrgb": A list of 4 ints between 0 and 255 to set a temporary color of the LEDs. Example: [255, 0, 128, 255].
    • "time": Optional float for the number of seconds the color should be set for. Default is 0.5.
  • vrc/pcc/set_servo_open_close
    • "servo": ID of the servo to open or close as a int. This is 0-indexed.
    • "action": Either the literal string "open" or "close".
  • vrc/pcc/set_servo_min
    • "servo": ID of the servo to set the minimum pulse width of as a int. This is 0-indexed.
    • "min_pulse": A float between 0 and 1000.
  • vrc/pcc/set_servo_max
    • "servo": ID of the servo to set the maximum pulse width of as a int. This is 0-indexed.
    • "max_pulse": A float between 0 and 1000.
  • vrc/pcc/set_servo_pct
    • "servo": ID of the servo to set the percent of as a int. This is 0-indexed.
    • "percent": A float between 0 and 100.
  • vrc/pcc/reset
    • There is no payload required for this topic. This will reset all of the peripheals.

This is a list of topics that are populated by the apriltag module:

  • vrc/apriltags/raw

    • id - the id of the tag

    • pos

    • x - the position in meters of the camera relative to the tag's x frame

    • y - the position in meters of the camera relative to the tag's y frame

    • z - the position in meters of the camera relative to the tag's z frame

    • rotation - the 3x3 rotation matrix

  • vrc/apriltags/visible_tags

    • id - the id of the tag
      • horizontal_dist - the horizontal scalar distance from vehicle to tag, in cm

      • vertical_dist - the vertical scalar distance from vehicle to tag, in cm

      • angle_to_tag - the angle formed by the vector pointing from the vehicles body to the tag in world frame relative to world-north

      • heading - the heading of the vehicle in world frame

      • pos_rel - the relative position of the vehicle to the tag in world frame in cm

        • x - the x (+north/-south) position of the vehicle relative to the tag in world frame (for reference the mountain is north of the beach)
        • y - the y (+east/-west) position of the vehicle relative to the tag in world frame
        • x - the z (+down/-up) position of the vehicle relative to the tag in world frame (no, this is not a typo, up is really - )
      • pos_world - the position of the vehicle in world frame in cm (if the tag has no truth data, this will not be present in the output)

        • x - the x position of the vehicle relative to the world origin (this is the ship) in world frame (for reference the mountain is north of the beach)
        • y - the y position of the vehicle relative to the world origin in world frame
        • z - the z position of the vehicle relative to the world origin in world frame
    • vrc/apriltags/selected
      • tag_id - the id of the tag
      • pos - the position of the vehicle in world frame in cm
        • n - the +north position of the vehicle relative to the world origin in world frame
        • e - the +east position of the vehicle relative to the world origin in world frame
        • d - the +down position of the vehicle relative to the world origin in world frame
      • heading - the heading of the vehicle in world frame

vrc-2021-phase-ii's People

Contributors

brandonhanner avatar nathanvaughn avatar nathanv-bell avatar dbaldwin avatar pcsmithy 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.