webots
webots copied to clipboard
Improve Node Field Query API
This issue arises from a discussion occurring on this StackExchange thread which brings up two main issues:
- In the current API, there is no way to query the internal fields of a "parent" proto node.
Ex.
PROTO BaseProto [
unconnectedField internalField
]
{
...
}
PROTO SubProto [
]
{
BaseProto {
internalField 1
}
}
(internalField is inaccessible from SubProto nodes)
- The
wb_supervisor_node_get_fieldandwb_supervisor_node_get_proto_fieldmethods are somewhat misleading in that the former retrieves fields defined on a proto node and the latter retrieves fields defined on the base ancestor type.
In the linked thread, @omichel suggests creating wb_supervisor_node_get_proto_parent and querying fields on that object with wb_supervisor_node_get_field.