Skip to content

Instantly share code, notes, and snippets.

@korymath
Last active May 11, 2016 20:58
Show Gist options
  • Save korymath/3490b9860cea9c7355c1 to your computer and use it in GitHub Desktop.
Save korymath/3490b9860cea9c7355c1 to your computer and use it in GitHub Desktop.
running nao test simulations
Run the following in different tabs in terminal
MDP Constant
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r MDP -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Relative
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r MDP -m relative -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
Human
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r Human -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Constant and Human
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r MDPandHuman -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Relative, Simulated EMG, Real Robot
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.002 -p 1000 -a 1 -r MDP -m relative -n -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Relative, Real EMG, Real Robot
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.002 -p 1000 -a 1 -r MDP -m relative -n -e -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Constant + Human, Real EMG and Real Robot
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.002 -p 1000 -a 1 -r MDPandHuman -n -e -g 0.1 -u 0.05 -mean 0.005 -std 1.0
This open call could be used to run a parameter sweep with the average reward of the last 5000 steps as a comparison.
Turn off live plotting all together? This can be done by changing the -p to the tmax! That is one solution.
usage: blueberry_move_and_emg.py [-h] [-t TMAX] [-s SLEEP_TIME]
[-p PLOT_EVERY_N] [-a PERSIST_TIME_STEPS]
[-n] [-e] [-r REWARD_TYPE]
[-m MDP_REWARD_TYPE] [-o PORT]
[-g ANGLE_ERROR_THRESHOLD]
[-u ANGLE_UPDATE_THRESHOLD]
[-mean ALPHAU_CONST] [-std ALPHAS_CONST]
optional arguments:
-h, --help show this help message and exit
-t TMAX Maximum number of iterations. Default is 4000.
-s SLEEP_TIME How long does the agent rest for in ms, set speed of
algorithm. Default is 0.025, or about 30Hz.
-p PLOT_EVERY_N Update the plot every N iterations. Default is 10.
-a PERSIST_TIME_STEPS
Actions should persist for N iterations. Default is 3.
-n Use this flag to use the a physical robot. Default is
simulated robot.
-e Use this flag to use the a physical EMG signal.
Default is simulated EMG signal.
-r REWARD_TYPE Define the reward type for the learning agent, can
choose MDP, Human, or MDPandHuman. Default is MDP.
-m MDP_REWARD_TYPE Define the reward calculation for the learning agent
in the MDP. Can be constant (default) or relative.
-o PORT Define the simulation robot port.
-g ANGLE_ERROR_THRESHOLD
Define the angular error threshold. Default is 0.05.
-u ANGLE_UPDATE_THRESHOLD
Define the angular update threshold. Default is 0.05.
-mean ALPHAU_CONST Define the mean step size of the actor. Default is
0.0025.
-std ALPHAS_CONST Define the step size fraction of the mean step size of
the standard deviation of the actor. Default is 0.5
Running the new blueberry bot
cd ~/Dropbox/School/Graduate/CMPUT/projects/NAO/scripts_mac/blueberry/pynaoqi
/usr/bin/python blueberry_move_and_emg.py
Running with options:
/usr/bin/python blueberry_move_and_emg.py -t 10000 -s 0.025 -p 10 -a 1 -m relative -o 51737 -g 0.05 -u 0.05
cd /Applications/Choregraphe.app/Contents/Resources/bin/
./naoqi-bin
cd /Applications/Choregraphe.app/Contents/Resources/
./choregraphe
cd ~/Dropbox/School/Graduate/CMPUT/projects/NAO/scripts_mac
python kory_movement_live_plot.py
cd ~/Dropbox/School/Graduate/CMPUT/projects/NAO/scripts_mac
python kory_emg_good.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment