Home

Polyplan User Guide

image

Contents

1. 30 x 50 y 180 2 0 virtual yes gt lt object gt lt object name wheell4 form wheel frame agv scale 30 x 50 y 180 2 0 virtual yes gt lt object gt lt object name O3 form Zlink frame link03 scale 200 nearto floor gt lt object gt lt object name O4 form Xlink frame link04 scale 200 gt lt object gt lt object name 05 form Xlink frame link05 scale 200 gt lt object gt lt object name gripperl form gripper frame gripl scale 100 gt lt object gt lt object name 06 form box frame carrier xscale 100 yscale 400 zscale 40 0 y 0 z 40 nearto floor gt lt object gt lt object name wheel21 form wheel frame carrier scale 30 x 50 180 z 0 virtual YES gt lt object gt lt object name wheel22 form wheel frame carrier scale 30 x 50 y 180 z 0 virtual YES gt lt object gt 13 Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 lt object name wheel23 form wheel frame carrier scale 30 x 50 y 180 z 0 virtual YES gt lt object gt lt object name wheel24 form wheel frame carrier scale 30 50 y 180 z 0 virtual YES gt lt object gt lt object name 07 form Zlink frame link07 scale 200 gt lt object gt lt object name 08 form Xlink frame link08 scale 200 gt lt object gt lt object name O9 form
2. Xlink frame link09 scale 200 gt lt object gt lt object name gripper2 form gripper frame grip2 scale 100 gt lt object gt lt polyworld gt 14
3. xValue y yValue z zValue mark mark gt lt vertex gt vertex x xValue y yValue z zValue mark mark gt lt vertex gt lt polyform gt each vertex phrase defines a vertex of the form All vertices together determine the polyhedral shape of the form The mark attribute is an optional single character Presently there are two possible values to mark 66 99 e c or C the coordinates of the vertex will be printed in the graphical output 66 99 e or the object s name will be printed in the graphical output Objects Objects are defined by lt object name objectName form formName frame frameName scale value xscale value yscale value zscale value x value y value z value nearto nearObjectName virtual yesOrno lt object gt Apart from the name and form attributes all the other attributes are optional form Defines the polyhedral form which makes this object frame If defined the object is attached to this frame which must have been defined before If not defined the object will be attached to the base frame world coordinates scale x y zscale The object size may be scaled by a uniform scaling factor in all dimensions and by separate scaling factors in the x y z dimensions If both are defined the scale value will multiply the xscale yscale an
4. alpha alphaValue gt lt pose2d gt pose2d defines a translation of the frame in the x y plane and rotation alpha around the z axis this function is a special case of pose3d with z 0 beta 0 gamma 0 lt pose3d x xValue y yValue z zValue alpha alphaValue beta betaValue gamma gammaValue lt pose3d gt pose3d defines a general 3D specification with Carthesian translation vector x y z and Euler ZYZ rotation angles alpha beta gamma dhtrans alpha alphaValue a aValue d dValue theta thetaValue gt lt dhtrans gt dhtrans defines a frame transformation according to the Denavit Hartenberg convention In principle any of the four argument may be filled in as configuration parameters However generally only one argument is taken as a variable Namely theta in case of rotational link and d in case of a prismatic link Robots consisting of pairwise connected links can be modeled easily by using the dhtrans transformation function Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Polyforms Before introducing an object first its polyhedral shape must be specified Multiple objects can be modeled according to the same specified form A polyhedral shape is defined by lt polyform name formName gt vertex x xValue y yValue z zValue mark mark gt lt vertex gt vertex x
5. 0 gt lt pose3d gt lt frame gt 12 November 2001 lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt lt param gt Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 lt polyform name square gt vertex 0 5 0 5 2 0 gt lt vertex gt vertex 0 5 0 5 z 0 gt lt vertex gt vertex 0 5 0 5 2 0 gt lt vertex gt vertex 0 5 0 5 z 0 mark N gt lt vertex gt lt polyform gt lt polyform name box gt vertex 0 5 0 5 2 0 5 gt lt vertex gt vertex 0 5 0 5 2 0 5 gt lt vertex gt vertex 0 5 0 5 z 0 5 gt lt vertex gt vertex 0 5 0 5 gt 7 0 5 gt lt vertex gt vertex 0 5 0 5 2 0 5 gt lt vertex gt vertex 0 5 0 5 2 0 5 gt lt vertex gt vertex 0 5 0 5 z 0 5 mark N gt lt vertex gt vertex 0 5 0 5 2 0 5 gt lt vertex gt lt polyform gt lt polyform name wheel gt vertex 0 y 0 25 z 0 35 gt lt vertex gt vertex 0 y 0 25 z 0 35 gt lt vertex gt vertex 0 y 0 5 gt 7
6. 0 gt lt vertex gt vertex 0 y 0 25 z 0 35 gt lt vertex gt vertex 0 0 25 2 0 35 gt lt vertex gt vertex 0 y 0 5 2 0 gt lt vertex gt lt polyform gt lt polyform name Xlink gt vertex 0 y 0 2 0 gt lt vertex gt vertex 0 5 0 z 0 mark N gt lt vertex gt vertex 1 y 0 z 0 gt lt vertex gt lt polyform gt lt polyform name Zlink gt vertex 0 y 0 z 0 gt lt vertex gt vertex 0 y 0 z 0 5 mark N gt lt vertex gt vertex 0 y 0 2 1 gt lt gt lt polyform gt lt polyform name gripper gt vertex 0 y 0 z 0 mark C gt lt vertex gt vertex 02 0 2 2 0 gt lt vertex gt vertex 0 2 0 2 z 0 gt lt vertex gt lt polyform gt lt object name floor form square scale 2000 gt lt object gt lt object name 01 form box xscale 400 yscale 100 zscale 100 x 700 y 350 z 50 gt lt object gt lt object name 02 form box frame agv xscale 100 yscale 400 zscale 40 x 0 y 0 z 40 nearto floor gt lt object gt lt object name wheell 1 form wheel frame agv scale 30 x 50 180 z 0 virtual yes gt lt object gt lt object name wheell2 form wheel frame agv scale 30 x 50 y 180 z 0 virtual yes gt lt object gt lt object name wheell3 form wheel frame agv scale
7. Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Polyplan Upgraded implementation of the kinematic modeling tool Polyplan using Java and XML Yoash Levron amp Albert Schoute University of Twente Department of Computer Science Abstract Polyplan is a configuration tool for visualization of moving objects in 3D space It uses a modeling language formatted in XML by which the geometric configuration and the kinematic properties of general world models can be specified Objects are represented by convex polyhedrons of arbitrary complexity Objects move according to configuration parameters that define the kinematic transformations of their coordinate frames Introduction to kinematic modeling In a world model that contains moving objects like vehicles manipulator links obstacles etc many parameters are needed in order to describe the configuration completely However whereas most parts are considered as rigid bodies it is common practice to separate out the set of dynamic parameters that actually vary the configuration and to leave aside all static parameters that remain fixed These dynamic parameters are termed configuration parameters Assume a world configuration depends upon m configuration parameters that may vary each within some appropriate range Then all configurations can be represented as points in an m dimensional space name configuration space Lozano Perez 83
8. The placement of any rigid body depends upon some subset of the configuration parameters Fixed objects such as immobile obstacles do not depend on any parameter Moveable bodies will depend upon one or more parameters A manipulator link connected by a joint to some other object depends on the joint parameter in addition to the parameters of the object to which it is attached In figure 1 an example object configuration model is shown with some typical cases We consider single objects being parts that behave as rigid bodies In the table below the dependency of objects on the configuration parameters is shown Distributed and Embeddez tems DIES Internal University of Twente ember 2001 Fixed obstacle ACH Ol O2 8 O9 i i Yu Fixed manipulator Mobile manipulator 5 o4 dao gammal 07 h 2 betta bettal kc x2 y2 alpha2 ph Figure 1 Typical object configuration model dependent upon configuration parameters xl yl lphal x2 y2 alpha2 betal beta2 beta3 gammal gamma2 gamma3 X1 Y1 Alphal X2 Y2 Alpha2 Betal Beta2 Beta3 Gammal Gamma2 Gamma3 O7 3 O8 E O9 t Dependency of objects on the configuration parameters To each object a coordinate frame can be attached The shape of the object can be expressed relative to that frame By means of affine transformations i e translations and rotations coordinate fra
9. ained in that root element In the Polyplan syntax the root element will always be called polyworld The polyplan specification file syntax Like we said the syntax is defined using an XML syntax For that reason every specification file will begin with the following code lt xml version 1 0 encoding US ASCII lt DOCTYPE polyworld SYSTEM polyplan dtd gt lt polyworld and will end with the code word lt polyworld gt this code defines the file as an XML file includes the DTD file which must be in the same directory as the XML file and defines the root element polyworld All other element must appear inside the root element and must be one of the followings lt const gt lt param gt frame lt polyform gt or lt object gt The elements must appear in that exact order that means that all the lt const gt elements will come first then the lt param gt elements and so forth The lt object gt elements will appear last This restriction was added mainly for implementation reasons Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 General properties of the Polyplan syntax e Each element has a name attribute which identifies it It is illegal for two elements of the same type to have the same name All identifier names must begin with a letter All degrees are given in radians Numerical values have to be given according to standard real denota
10. awing functions as explained before Typical functions of this file are line circle and outtext e Kinema c contains most of the computational implementation of Polyplan e Linalg c contains typical linear algebra functions e Maximize c also implements some of the computational part but most of the functions are not used in the current version e Polydist c responsible for the distance computation part which is not working so well on the correct version of Polyplan e Polyplan c this file contains the old C main function which is not needed at all on the current version of Polyplan However it is very comfortable to use it for debugging e Scenery c contains functions that draws the 3D world on the screen The most important function is DrawScene e Visual c also contains drawing functions Other files e C header h files e polyplan dtd the XML data type definition file which defines the Polyplan XML syntax e Example XML files e PolyplanGuide doc this document in Word format 10 Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Polyplan class cInterface dll SAXParserFactory class Polyplan dtd Figure 3 This figure shows the relations between the various software components The various components are ordered hierarchically every level of the hierarchy is using the lower levels References Craig86 Craig J J Introdu
11. ction to robotics Mechanics and Control Addison Wesley 1986 Lozano Perez83 Spatial planning a configuration space approach IEEE Transactions on Computers volume C32 no 2 pp 108 120 The URL java sun com contains good documentations examples and tutorials about Java and XML 11 Distributed and Embedded Systems DIES Internal Report University of Twente Appendix 1 specification file example xml lt xml version 1 0 encoding US ASCIT lt DOCTYPE polyworld SYSTEM polyplan dtd gt lt polyworld centerratiox 0 5 centerratioy 0 5 eyephi 45R eyetheta 75R eyedistance 10000 eyezoom 0 4 gt lt notice the order of keywords consts parameters frames polyforms objects gt const name xmani value 500 gt lt const gt lt const name ymani value 300 gt lt const gt lt param name x1 min 1000 max 1000 value 500 gt lt param name y min 1000 max 1000 value 300 gt lt param name alphal min 180R max 180R value 90R gt lt param name betal min 180R max 180R value 180R gt lt param name beta2 min 90R max 0R value 30R gt lt param name beta3 min 0R max 90R value 60R gt lt param name x2 min 1000 max 1000 value 500 gt lt param name y2 min 1000 max 1000 value 300 gt lt param name alpha2 min 180R max 180R value 90R gt lt param name gamma1 min 180R max 180R gt lt param name gam
12. d zscale values If omitted scaling values are taken as 1 A negative scale will make the mirror form of the form that makes this object x y z Defines the objects location in the coordinate frame If omitted the objects location is 0 0 0 Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Note that those attributes enable objects with the same shape to be put in different places in different sizes using only a single polyhedral form The nearto and virtual attributes affect only the distance analyzer and so have any meaning only when the distance analysis option is selected In the current version of the program the distance analysis is not working so well so we recommend not to use it Some documentation about the Java C implementation This software was implemented using both the C and Java languages The Java code is responsible for the user interface and the parsing of XML files On the other hand the C code is responsible for the computational part of the software The link between the Java and C languages is implemented using the JNI system Java Dative Interface Explanations about JNI can be found at The JNI provides a way to integrate an existing source code into Java applications This integration is achieved by using a few simple steps 1 The Java class which will use the native functions is written and made compiled In the P
13. l or not in the specification file except from the eye and center attributes It is not possible to define a constant by using another constant Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Parameters Configuration parameters are defined by param name paramName min minValue max max Value value initialValue gt lt param gt The value attribute can be omitted In which case the initial value will be taken as the average of the minimum and maximum values The configuration parameters can be used only as arguments to frame functions Frames Coordinate frames to which objects can be attached later are defined by frame name frameName inframe relativeFrameName frameFunctionName frame function parameters gt lt frameFunctionName gt lt frame gt This phrase defines a frame frameName relative to another frame The latter frame must have been defined before In case the inframe attribute is omitted the frame is taken relative to the base frame Frames are specified be means of a transformation function supplied with the proper arguments Transformation functions must be known to the system A few standard transformation functions are built in the system The arguments of the frame functions can be numerical values constants or configuration parameters Presently the following frame functions are recognized lt pose2d x xValue y yValue
14. m Parser This class implements the parsing of XML files The important method is run which will parse the XML file If the file contains errors they will be printed in the proper window which is given in the parser s class constructor If the file is valid the C variables will be updated to match the XML file The parsing is implemented using the common and simple SAX parser The implementation of this parser is given in the SAXParserFactory class A very good explanation about the SAX parser can be found at http java sun com xml Jaxp dist 1 1 docs tutorial overview index html Framel This class implements the main frame and therefore most of the user interface This class contains many event handlers for the various actions that the user can make Big parts of this class are machine generated by Jbuilder There are two visual components in this class which were manually generated not created by Jbuilder One is the window which contains the configuration parameters This window could not be automatically generated because the number of configuration parameters it contains is dynamically varying The second manually made visual component is the panel that shows the picture of the scene This panel was made manually because there is no standard Java Swing component which can handle drawings A good explanation of how to manage non standard drawings in Java can be found at the following URL http java sun com docs books
15. ma2 min 180R max 0R value 30R gt lt param name gamma3 min 90R max 90R value 60R gt lt frame name agv gt lt pose2d x x1 y yl alpha alphal gt lt pose2d gt lt frame gt lt frame name fixman gt lt pose2d x xmani y ymani alpha 0 gt lt pose2d gt lt frame gt frame name link03 inframe fixman gt lt dhtrans alpha 0 0 d 200 theta betal gt lt dhtrans gt lt frame gt frame name link04 inframe link03 dhtrans alpha 90R a 0 d 0 theta beta2 gt lt dhtrans gt lt frame gt frame name link05 inframe link04 gt lt dhtrans alpha 0 200 d 0 theta beta3 gt lt dhtrans gt lt frame gt frame name gripl inframe link05 gt lt pose3d 200 0 z 0 alpha 0 beta 0 gamma 0 gt lt pose3d gt lt frame gt lt frame name carrier gt lt pose2d 2 y y2 alpha alpha2 gt lt pose2d gt lt frame gt frame name link07 inframe carrier gt dhtrans alpha 0 0 d 260 theta gammal gt lt dhtrans gt lt frame gt frame name link08 inframe link07 gt lt dhtrans alpha 90 a 0 d 0 theta gamma2 gt lt dhtrans gt lt frame gt frame name link09 inframe link08 lt dhtrans alpha 0 200 d 0 theta gamma3 gt lt dhtrans gt lt frame gt lt frame name grip2 inframe link09 gt lt pose3d x 200 y 0 z 0 alpha 0 beta 0 gamma
16. mes can be expressed relative to each other In order to fix frames in the configuration space we use a common reference frame attached to the outside world named the base frame We will assume that objects have shapes modeled by convex polyhedrons Of course in practice this shape corresponds to some sufficiently accurate enclosure of the real object A polyhedron will be specified by its set of boundary vertices Each vertex will be described as a position vector in the object frame By using frame transformations these vertex positions are given a certain configuration easily mapped to the base frame or any other frame Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 Configuration modeling The world model and some representation parameters are read from a specification file An example of such a file is given in the appendix It reflects a configuration model as shown in figure 1 at the beginning of this report In fact a kind of modeling language has been defined that uses an XML syntax The specification file defines Constants using the const elements Configuration parameters using the param element Coordinate frames which are possibly relative to each other frame elements Polyhedral objects object element Objects can be attached to frames The objects shape is determined by a list of vertexes polyform elements e The eye parameters and the star
17. nt to new lines data base the array lineArr declared in graphics c Notice that the original code which calls the line function was not changed In order to actually draw the line on screen the Java cInterface class contains functions that are able to access this line data base An example of such a function is getLineX1 which retrieves the horizontal value of the first coordinate of a specific line Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 The Java code is divided into classes Since polyplan was made using the Jbuilder software some of these classes are machine generated Polyplan contains three important classes cInterface This class contains all the Java methods which are implemented using the C language The class contains methods which are divided by their functionality e Methods for manipulating the C variables Such a method for example 15 setConfigurationParameter which causes a manual change of a configuration parameter value e Methods for accessing the to be drawn shapes data base Such a method is the one we mentioned before getLineX1 e Methods which are used for updating the C variables from an XML file These methods replace the old ConfigScene C function in config c All the names of these functions starts with the prefix init An example of such a method 15 initAddParam which adds a new configuration parameter to the syste
18. olyplan software this class is called cInterface 2 An h file is automatically generated from the Java class using the javah exe program This h file contains the signatures of the C functions which are used by the Java code In the Polyplan software this file is called cInterface h 3 The implementation of the h file is written in the proper C file cInterface c in Polyplan The functions in cInterface c use the functions that are implemented by the C files of the computational part 4 All the C files are compiled and linked as a Dynamic Link Library In Polyplan this file is called cInterface dll The global variables in the C code are referred as the C variables These variables reside in the memory which is reserved to the dll file The old C code used functions that draw to screen using graphichs h The Polyplan implementation overrides these functions Instead of drawing shapes on screen these functions will create a data base part of the C variables which will save all the shapes to be drawn on screen Some of the Java functions in the cInterface class are able to access this data base in order to draw those shapes in the proper Java window To understand this drawing process better lets look at an example The old Polyplan software used the line function declared in graphics h to draw lines on screen The new Polyplan software overrides this function A call to the new line function will add a compone
19. ting location of the world origin which define the way that the world will be viewed on screen Frames are defined by supplying arguments previously defined parameters and constants to transformation functions such as the Denavit Hartenberg transformation Figure 2 Scene as generated from example xml Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 A short explanation about XML XML is a very general syntax which is used to define other languages The specification syntax is defined in a DTD file Data Type Definition The Polyplan program uses the polyplan dtd file to define its syntax This file must be in the same directory as the source XML file otherwise the program will not work The XML syntax is built out of elements which are ordered in a hierarchical structure Each XML element can contain other elements and can contain attributes The general syntax of an XML element definition is lt elementName attributeName attributeValue attributeName attributeValue gt Child Element 1 Child Element 2 lt elementName gt General properties of XML files e White spaces tabs or new line characters do not affect the syntax e Attributes inside the elements can appear in any order e Remarks can appear anywhere in the XML file Remarks are added by lt This is a remark gt e Every XML file contains one root Element All the other elements are cont
20. tion If a Numerical value is followed immediately by an R or r it is interpreted as angle given in degrees and converted into radians For example 180R will be interpreted as the value of pi Eye and center definitions The eye and center are defined as attributes of the lt polyworld gt element And so their definition must come right after the code word polyworld at the beginning of the specification file like so lt polyworld centerratiox 0 5 centerratioy 0 5 eyephi 45R eyetheta 75R eyedistance 10000 eyezoom 0 4 The numerical values here are given as an example Those attributes will define the way that the world will be viewed on screen centerratiox this attribute defines the location of the world origin on the screen horizontal axis A 0 value will define the most left column as the origin location and 1 will define the most right column as the origin location This attribute can be omitted in which case a default value of 0 5 will be taken centerratioy the same as centerratiox on the vertical axis eyephi eyetheta this values defines the viewing angle eyedistance defines how far is the eye from the origin In general this should be a large number eyezoom defines the eye zoom factor Constants Constants are defined by const name constName value constValue gt lt const gt Constants can replace any other value numerica
21. tutorial uiswing painting index html The other classes are Framel aboutbox and Polyplan These classes are completely machine generated and contain no important details Distributed and Embedded Systems DIES Internal Report University of Twente November 2001 The software components Here is a list of the source files needed to make the Polyplan software Java classes e polyplan java contains a machine generated Java class which uses an instance of the Framel class This class resembles to the main function e Framel java contains the Framel class Framel Aboutbox java contains the machine generated Framel AboutBox class which is used by Framel e Parser java contains the Parser class e clnterface java contains the cInterface class C files e cInterface c contains the implementation of all the C Java interface functions The file cInterface h which is included here is machine generated using javah exe The file jni h which is included is part of the JNI system e Config c contains functions which were used by the old Polyplan program to config the scene using a geo file Most of the functions here are not used in the current version of Polyplan e Frame c contains functions to manipulate frames Goalwalk c was used by the old version of Polyplan Most of the functions are not being used in the current version e Graphics c contains the implementation of the graphics data base and dr

Download Pdf Manuals

image

Related Search

Related Contents

Produktprospekt  Canon iPF815 Basic Guide  Durable SCREENCLEAN 50 pack    NEC E554  Party Cooler    

Copyright © All rights reserved.
Failed to retrieve file