OpenRoberta / openroberta-lab

The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
Apache License 2.0
122 stars 118 forks source link

Python Code Generation - Initialize Variable with use of isPrime (or any other Generated Helper Method) not working #1650

Open NiHoffmann opened 3 months ago

NiHoffmann commented 3 months ago

Describe the bug When using a Python-Robot, initializing a variable with the help of a function that needs a generated helper function the program will crash. One of these functions is the isPrime function.

To Reproduce Steps to reproduce the behavior:

  1. Select a Python-Robot here Lego Spike
  2. Add global Variable to NEPO-Program
  3. Add isPrime with any number as input here 3 as Initiatal value
  4. Add a show text on LED Matrix with the created variable
  5. Upload the Program to the Robot
  6. See error

Expected behavior "True" will be shows by the LED-Matrix.

Screenshots Screenshot from 2024-03-20 12-09-02

Reason for behaviour item = isPrime(3) will be called before the ___isPrime() method was visitied by the python interpreted.

Additional context To check weather or not a function is a generated Helper Function check the Source Code of the NEPO-program.

Device Information