Skip to content
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

Support for Webots Versions <= 2022b #260

Open
3 tasks done
abanuelo opened this issue May 8, 2024 · 3 comments
Open
3 tasks done

Support for Webots Versions <= 2022b #260

abanuelo opened this issue May 8, 2024 · 3 comments
Assignees
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working

Comments

@abanuelo
Copy link
Collaborator

abanuelo commented May 8, 2024

System Details

  1. Python Version: 3.10.12
  2. Scenic Version: 3.0.0b2
  3. Operating System / Platform: Linux
  4. Simulator Version: Webots 2022a

Detailed Description

  1. Description: If you try to run any webots example file from the examples/webots folder with a version of Webots < 2022b, it throws an error:
  2. Scenic command: Not applicable
  3. Error Log within Webots Console:
ERROR: '/home/abanuelo/Scenic/examples/webots/vacuum/worlds/create.wbt':3:1: error: Expected node or PROTO name, found 'EXTERNPROTO'.
ERROR: '/home/abanuelo/Scenic/examples/webots/vacuum/worlds/create.wbt': Failed to load due to syntax error(s).

Steps To Reproduce

  1. Load the world file .wbt into webots for any given example in the examples/webots folder.
  2. Once you do it will throw the following error in the Webots console
Screenshot 2024-05-08 at 11 58 37 AM

Question: Do we want to support older version of webots? My guess is no given there were many breaking changes to the interface as described here: https://cyberbotics.com/doc/guide/from-2022a-to-2022b

Issue Submission Checklist

  • I am reporting an issue, not asking a question
  • I checked the open and closed issues, forum, etc. and have not found any solution
  • I have provided all necessary code, etc. to reproduce the issue
@abanuelo abanuelo added type: bug Something isn't working status: triage Issue needs to be assessed labels May 8, 2024
@Eric-Vin
Copy link
Collaborator

Eric-Vin commented May 8, 2024

In this case it's the Webots world files themselves that are incompatible with < Webots 2022b, so it's entirely Webots that broke backwards compatibility and Scenic is completely unrelated. Regardless I don't think there's a pressing need to spend time adding support for old Webots versions unless there's a compelling reason, though it would be good to maintain support for any versions we currently support as long as it's not too much additional work.

@abanuelo abanuelo self-assigned this May 8, 2024
@abanuelo abanuelo added status: valid Issue is valid and will be worked on and removed status: triage Issue needs to be assessed labels May 8, 2024
@abanuelo
Copy link
Collaborator Author

abanuelo commented May 8, 2024

Will follow up with documentation updates and .wbt file updates!

@abanuelo abanuelo changed the title Support for Webots Versions <2022b Support for Webots Versions <2023a May 9, 2024
@abanuelo
Copy link
Collaborator Author

abanuelo commented May 9, 2024

Version of Webots 2022b isn't entirely backward compatible with some of the working examples in the repo. Namely if you run the adhoc.wbt file it throws:

./webots --stdout --stderr 
WARNING: '/home/ubuntu/Scenic/examples/webots/generic/webots_data/worlds/adhoc.wbt': This file was created by Webots R2023a while you are using Webots R2022b. Forward compatibility may not work.
WARNING: '/home/ubuntu/Scenic/examples/webots/generic/webots_data/worlds/adhoc.wbt': This file was created by Webots R2023a while you are using Webots R2022b. Forward compatibility may not work.
WARNING: '/home/ubuntu/.cache/Cyberbotics/Webots/assets/0dcadc7dae2ab58631659c60077ade08949c5518': This file was created by Webots R2023a while you are using Webots R2022b. Forward compatibility may not work.
WARNING: '/home/ubuntu/.cache/Cyberbotics/Webots/assets/1d3a23272010fb5f44e231f939f3d35fd911f51e': This file was created by Webots R2023a while you are using Webots R2022b. Forward compatibility may not work.
INFO: scenic_supervisor: Starting controller: python3 -u scenic_supervisor.py
WARNING: '/home/ubuntu/Scenic/examples/webots/generic/webots_data/protos/ScenicObjectWithPhysics.proto': This file was created by Webots R2023a while you are using Webots R2022b. Forward compatibility may not work.
Traceback (most recent call last; use -b to show Scenic internals):
  File "/home/ubuntu/Scenic/examples/webots/generic/webots_data/controllers/scenic_supervisor/scenic_supervisor.py", line 16, in <module>
    simulator.simulate(scene, verbosity=2)
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 56, in createSimulation
    return WebotsSimulation(
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 82, in __init__
    super().__init__(scene, timestep=timestep, **kwargs)
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 85, in setup
    super().setup()
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 173, in createObjectInSimulator
    densityField = getFieldSafe(webotsObj, "density")
  File "/home/ubuntu/Scenic/src/scenic/simulators/webots/simulator.py", line 280, in getFieldSafe
    if isinstance(field._ref, ctypes.c_void_p) and field._ref.value is not None:
AttributeError: 'Field' object has no attribute '_ref'
Loading Scenic scenario ../../../adhoc.scenic
Starting new simulation...
  Starting simulation 1...
WARNING: 'scenic_supervisor' controller exited with status: 1.
./webots: line 102:  3757 Segmentation fault      (core dumped) "$webots_home/bin/webots-bin" "$@"

I will add to the documentation that support for versions 2023a and above will be the defacto standard.

@abanuelo abanuelo changed the title Support for Webots Versions <2023a Support for Webots Versions <= 2022b May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: valid Issue is valid and will be worked on type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants