Testing procedure

From Bike Wiki
Jump to navigation Jump to search

The testing procedure, transcribed from the spreadsheet in the drive.

Pre-test

  1. Collect testing bag
    • ethernet with dongle
    • car ACDC adapter
    • computer for sshing into the Pi (preferably a mac, but Dylan's laptop works fine too)
    • Voltmeter (multimeter with leads)
    • RC controller
    • spare batteries for RC
    • spare battery for Bike (charged to 29V)
    • tape (duct, masking)
  2. At any point during testing if the front wheel turns in an uncontrolled manner or does not respond after initialization:
    1. turn off front motor
    2. end the test using bash end.sh;.
    3. reset the arduino (button under corner of board)
    4. turn front motor back on
    5. re-start test using start.sh
    6. if this happens multiple times in a row:
    7. instead of resetting the arduino, unplug the battery (you will have to ssh into the pi again)
    8. Try running the startup procedure (up to and including bash start.sh) with the RC controller off - then turn the RC on
  3. If you have any issues, call:
    • Aviv for a testing question
    • Will/Olav/Dylan/Michelle/Aviv for a hardware question
    • Fotini for a navigation question
    • Jared/Pehuen for a ROS question

Pre-test checks (in lab)

  1. Connect to Locomotion Lab wifi (password is "walkingrobot" without quotes)
  2. Turn on bike using silver switch on back of ammo box to turn on the pi
  3. SSH into pi
  4. upload arduino code for testing then connect the pi to the arduino
  5. turn on front motor (check all three switches: e-stop, RC e-stop, rocker switch)
  6. run a test with bike on stand to make sure that data capturing is working
    1. in terminal: source start.sh & -- the '&' makes start.sh run in the background
    2. wait a few seconds until the console stops printing - you should see "process[recording-5]: started with pid [some number]"
    3. press enter to get back to command line
  7. check ROS topic to make sure data is published
    1. in terminal: "rostopic list"
    2. from this list check that rosnodes that you care about (ie for nav tests we care about bike state,gps,paths,and nav instr
    3. in terminal: "rostopic echo /bike_state"
    4. press control+c to get back to command line
  8. end the test
    1. in terminal: . end.sh
    2. wait for output to stop, then press enter to get your prompt back
  9. make sure all files from previous tests have been moved to old
    1. At terminal, run:
      roscd bike/bagfiles
      ls
    2. There should only be an "old" folder here; if not, run
      mv * old
      to move everything else into it, then
      cd
      to get back to the home directory.
  10. replace battery in bike with 29V battery

Testing

  1. load up the car
    • bike
    • testing bag
    • front motor stand
  2. go to a testing location (blot/plantations/barton/gamefarm)
  3. unload
  4. turn on front motor
  5. ssh into the pi
    • 2 options: adhoc pi network or ethernet cable
      • Best option: adhoc
    1. Look for the RPiWireless network after turning on the pi
    2. Connect via ssh: ssh pi@192.168.1.1, password is 'raspberry'
      • NOTE: If you do not see RPI wireless ssh into the pi using locomotion lab then type the following command to switch to an ad-hoc network (you will see RPI wireless after you execute the command below, but no longer be able to log in via locomotion lab) sudo cp /etc/network/interfaces-adhoc /etc/network/interfaces" (power cycle pi for change to take effect)
      • If you want to get back to a wifi network (for connecting to Locomotion Lab) type the command below while logged into the pi sudo cp /etc/network/interfaces-wifi /etc/network/interfaces(power cycle pi for change to take effect)
    3. Connect to the Pi via Ethernet
  6. Start the test
    1. in terminal: bash start.sh & (the & makes it run in the background)
    2. Wait until new statements stop being printed to the console: you should see "process[recording-5]: started with pid <some number>"
    3. Press enter to get a prompt
  7. Run the test. If the test requires the bike to move quickly, unplug the Ethernet and run the test; otherwise, keep the ethernet plugged in for simplicity
  8. End the test
    1. In terminal: bash end.sh
    2. Wait a bit, then press enter to get a prompt back
    3. if you aren't brought back to command line, then press control+c to kill the process
    4. you should see "Generating CSV files at..."
  9. Record the timestamp for this test. From the home directory, roscd bike/bagfiles/ && ls, then you can figure out the timestamp.
  10. repeat until all tests are run
  11. load up the car; return to the lab

Post-test (in lab)

  1. unpack the testing bag and return everything to its place
  2. Turn Pi on
  3. Connect to LocomotionLab wifi (again, password is walkingrobot)
  4. SSH into Pi (instructions are above)
  5. Move files from Pi to computer. Three options:
    • Option 1
      1. open a new terminal window and cd into the location on your computer where you want to dump the data
      2. run scp pi@ip address:/home/pi/ros_ws/src/bike/bagfiles/bike_*timestamp.csv . with password "raspberry"
        • example: scp pi@10.0.1.50:/home/pi/ros_ws/src/bike/bagfiles/gps_2017-08-02~~12-22-14-PM.csv . (Note the period after the csv; it means "send these files to the current directory")
      3. (this will get you the "gps" csv file, but you can do this multiple times and change "gps" to other file names like "bike" or "kalman pub")
      4. if you want to move an entire directory, make sure you add the flag -r ("recursive") so you would have "scp -r pi@*ip address*:/home/pi/ros_ws/src/bike/launch ."
    • Option 2
      1. open a new terminal window and cd into the location on your computer where you want to dump the data
      2. Run rsync -Pav -e 'ssh -i sshkey' 'pi@10.0.1.25:/home/pi/ros_ws/src/bike/bagfiles/*.csv' . with password "raspberry" to transfer csv files
      3. Run rsync -Pav -e 'ssh -i sshkey' 'pi@10.0.1.25:/home/pi/ros_ws/src/bike/bagfiles/*.bag' . with password "raspberry" to transfer bag files
    • Option 3 (only gives GPS files)
      1. Make sure you have the Playback .jar file: visit https://github.com/CornellAutonomousBikeTeam/Playback/releases and get the latest release
      2. Run the .jar file: java -jar /target/Playback-X.jar
      3. Next to "Current save location", choose the location where you want to save files
      4. Next to "Connected to bike at", change to pi's IP address
      5. Click "Download CSV list"
      6. From dropdown menu, select file that you want to open and click "Open". This will download the GPS file, then launch a viewer.
  6. If the tests were good or interesting, move files in Pi to "old" folder: roscd bike/bagfiles && mv * old/ (otherwise, delete them so they don't take up too much space)
  7. move files from your computer to fileshare/drive/database (optional)
  8. turn off pi and bike
  9. fill out database metadata
  10. upload videos (if they were cool)