Skip to content

FRC-1721/JavaSandbox

Repository files navigation

JavaSandbox

Prerequisites

Windows and Linux

  1. Install the latest version of WPILib from https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html
  • Follow the instruction for downloading, extracting, and installing
  1. Create a GitHub account on https://github.com/
  • If you already have one, skip this step
  • This is mandatory for adding code changes to our repositories on GitHub
  • Your ssh public keys will be in your account, these are needed to push your code

Windows only

  1. Install the 'git for Windows' command prompt from https://git-scm.com/downloads
  • This is needed to obtain the JavaSandbox code from the GitHub repository
  • It also contain ssh, which will be very useful
  • I recommend opening the command prompt after installing it, pinning it to the Windows taskbar, and then setting the 'Start in' directory to the location of your choice

Linux only

  1. Install git with
    sudo apt install git

git

  • Type the following from the command line to clone the repository
    git clone git@github.com:FRC-1721/JavaSandbox.git
  • Check the type of remote communication used for the repository. Useful if you are trying to push code and your repository was accidentally cloned as HTTPS.
    git remote -v
  • Change the type of communication manually or change your local code to point to a different repository.
    • Example 1... I cloned the repository using HTTPS and then could not do a push, since I need to use SSH.
    • Example 2... I created the JavaSandbox repository in my own personal GitHub account and then created a new one in the FRC-1721 GitHub; I then used this command to reassociate my code so I could push it.
    git remote set-url origin git@github.com:FRC-1721/JavaSandbox.git
  • Type the following to create your own branch
    git checkout -b YourBranchName
  • Type the following to rename your own branch (useful if you came up with new ideas since creation)
    git branch -m YourBranchName YourNewBranchName
  • Type the following to add changes that will will be used in a new commit that you would like added to the codebase
    git add .
  • Type the following to commit your changes
    git commit -m "Add your comment"
  • Type the following to push your changes to GitHub for merging into the repository
    git push -u origin YourBranchName
  • Go to the link that is shown and prepare to create a draft or official pull request
    • Choose the branch you want to merge to, usually main
    • Add thorough notes and a title
    • Click 'Create pull request' or 'Create Draft request'

Initial Setup of git

  • Access: You will need to be authorized for the desired repositories on github.com/FRC-1721 in order to add anything. See the Software lead and/or mentors for push access.
  • If you are using your own laptop or have your own login on a VM on the Proxmox server, you should tell git your user information by:
    1. Typing the following and replace "Your Name" with your actual name, make sure to use the double quotes
    git config --global user.name "FirstName LastName"
    1. Typing the following and replace "your_email@example.com" with the email you use with GitHub, make sure to use the double quotes
    git config --global user.email "your_email@example.com"
  • If you are using a shared laptop, you should tell git your user information by:
    1. Going to the directory that contains your repository
    2. Typing the following and replace "Your Name" with your actual name, make sure to use the double quotes
    git config user.name "FirstName LastName"
    1. Typing the following and replace "your_email@example.com" with the email you use with GitHub, make sure to use the double quotes
    git config user.email "your_email@example.com"
  • Create ssh keys
    1. These are mandatory for pushing your code to GitHub
    2. Run this command to generate a new SSH key
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    • Replace "your_email@example.com" with the email you use for GitHub
    • Accept the default location to save the key
    • You do not need to use a passphrase, but it is always recommended. If you forget it, you will have to go through this process again
    1. Start the ssh agent
    eval "$(ssh-agent -s)"
    1. Add your SSH private key to the agent
    ssh-add ~/.ssh/id_rsa
    1. Share your ssh public key with GitHub by:
    cat ~/.ssh/id_rsa.pub
    • This will display your public SSH key. The key should start with ssh-rsa and end with your email address.
    • Copy the entire key (including ssh-rsa at the beginning and your email at the end).
      a) Log in to your personal GitHub account, go to 'settings', go to 'SSH and GPG keys'
      b) Click the 'New SSH key' button
      c) Paste your public key into the 'Key field' and give it a title
      d) Click 'Add SSH key'
      e) Test if it works with:
    ssh -T git@github.com
  • Use SSH over a different port
    • The firewall blocks the default SSH port (22), but GitHub supports SSH over port 443, which is usually used for HTTPS
    • Edit the ~/.ssh/config file and add or change it to the following
    Host github.com
      Hostname ssh.github.com
      Port 443
    • Test the connection with:
    ssh -T git@github.com

PS2 Controller

  • Type the following to list the USB devices available
    lsusb
    or
    ls /dev/input
  • Type the following to see what the system is mapping the input to
    sudo dmesg | grep -i usb
  • Use the following to test the joystick (my input is on js1)
    sudo apt install joystick
    jstest /dev/input/js1
  • In the Simulator, make sure to drag the detected 'System joystick' to Joysticks

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages