-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getFirstFinalizedProtoInstance()
returns NULL
for DEF with Lua code in v2023b
#6474
Comments
Unfortunately, I have no idea on how to fix this. I would recommend the following to investigate:
|
A PROTO with Javascript rather than Lua suffers from the same symptoms. |
Can I debug the generated PROTO files (after going through the engine)? |
Yes, there is a menu in the scene tree allowing to see the generated proto file. |
When trying to write a small example to reproduce the issue, I wrote this PROTO:
with this supervisor: """my_supervisor controller."""
# You may need to import some classes of the controller module. Ex:
# from controller import Robot, Motor, DistanceSensor
from controller import Supervisor
class Test(Supervisor):
def __init__(self):
super().__init__()
def run(self):
my_led = self.getFromDef('my_led')
led = my_led.getFromProtoDef('led')
print(f'{led=}')
print(f'{led.getPosition()=}')
controller = Test()
controller.run() and this world
but this combination does NOT trigger the issue. I'll have to dig farther. |
I'm trying to understand the code. What is a PROTO parameter node? In our case, when the issue appears, |
I am not sure, but it could be the nodes that are passed as PROTO parameters. |
Do you mean a parameter whose type is a node? |
Yes. |
Nice catch! I would suggest you to investigate commit-per-commit on #5779 to understand which commit did introduce the bug. Unfortunately @stefaniapedrazzi is not working any more with us and won't be able to help you on this. |
Describe the Bug
It seems that something is wrong with
DEF
with Lua code. We have a node defined like thisFor this node,
node->getFirstFinalizedProtoInstance();
returnsNULL
.This happens with v2023b but was working with v2023a.
Steps to Reproduce
DEF
getPosition()
getPosition()
returns[nan, nan, nan]
.Expected behavior
It should work as in used to do in v2023a.
System
I'm ready to solve the issue but need some hint where to start.
The text was updated successfully, but these errors were encountered: