There are two GUI interfaces which are useful for interacting with and visualizing experiments, documented below.
python python/gps/gps_main.py <EXPERIMENT_NAME>
The GPS Training GUI is composed of seven parts:
The Action Panel: Consists of 4 actions which can be performed by clicking the button, pressing the keyboard shortcut, or using the PS3 Controller shortcut:
stop
- stop the robot from collecting samples (after the current sample has completed), used to perform a manual reset of the robot’s armsreset
- reset the robot to the initial position (after the current sample has completed), used to perform a manual reset of the objects in the scenego
- start/restart the robot to collect samples (after using stop
, reset
, or fail
), used to resume training after stop, reset or failfail
- fail the current sample being collected and recollect that sample (after the current sample has completed), used to recollect a sample that was conducted under faulty conditionsThe Action Status Textbox: Indicates whether or not the actions were performed successfully or failed.
The Algorithm Status Textbox: Indicates the current status of the algorithm (sampling, calculating, logging data, etc.).
The Cost Plot: After each iteration, plots the cost per condition (as points) and the mean cost (as a connected line between iterations).
The Algorithm Output Textbox: After each iteration, outputs the iteration number and the mean cost, and for each condition, the cost, the step_multiplier, the linear Gaussian controller entropy, and the initial and final KL Divergences (for BADMM only).
To change what is printed, see the update
method of gps_training_gui.py
.
The 3D Trajectory Visualizer: After each iteration, plots the trajectory samples collected (green lines), the policy samples collected (blue lines), the linear gaussian controller means (dark red crosses), and the linear gaussian controller distributions (red ellipses).
The Image Visualizer: Displays the real-time images outputted by the PR2’s on-board Kinect. Contains the below two actions:
overlay_initial_image
- overlays the initial image set by the Target Setup GUI (press reset
at the end of sampling to reset the robot to the initial position and check if the image matches the initial image set by the Target Setup GUIoverlay_target_image
- overlays the target image set by the Target Setup GUI (press stop
at the end of sampling to stop the robot at the target position and check if the image matches the target image set by the Target Setup GUIpython python/gps/gps_main.py <EXPERIMENT_NAME> -t
The Target Setup GUI is composed of four parts:
The Action Panel: Consists of 12 actions which can be performed by clicking the button, pressing the keyboard shortcut, or using the PS3 Controller shortcut:
prev_target_number
- switch to the previous target number (0-9)next_target_number
- switch to the next target number (0-9)prev_actuator_type
- switch to the previous actuator type (TRIAL_ARM, AUXILIARY_ARM)next_actuator_type
- switch to the next actuator type (TRIAL_ARM, AUXILIARY_ARM)set_initial_position
- set the initial position (manually move the robot to the desired position and then press set)set_target_position
- set the target position (manually move the robot to the desired position and then press set)set_initial_image
- set the initial image (associated with the initial position)set_target_image
- set the target image (associated with the target position)move_to_initial
- move to the initial position (queries AgentROS to physically move the robot and lock in place)move_to_target
- move to the target position (queries AgentROS to physically move the robot and lock in place)relax_controller
- relaxes the robot controllers, so they can be moved again (after move_to_initial
or move_to_target
locks them in place)mannequin_mode
- toggles mannequin mode on or off (for the robot’s arms to stay in place after physically moving them)The Action Status Textbox: Indicates whether or not the actions were performed successfully or failed.
The Targets Textbox: Displays the target values for the current target number and actuator type, including:
target number
- the current target numberactuator type
- the current actuator typeinitial pose
- the initial poses’ joint angles
, end effector points
, and end effector rotations
target pose
- the target poses’ joint angles
, end effector points
, and end effector rotations
initial image
- the initial image associated with the initial pose, displayed on the bottom lefttarget image
- the target image associated with the target pose, displayed on the bottom rightThe Image Visualizer: Displays the real-time images outputted by the PR2’s on-board Kinect (defaults to the topic /camera/rgb/image_color). Has options to overlay the initial image and the target image.
1. Where do I find the configuration options for the GUIs?
GUI configuration options are located in /path/to/gps/python/gps/gui/config.py
. You can change the following options:
keyboard_bindings
- controls the keyboard shortcut bindingsps3_bindings
- controls the ps3 controller bindingsimage_on
- controls whether or not to display the image visualizerimage_topic
- sets the rostopic from which to listen for imagesimage_size
- sets the size of images, images above this size will be croppedfigsize
- controls the default figure size for the GUIstarget_output_fontsize
- controls the font size for the target outputinitial_mode
- starts the GPS Training GUI in this mode ('run'
to run on start, 'wait'
to wait on start)`algthm_output_fontsize
- controls the font size for the algorithm outputalgthm_output_max_display_size
- controls the max display size (maximum number of lines) for the algorithm output2. Why is the algorithm output text overflowing?
Matplotlib does not handle drawing text very smoothly. Here are some options:
_output_column_titles
and _update_iteration_data
functions of gps_training_gui.py
)algthm_output_fontsize
algthm_output_max_display_size
figsize
3. I am not using images. How do I turn off the Image Visualizer?
Set image_on
to False
.
4. How do I change the experiment information displayed at the start of training?
See the generate_experiment_info
function at the bottom of the gui/config.py
file.
5. How do I turn off the GPS Training GUI?
In the experiment hyperparams.py
file, look for the config
dictionary at the bottom of the file, and then set the gui_on
field to False
. GPS training will still run; however, you will be unable to interact with it through stop
, go
, fail
, and reset
or see any plots or visualizations.
6. I want to change the layout or content of the GUIs. How do I use the GUI components?
For basic examples of how to use the GUI components, see the GUI demos located at /path/to/gps/python/tests/tests_gui/gui_demos.py
. The code in gui/gps_training_gui.py
and gui/target_setup_gui.py
is also designed to be reusable and reconfigurable.