Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cad_models [2013/01/07 12:03] – tenorth | cad_models [2014/06/05 11:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Visualize object using CAD models ====== | + | #REDIRECT doc:cad_models |
- | + | ||
- | This should be a quick start guide for using CAD models in KnowRob. CAD Models are used to show a realistic model of an object in KnowRob visualization (mod_vis). Please refer to the main knowrob tutorial ([[Tutorial: | + | |
- | + | ||
- | + | ||
- | ===== Initializing package ===== | + | |
- | + | ||
- | * Start mod_vis | + | |
- | | + | |
- | * Open the visualisation | + | |
- | | + | |
- | * Load knowrob_cad_models package | + | |
- | | + | |
- | + | ||
- | ===== Loading CAD Models ===== | + | |
- | + | ||
- | * Add a model to the scene | + | |
- | | + | |
- | + | ||
- | ===== Query model information ===== | + | |
- | + | ||
- | * Getting the total size (in meters) in x direction. | + | |
- | * x = width | + | |
- | * z = height | + | |
- | * y = depth | + | |
- | + | ||
- | | + | |
- | + | ||
- | For additional properties see [[#Model information from OWL|Model information from OWL]] | + | |
- | + | ||
- | ===== Structure of parser ===== | + | |
- | The base class for all parsers should be ModelParser. | + | |
- | It contains some essential methods for using parsers and has a list of Triangles and Lines loaded from the model. | + | |
- | So each parser should store the loaded data in the Group (which represents a Triangle/ | + | |
- | A group can has a name. | + | |
- | It's mesh member stores the Triangle and Lines information. | + | |
- | A Triangle can has texture and color. A line only a color. | + | |
- | + | ||
- | ==== Model Parser ==== | + | |
- | + | ||
- | The model parser is used to parse a CAD Model from a given file and is the base class for all parsers. | + | |
- | The parser loads a file and " | + | |
- | + | ||
- | A special feature of the ModelParser is Buffering: | + | |
- | If a model has been parset it will be stored in a model buffer. | + | |
- | So if the same model should be parsed again it will be taken from this buffer instead of parsing it again. | + | |
- | Keep in mind that if you change something in a Group of a specific model it will affect all the other existing instances of this model. | + | |
- | + | ||
- | ==== List of available parsers ==== | + | |
- | + | ||
- | Currently the following file formats are supported: | + | |
- | * [[#Collada Parser|Collada]]: | + | |
- | + | ||
- | === Collada Parser === | + | |
- | The collada parser uses [http:// | + | |
- | Currently dae4j hasn't implemented the whole collada specification, | + | |
- | + | ||
- | .kmz files will be extracted (zip) into a temporary directory and parsed from there. | + | |
- | + | ||
- | ==== How to create a new parser? ==== | + | |
- | Check out ColladaParser for a sample implementation of a parser. | + | |
- | + | ||
- | Steps to create a new model parser: | + | |
- | + | ||
- | * create a new class and extend it from ModelParser | + | |
- | * Add your parser to the extension list (In ModelParser.java) so a file extension will be assigned to your parser: | + | |
- | * Example: < | + | |
- | * implement the needed methods. These should be self explained (see javadoc) | + | |
- | * Store all data in Groups member of ModelParser parent. | + | |
- | + | ||
- | ===== Model information from OWL ===== | + | |
- | + | ||
- | You can query some properties such as the dimension of a loaded cad model from within prolog. | + | |
- | + | ||
- | Here is a list of the most important property queries. For a full list check knowrob_cad_models/ | + | |
- | + | ||
- | == List of queries == | + | |
- | + | ||
- | identifier is a knowrob identifier such as " | + | |
- | + | ||
- | ; Height of the model in meters | + | |
- | : < | + | |
- | + | ||
- | ; Width of the model in meters | + | |
- | : < | + | |
- | + | ||
- | ; Depth of the model in meters | + | |
- | : < | + |