ObjectiveThis objective of this project is to further develop an existing graphical tool for creating and editing kinematics XML files. The original functionality of this tool was limited and it did not interact with the Mirage simulator. Our goals for this project were two-fold: to create a more robust interface which would give the user greater control over the kinematic structure and to enable the interface to provide immediate visual feedback by displaying the resulting structure in Mirage. In addition to modifying the Denavit-Hartenberg parameters, users should be able to construct arbitrary kinematic chains to represent new robots or add to existing robots.
OverviewTekkotsu and Mirage represent robot kinematic structures as XML files. These files describe robots as a tree of joints together with their physical properties. The relationship between the joints conforms to the modified Denavit-Hartenberg convention. Mirage is a graphical simulator which takes the kinematics file and constructs a visual representation of the robot in 3D space using predefined meshes to represent the robots components. The DH Wizard interface communicates with Mirage by streaming XML data containing changes in the robot structure over a network socket.
Interface ImprovementsThe DH Wizard interface parses the kinematic file into a collapsible tree structure of the robot joints which is displayed on the left half of the window. Selecting a node will display the parameters corresponding to that joint in the fields on the right half of the screen. In addition to the four Denavit-Hartenberg parameters, users may modify the mass of the joint, its offset, and the limits of the joint's motion. Note that all angle measurements are given in radians. The angle slider allows the user to manipulate the joint within the minimum and maximum bounds. These changes are for visualization only and are not saved as part of the .kin file. Selecting the "add" button creates a new joint branching from the selected joint. The user will be prompted to enter a name for the new joint. The name maybe modified by selecting the "rename" button. Selecting the "remove" button deletes the selected joint and all links that branch from it. The "clear" button removes all joints except the base reference frame, which allows a completely new kinematic structure to be built. In addition to the new features, a menu bar was added which allows users to save the kinematics wherever they choose or to open a different .kin file.
Interacting with MirageOne of the major improvements to the DH Wizard was enabling the user interface to communicate with the Mirage simulator. Mirage receives robot data over a network socket (19785 by default). Mirage receives XML describing the structure of a robot and then listens for a stream of position changes for the robot joints. This communication protocol does not permit changes to robot structure after the initial robot is loaded. In order to bypass this issue and enable live structural changes, we initialize a new connection to Mirage and create an entirely new robot with the desired structure each time we make a change. As a consequence, some lag and flickering occurs when structural changes are made. Mirage displays the robot links using predefined meshes. The interface allows the user to specify the mesh file used by Mirage to represent each joint. The mesh files should be stored in Tekkotsu/tools/mirage/media (drop the .mesh suffix). Although the user must use a predefined mesh for each joint, the DH Wizard now enables the user to scale the mesh along its coordinate axes, as seen in the screenshots below.
UsageDHWizard is executed as a java program accepting two optional arguments. The first argument should be a .kin filename. If no file is specified, the wizard will open with an blank robot and use the filename DHout.kin. The second argument should be the server name on which Mirage is running. If no server is specified, the wizard will automatically attempt to connect to localhost. If Mirage is not running, the wizard will still permit modifications to the .kin file.
Known issues and future improvements
- Currently the user can only use predefined meshes to model the robot joints. Ideally the user would have a selection of meshes representing simple shapes like cylinders which would scale in size to maintain a continous frame.
- When using the angle slider to manipulate the robot joints, the joint position values are not saved by Mirage. When the robot's structure is updated, these positions must be retransmitted as well. This causes a momentary twitching of the joints to occur in the Mirage display.
- In rare cases, after extended use with Mirage, the GUI will no longer be able to send updates to Mirage and Mirage will report an error with creating new threads. This is likely due to Mirage becoming backed up with new data after a long series of rapid parameter changes. Terminating and rerunning Mirage corrects the issue.
- Currently the Open option in the menu only creates a new DH Wizard window which will display the selected robot without closing the old robot. This may cause conflicts with Mirage. Closing and restarting the DH Wizard is the recommended way to open new robots at this time.