Replies: 1 comment
-
The DEF node in the second case is simply a declaration. By saying "DEF BALL Ball {}", you create a Ball object and name it BALL. You could simply use "Ball {}" and it would do the same. Defining a DEF name is useful if you want to later refer to this node, e.g., from a supervisor. This would allow you to track down the position of the ball or move it around. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I found a detail during the tutorial and hope somebody can explain or discuss it.
Here, as the tutorial 8, we should add the code below when we spawn a new robot (such as Nao):
children_field.importMFNodeFromString(-1, 'Nao {translation 2.5 0 0.334}')
For track the position, we also first spawn the robot (such as BALL):
children_field.importMFNodeFromString(-1, 'DEF BALL Ball { translation 0 1 1 }') ...
The only difference between these two codes is that the second one used 'DEF' node instead, despite of the fact that we never set it beforehand. However, it seems the DEF node should be exclusively refered to. So my question is, why should the DEF node can work here? Hope somebody can answer it. Many Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions