tutorials:using_the_skiros_world_model_from_python

Differences

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

Link to this comparison view

Next revision
Previous revision
tutorials:using_the_skiros_world_model_from_python [2022/03/22 15:44] – created simonkltutorials:using_the_skiros_world_model_from_python [2022/09/02 14:04] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Adding a new element to the world model ====== ====== Adding a new element to the world model ======
 Example, adding a skiros:Location element to skiros:Scene-0: Example, adding a skiros:Location element to skiros:Scene-0:
-<nowiki>+<code python>
 element = Element('skiros:Location') element = Element('skiros:Location')
 self._wmi.instanciate(element, relations=[{'src': 'skiros:Scene-0', 'type': 'skiros:contain', 'dst': '-1'}]) self._wmi.instanciate(element, relations=[{'src': 'skiros:Scene-0', 'type': 'skiros:contain', 'dst': '-1'}])
-</nowiki>+</code> 
 + 
 +====== Modifying an element in the world model ====== 
 +Example, changing the position of an object: 
 +<code python> 
 +element.setData(':Position', [1.0, 0.0, 0.0]) 
 +self._wmi.update_element_properties(element) 
 +</code> 
 +Example, changing the frame id of an object: 
 +<code python> 
 +element.setProperty('skiros:FrameId', 'map'
 +self._wmi.update_element_properties(element) 
 +</code>
  • tutorials/using_the_skiros_world_model_from_python.1647963865.txt.gz
  • Last modified: 2022/09/02 14:04
  • (external edit)