Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:pycram:reasoning [2021/03/05 10:59] jdechdoc:pycram:reasoning [2021/03/12 09:10] (current) – [Occluding] jdech
Line 37: Line 37:
 To determine if the object is visible it needs to be rendered two times. The first time only the object alone will be rendered and all visible pixels are counted. This sets the maximal number of pixel that are visible from this position. The second time To determine if the object is visible it needs to be rendered two times. The first time only the object alone will be rendered and all visible pixels are counted. This sets the maximal number of pixel that are visible from this position. The second time
 all objects will be rendered and the visible pixels are counted again. This value is the actual number of pixels that are visible from the given position. all objects will be rendered and the visible pixels are counted again. This value is the actual number of pixels that are visible from the given position.
 +
 +To ensure the TF positions stay valid while the objects are moved for the rendering. This reasoning query will be executed in it's own BulletWorld, this is done by copying the BulletWorld and creating a new identical one in DIRECT mode. This BulletWorld then executes the reasoning and is destroyed afterwards.
  
 To determine if the object is visible, the method checks if the actual number divided by the maximum number of pixels is greater than 0.8. This corresponds to at least 80 % of the object being visible. Before dividing the number it will be checked if the To determine if the object is visible, the method checks if the actual number divided by the maximum number of pixels is greater than 0.8. This corresponds to at least 80 % of the object being visible. Before dividing the number it will be checked if the
Line 48: Line 50:
  
 This reasoning query is similar to visible in the way that the scene needs to be rendered multiple times. First, the object is rendered alone. This time, the pixels are not counted but, instead, the position of pixel that belong to the given object are saved as tuples in a list. The second time, the whole scene is rendered and the previously saved positions of the pixels belonging to the object are checked. If the object is still visible in this pixel nothing happens, but if another object is visible this object is occluding the given object and will be saved in a list and then returned. This reasoning query is similar to visible in the way that the scene needs to be rendered multiple times. First, the object is rendered alone. This time, the pixels are not counted but, instead, the position of pixel that belong to the given object are saved as tuples in a list. The second time, the whole scene is rendered and the previously saved positions of the pixels belonging to the object are checked. If the object is still visible in this pixel nothing happens, but if another object is visible this object is occluding the given object and will be saved in a list and then returned.
 +
 +To ensure the TF positions stay valid while the objects are moved for the rendering. This reasoning query will be executed in it's own BulletWorld, this is done by copying the BulletWorld and creating a new identical one in DIRECT mode. This BulletWorld then executes the reasoning and is destroyed afterwards.
  
 To use the reasoning query, the user needs to specify the object and a position of the camera, as well as the front facing axis of the camera frame. This is normally the z axis, that's why this axis is the standard for this function. This call is very similar to the one above: To use the reasoning query, the user needs to specify the object and a position of the camera, as well as the front facing axis of the camera frame. This is normally the z axis, that's why this axis is the standard for this function. This call is very similar to the one above: