Skip to content
/ ISR18 Public
forked from VT-HPS/ISR18

Code for sensor and motors for ISR18 submarine with goal for fully autonomous submarine

Notifications You must be signed in to change notification settings

jer-j/ISR18

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ISR18

Repo Organization

\scripts # Scripts for setup, deployment, or data collection
\isr18
    \IMU     boilerplate IMU code (source from here, do not clone)
    \controls pd controller
    \sensors depth sensor
    \screen  
    \utils
        \logger.py logging things
        \config.py configs, magic numbers, constants
\pictures
\tests
    \data test data
    \... other tests 
  • avoid duplicating code
  • use snake_case, i.e. PEP style guide
  • use the exisiting folders as much possible
  • use a virtual environment, install packages with pip install requirements.txt

if you add dependency, update the requirements.txt with pip freeze > requirements.txt

to create a subpackage (not a module which is a .py file), use the following standard directory structure

\ISR18 
    \isr18
        \subpkg
            __init__.py
            module1.py
# __init__.py
from .subpkg import module1 # or whatever other things you want to be available when this subpkg imports

Vision

This package will be responsible for the following:

  1. collecting IMU data
  2. passing IMU data to controller
  3. passing controller output to motors
  4. monitoring battery charge
  5. logging the history of the above mentioned events and states
  6. maintaing and updating a GUI
  7. doing all of the above concurrently using multiprocessing

We will implement the following classes:

  • IMU
  • Motor
  • GUI
  • Controller

Perf Board Wiring Diagram

image

Raspberry Pi 4B Pin Setup

image image

SSH-ing into Raspberry Pi in the HPS Bay

  1. Your laptop’s wifi = Eduroam
  2. RP’s wifi = Eduroam
  3. Go into command prompt
    1. ssh hps@IP_ADDRESS
      1. If in the bay ip address might me 172.29.211.232
      2. ask for password from LE - hint: its 3 letters

IMU

IMU website

Vim Cheatsheet

Generally helpful stuff

Open a file for editing             vim path/to/file
Return to Normal mode               ESC   or <CTRL>+C
Close a file without edits          :q
Close a file saving edits           :wq
Close a file ignoring edits         :q!

Navigating around text

You have to be in Normal mode. Use ESC to get out of Visual, Replace, or Insert mode.

(cursor left)                       h
(cursor down)                       j
(cursor up)                         k
(cursor right)                      l
next word                           e
Jump to the first line              gg
Jump to the last line               G

Entering Text

Insert text before cursor               i
Insert text after cursor                a

Working with multiple files

Open a file in a horizontal split   :sp path/to/file.txt
Open a file in a vertical split     :vsp path/to/file.txt
Move to a split window page         <CTRL>+w and a direction key (h, j, k, or l)
Move to next window pane            <CTRL>w w
Make selected pane bigger           CTRL>w +  (yes, you need the shift key for the plus)
Make selected pane smaller          <CTRL>w -

Searching

Search for a word                       /<word>
Go to next match                        n
Find and replace on line                :s/<find>/<replace>
Find and replace globally               :%s/<find>/<replace>//gc

Manipulating text

cut the current line                dd
copy the current line               yy
paste below current line            p
paste above current line            P
Remove the character under cursor   x
Remove the character before cursor  X
Delete the word under cursor        de
Delete to the end of the line       d$

Remove five lines starting here     5dd
Copy five lines starting here       5yy 

indent this line                    >>
indent five lines starting here     5>>

Replace mode (overtype)             r

Visual Advanced selection

Visual mode                         v
Visual Line mode                    V
Visual Block mode                   <CTRL>v

Working with NERDTree

Open the NERDTree                   :NERDTree
Toggle the NERDTree on and off      :NERDTreeToggle
Open selected file                  <ENTER>
Open selected file in horiz. split  i
Open selected file in vert. split   v
File menu                           m
Help                                ?

Commands:

Run a command                           :!<command>
Open a shell                            :sh

Tasks

Combine Visual mode and cursor movement + Yank to copy or delete blocks

Remove 5 lines                      Vjjjdd  (Visual Line mode, highlights line 1, jj to go Down two lines, dd to delete)

Create a custom Map Leader key to make it easy to run your own commands. We'll make it easy to show and hide NERDtree with a simple shortcut. Add these two lines to your .vimrc file:

let mapleader = ","  
map <Leader>d :NERDTreeToggle<CR> :set number<CR>   

With that, you can open and close NERDTree with

,d

in Normal mode.

About

Code for sensor and motors for ISR18 submarine with goal for fully autonomous submarine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.6%
  • MATLAB 7.7%
  • C++ 1.7%