Geometric Modelling in OpenRAVE: Difference between revisions
Lestergarcia (talk | contribs) No edit summary |
Lestergarcia (talk | contribs) No edit summary |
||
Line 73: | Line 73: | ||
</Geom> | </Geom> | ||
</Body> | </Body> | ||
</KinBody> | |||
In this example, we can distinguish three blocks of declaration: | |||
* <Kinbody> ... </ Kinbody> | |||
* <Body> ... </ Body> | |||
* <Geom> .. </ Geom> | |||
For the moment, Ignore Kinbody & Body blocks, which are explained later. | |||
'''<Geom>''' serves to establish the existence of a geometric figure, a solid within the simulation space. When you declare a string <Geom> in OpenRAVE, the physics of Collision Engines & checkers, use this information to carry out simulations of collisions between objects. | |||
The following examples explain the construction of the three basic solids that can be created | |||
OpenRAVE manually. (Sphere, cylinder, cuboid) | |||
=== Sphere === | |||
The sphere is the simplest solid that can be built in OpenRAVE (manually) since this geometry is defined by a single parameter: Radio. Below there is an example of how to declare the construction of a sphere in OpenRAVE and after that is the explanation of each element of the block is given. | |||
<KinBody name="Red_Ball"> | |||
<!-- | |||
openrave Vislab/OR1_Objects/red_ball.kinbody.xml | |||
--> | |||
<Body name="Sphera" type="dynamic"> | |||
<!-- Sphere Shape | |||
Measurements: r=0.08 m | |||
Origin of Reference Frame: [0, 0, 0] --> | |||
<Geom type="sphere"> | |||
<!--Sphere Shape | |||
Measurements: r=0.08 m | |||
Origin of Reference Frame: [0, 0, 0] --> | |||
<radius>0.08</radius> | |||
<diffuseColor>1 0 0</diffuseColor> | |||
<transparency>0</transparency> | |||
</Geom> | |||
</Body> | |||
</KinBody> | </KinBody> |
Revision as of 17:17, 11 January 2011
When experimenting with simulations in OpenRAVE, mainly we have the following stages:
- Geometric Modelling. Here is where you create your enviroment (scenario), and create the Robots and the objects.
- Knowledge base generation. When Rosen Diankov created OpenRAVE, he designed its structure in such a way that there were some modules (plug-ins) that automatically generate some databases in off-line mode. Some examples of these data bases, are the inverse kinematics, the grasping plug-in, reachability and inverse reachability computation, detectability and others. More about the knowledge base generation will be discused in other section.
- Scripting. Of course, if we want to run some special simulation, we have to code it. This can be done in Python language, in Matlab Scripts, in Octave Scripts, or ultimately in C++.
- Interfacing Simulations. We also want to try our experiments in real Robots, and to do so, we can interface our simulation environment with the Robots. This is done with ROS.
In this section of the tutorial, we will focus on the Geometric Modelling.
Models Classification
In OpenRAVE, geometric models are xml files that describe the geometry, and configuration of objects in the simulations. We distinguish four four kind of models:
- Objects. These are the simpler elements of an environment. my_object.kinbody.xml
- Mechanisms. These are also objects, but the special characteristic, is that they have relative movements between links, specially if they are open-chain mechanisms. my_mechanism.kinbody.xml
- Robots. These are special xml files, and their internal structure is conformed by one or several mechanisms. They also describe which links are active when computing manipulation tasks. my_robot.robot.xml
- Environments. These xml files hold the entire description of how the 3D world is structured. They load the objects, and robots that will play a roll in the simulation. my_environment.env.xml
Is very inportant for you to know that, if the model that you want to use already exists in the library, you don't have to model it again, just use the existing one. So, where are the models? ...In OpenRAVE we have three main directories were the models are allocated.
- /usr/local/share/openrve/data/
- /usr/local/share/openrve/robots/
- /usr/local/share/openrve/models/
In the first and in the second directories, you will find mixed models of objects, robots and environments, and in the third, you just will find geometric description files with extension *.wrl (VRML 97) and *.iv (Open Inventor).
If you are using the VisLab Edition, then you will also have the extra directory:
- /usr/local/share/openrve/Vislab/
There, you will find the models of the typical objects and the robots that are used at the VisLab, like Baltazar, Chico, Wizzy, and some toys.
Objects Modelling
We distinguish three kind of object modelling:
- Elemental geometric shaped objects
- Composition of simple geometries
- Objects with complex geometries
first we will discuss how simple geometries are described in xml files, then, we will show how to build up an object with the addition of these elemental geometries, and finally, we will show how to make use of existing geometric models from CAD files, such as VRML, 3DStudio, Open Inventor and so on.
In this section, the main objective is that you learn how descriptions are done in the xml files. Although you probably will directly use the already available objects in the library, this part of the tutorial will be enough for you to know how to create your own models. Let's get start with the elemental Geometric shaped objects!!.
Elemental Geometric shaped objects
In OpenRAVE shapes can be edited manually. To do this, the description of objects can be three of the next elemental geometries:
- Sphere
- Cylinder
- Cuboid
Additionally, we have to describe, for each of these geometries, the next parameters:
- Static or dynamic
- Initial position
- Initial orientation
- color
- transparency
As static objects, they have, for example, walls, floor, etc. As dynamic objects, you have all the objects that can move & they are subject to gravity, such as: tables, doors, etc.. Let's see the general structure of an elemental geometry object.
<KinBody name="my_object_name"> <Body name="my_body_name" type="dynamic"> <Geom type="cylinder"> ........ </Geom> </Body> </KinBody>
In this example, we can distinguish three blocks of declaration:
- <Kinbody> ... </ Kinbody>
- <Body> ... </ Body>
- <Geom> .. </ Geom>
For the moment, Ignore Kinbody & Body blocks, which are explained later.
<Geom> serves to establish the existence of a geometric figure, a solid within the simulation space. When you declare a string <Geom> in OpenRAVE, the physics of Collision Engines & checkers, use this information to carry out simulations of collisions between objects.
The following examples explain the construction of the three basic solids that can be created OpenRAVE manually. (Sphere, cylinder, cuboid)
Sphere
The sphere is the simplest solid that can be built in OpenRAVE (manually) since this geometry is defined by a single parameter: Radio. Below there is an example of how to declare the construction of a sphere in OpenRAVE and after that is the explanation of each element of the block is given.
<KinBody name="Red_Ball"> <Body name="Sphera" type="dynamic"> <Geom type="sphere"> <radius>0.08</radius> <diffuseColor>1 0 0</diffuseColor> <transparency>0</transparency> </Geom> </Body> </KinBody>