Skip to content

Kinesthetic Teaching GUI

Ryan Petschek edited this page Jun 22, 2017 · 11 revisions

Prerequisites

Kinesthetic Teaching GUI

Launching the Kinesthetic Teaching GUI

  • Start a roscore
  • If using the simulator, start Gazebo: roslaunch hlpr_gazebo vector.launch
  • Customize and start robot services: roslaunch hlpr_bringup customize_start_robot_services.launch
    • Note: You need to startup all services related to playback and recording. For details how, look at the hlpr_bringup wiki, which has a custom launch file with two flags: kinesthetic_record and kinesthetic_playback. Set these both to true.
  • Start the object locator service: roslaunch object_location object_location_engine.launch
  • Launch the GUI: rosrun rqt_kinesthetic_teaching rqt_kinesthetic_teaching
    • If the GUI fails to start, you may have to run rqt --force-discover

Parsing, loading, and inspecting .bag files and folders will now be functional.

Starting additional services

To playback or record keyframes, two action servers must be started. Run the following in new terminals:

  • You don't need this step if you set the correct flags on the customize_start_robot_services.launch file
  • Playback demonstration action server: roslaunch hlpr_record_demonstration start_playback_services.launch
  • Record demonstration action server: roslaunch hlpr_record_demonstration start_record_services.launch

Parsing, loading, and inspecting .bag files

To parse and load a single .bag file containing a demonstration, click the open button or enter the path to the file in the text field and press enter. The .bag file will then be parsed and the keyframe data contained displayed in a tree format at the bottom.

The tree format is as follows:

  • Keyframe number (0-indexed) and ISO 8061 timestamp
  • Robot topic recorded
  • Recorded message fields and their corresponding values

When opening a folder, all .bag files that are direct children will be parsed and loaded. The previously mentioned tree format will be preceeded by the file's full path.

Playing back demonstrations

Currently, due to limitations with the playback demonstration action server, only full .bag files can be played from start to finish. Individual keyframes or selected keyframes can not be played.

With a .bag file open and the playback demonstration action server started, keyframe playback can be started by clicking the "Play demo" button at the bottom of the window.

With a folder of .bag files open and the playback demonstration action server started, keyframe playback can be started by selecting a file path name in the tree view and clicking the "Play demo" button at the bottom of the window.

Keyframe recording and saving

Keyframe recording is enabled by clicking the "Save" button at the top of the window. Optionally, a timestamp can be added to the save file's name by checking the "Add timestamp to new saves" box. The output window will be cleared.

Using the UI to record and save demonstrations

To begin adding keyframes, move the robot to its startig position and click the "Start trajectory" or "Start keyframe" record buttons. The status area at the bottom right will display "Keyframe recording started" and the secondary status above the output window will display "1 keyframe(s) recorded" as the starting position has been recorded as a keyframe.

New keyframes will display in the output window in a similar format to when saved files are opened. However, recorded topics and message values cannot (yet) be viewed while a recording is in progress.

The robot's arm can now be moved. It's position will be continually recorded if a trajectory was started. Otherwise, new keyframes can be added by clicking the "Add keyframe" button.

Clicking the "Open hand" and "Close hand" buttons will open / close the robot's gripper and automatically record a new keyframe.

To end the recording, move the robot to its final position and click the "End" button. A keyframe for the final position will be recorded and the .bag file will be written, closed, and then automatically parsed for immediate inspection and playback.

Using speech commands to record and save demonstrations hands-free

With a new keyframe recording opened by clicking the "Save" button, speech commands published to the SpeechListener class' speech topic will be read and acted upon. This allows for hands-free control of keyframe recording.