Difference between revisions of "Testing procedure"
Jump to navigation
Jump to search
Ikramonjur (talk | contribs) (started new "testing" section) |
(→Pre-test checks (in lab): move /etc/network/interfaces notes over to Connecting to the Pi) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 14: | Line 14: | ||
# At any point during testing if the front wheel turns in an uncontrolled manner or does not respond after initialization: | # At any point during testing if the front wheel turns in an uncontrolled manner or does not respond after initialization: | ||
## turn off front motor | ## turn off front motor | ||
− | ## end the test using bash end.sh | + | ## end the test using <code>bash end.sh</code>;. |
## reset the arduino (button under corner of board) | ## reset the arduino (button under corner of board) | ||
## turn front motor back on | ## turn front motor back on | ||
− | ## re-start test using start.sh | + | ## re-start test using <code>start.sh</code> |
## if this happens multiple times in a row: | ## if this happens multiple times in a row: | ||
## instead of resetting the arduino, unplug the battery (you will have to ssh into the pi again) | ## instead of resetting the arduino, unplug the battery (you will have to ssh into the pi again) | ||
− | ## Try running the startup procedure (up to and including bash start.sh) with the RC controller off - then turn the RC on | + | ## Try running the startup procedure (up to and including <code>bash start.sh</code>) with the RC controller off - then turn the RC on |
# If you have any issues, call: | # If you have any issues, call: | ||
#* Aviv for a testing question | #* Aviv for a testing question | ||
Line 33: | Line 33: | ||
#* If the pi is on Locomotion Lab wifi: open terminal and <code>ssh pi@10.0.1.50</code> (password <code>raspberry</code>) | #* If the pi is on Locomotion Lab wifi: open terminal and <code>ssh pi@10.0.1.50</code> (password <code>raspberry</code>) | ||
#* If the pi is on RPiwireless (its ad hoc network): see [[Connecting to the Pi#Ad hoc]]. | #* If the pi is on RPiwireless (its ad hoc network): see [[Connecting to the Pi#Ad hoc]]. | ||
− | #* To change which network the pi uses | + | #* To change which network the pi uses, see [[Connecting to the Pi#General notes]]. |
− | + | # upload arduino code for testing then connect the pi to the arduino | |
− | |||
− | # | ||
− | # upload arduino code for testing then connect the pi to the arduino | ||
# turn on front motor (check all three switches: e-stop, RC e-stop, rocker switch) | # turn on front motor (check all three switches: e-stop, RC e-stop, rocker switch) | ||
# run a test with bike on stand to make sure that data capturing is working | # run a test with bike on stand to make sure that data capturing is working | ||
Line 68: | Line 65: | ||
#** Best option: adhoc | #** Best option: adhoc | ||
## Look for the RPiWireless network after turning on the pi | ## Look for the RPiWireless network after turning on the pi | ||
− | ## Connect via ssh: 192.168.1.1 | + | ## Connect via ssh: <code>ssh pi@192.168.1.1</code>, 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) <code> sudo cp /etc/network/interfaces-adhoc /etc/network/interfaces"</code> | + | ##*'''''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) <code> sudo cp /etc/network/interfaces-adhoc /etc/network/interfaces"</code> (''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 | + | ##*If you want to get back to a wifi network (for connecting to Locomotion Lab) type the command below while logged into the pi <code>sudo cp /etc/network/interfaces-wifi /etc/network/interfaces</code>(''power cycle pi for change to take effect'') |
− | <code>sudo cp /etc/network/interfaces-wifi /etc/network/interfaces</code> | + | ## [[Connecting to the Pi#Ethernet|Connect to the Pi via Ethernet]] |
− | + | # Start the test | |
− | < | + | ## in terminal: <code>bash start.sh &</code> (the & makes it run in the background) |
+ | ## Wait until new statements stop being printed to the console: you should see "process[recording-5]: started with pid <some number>" | ||
+ | ## Press enter to get a prompt | ||
+ | # 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 | ||
+ | # End the test | ||
+ | ## In terminal: <code>bash end.sh</code> | ||
+ | ## Wait a bit, then press enter to get a prompt back | ||
+ | ## if you aren't brought back to command line, then press control+c to kill the process | ||
+ | ## you should see "Generating CSV files at..." | ||
+ | # Record the timestamp for this test. From the home directory, <code>roscd bike/bagfiles/ && ls</code>, then you can figure out the timestamp. | ||
+ | # repeat until all tests are run | ||
+ | # load up the car; return to the lab | ||
+ | |||
+ | == Post-test (in lab) == | ||
+ | # unpack the testing bag and return everything to its place | ||
+ | # Turn Pi on | ||
+ | # Connect to LocomotionLab wifi (again, password is <code>walkingrobot</code>) | ||
+ | # SSH into Pi (instructions are above) | ||
+ | # Move files from Pi to computer. Three options: | ||
+ | #* Option 1 | ||
+ | #*# open a new terminal window and cd into the location on your computer where you want to dump the data | ||
+ | #*# run <code>scp pi@'''ip address''':/home/pi/ros_ws/src/bike/bagfiles/bike_*timestamp.csv .</code> with password "raspberry" | ||
+ | #*#* example: <code>scp pi@10.0.1.50:/home/pi/ros_ws/src/bike/bagfiles/gps_2017-08-02~~12-22-14-PM.csv .</code> (Note the period after the csv; it means "send these files to the current directory") | ||
+ | #*# (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") | ||
+ | #*# 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 | ||
+ | #*# open a new terminal window and cd into the location on your computer where you want to dump the data | ||
+ | #*# Run <code>rsync -Pav -e 'ssh -i sshkey' 'pi@10.0.1.25:/home/pi/ros_ws/src/bike/bagfiles/*.csv' .</code> with password "raspberry" to transfer csv files | ||
+ | #*# Run <code>rsync -Pav -e 'ssh -i sshkey' 'pi@10.0.1.25:/home/pi/ros_ws/src/bike/bagfiles/*.bag' .</code> with password "raspberry" to transfer bag files | ||
+ | #* Option 3 (only gives GPS files) | ||
+ | #*# Make sure you have the Playback .jar file: visit https://github.com/CornellAutonomousBikeTeam/Playback/releases and get the latest release | ||
+ | #*# Run the .jar file: <code> java -jar /target/Playback-X.jar</code> | ||
+ | #*# Next to "Current save location", choose the location where you want to save files | ||
+ | #*# Next to "Connected to bike at", change to pi's IP address | ||
+ | #*# Click "Download CSV list" | ||
+ | #*# From dropdown menu, select file that you want to open and click "Open". This will download the GPS file, then launch a viewer. | ||
+ | # If the tests were good or interesting, move files in Pi to "old" folder: <code>roscd bike/bagfiles && mv * old/</code> (otherwise, delete them so they don't take up too much space) | ||
+ | # move files from your computer to fileshare/drive/database (optional) | ||
+ | # turn off pi and bike | ||
+ | # fill out database metadata | ||
+ | # upload videos (if they were cool) |
Latest revision as of 22:58, 27 January 2020
The testing procedure, transcribed from the spreadsheet in the drive.
Pre-test
- 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)
- At any point during testing if the front wheel turns in an uncontrolled manner or does not respond after initialization:
- turn off front motor
- end the test using
bash end.sh
;. - reset the arduino (button under corner of board)
- turn front motor back on
- re-start test using
start.sh
- if this happens multiple times in a row:
- instead of resetting the arduino, unplug the battery (you will have to ssh into the pi again)
- Try running the startup procedure (up to and including
bash start.sh
) with the RC controller off - then turn the RC on
- 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)
- Connect to Locomotion Lab wifi (password is "walkingrobot" without quotes)
- Turn on bike using silver switch on back of ammo box to turn on the pi
- SSH into pi
- If the pi is on Locomotion Lab wifi: open terminal and
ssh pi@10.0.1.50
(passwordraspberry
) - If the pi is on RPiwireless (its ad hoc network): see Connecting to the Pi#Ad hoc.
- To change which network the pi uses, see Connecting to the Pi#General notes.
- If the pi is on Locomotion Lab wifi: open terminal and
- upload arduino code for testing then connect the pi to the arduino
- turn on front motor (check all three switches: e-stop, RC e-stop, rocker switch)
- run a test with bike on stand to make sure that data capturing is working
- in terminal:
source start.sh &
-- the '&' makes start.sh run in the background - wait a few seconds until the console stops printing - you should see "process[recording-5]: started with pid [some number]"
- press enter to get back to command line
- in terminal:
- check ROS topic to make sure data is published
- in terminal: "rostopic list"
- from this list check that rosnodes that you care about (ie for nav tests we care about bike state,gps,paths,and nav instr
- in terminal: "rostopic echo /bike_state"
- press control+c to get back to command line
- end the test
- in terminal:
. end.sh
- wait for output to stop, then press enter to get your prompt back
- in terminal:
- make sure all files from previous tests have been moved to old
- At terminal, run:
roscd bike/bagfiles ls
- There should only be an "old" folder here; if not, run
mv * old
to move everything else into it, thencd
to get back to the home directory.
- At terminal, run:
- replace battery in bike with 29V battery
Testing
- load up the car
- bike
- testing bag
- front motor stand
- go to a testing location (blot/plantations/barton/gamefarm)
- unload
- turn on front motor
- ssh into the pi
- 2 options: adhoc pi network or ethernet cable
- Best option: adhoc
- Look for the RPiWireless network after turning on the pi
- 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)
- 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)
- Connect to the Pi via Ethernet
- 2 options: adhoc pi network or ethernet cable
- Start the test
- in terminal:
bash start.sh &
(the & makes it run in the background) - Wait until new statements stop being printed to the console: you should see "process[recording-5]: started with pid <some number>"
- Press enter to get a prompt
- in terminal:
- 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
- End the test
- In terminal:
bash end.sh
- Wait a bit, then press enter to get a prompt back
- if you aren't brought back to command line, then press control+c to kill the process
- you should see "Generating CSV files at..."
- In terminal:
- Record the timestamp for this test. From the home directory,
roscd bike/bagfiles/ && ls
, then you can figure out the timestamp. - repeat until all tests are run
- load up the car; return to the lab
Post-test (in lab)
- unpack the testing bag and return everything to its place
- Turn Pi on
- Connect to LocomotionLab wifi (again, password is
walkingrobot
) - SSH into Pi (instructions are above)
- Move files from Pi to computer. Three options:
- Option 1
- open a new terminal window and cd into the location on your computer where you want to dump the data
- 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")
- example:
- (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")
- 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
- open a new terminal window and cd into the location on your computer where you want to dump the data
- 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 - 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)
- Make sure you have the Playback .jar file: visit https://github.com/CornellAutonomousBikeTeam/Playback/releases and get the latest release
- Run the .jar file:
java -jar /target/Playback-X.jar
- Next to "Current save location", choose the location where you want to save files
- Next to "Connected to bike at", change to pi's IP address
- Click "Download CSV list"
- From dropdown menu, select file that you want to open and click "Open". This will download the GPS file, then launch a viewer.
- Option 1
- 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) - move files from your computer to fileshare/drive/database (optional)
- turn off pi and bike
- fill out database metadata
- upload videos (if they were cool)