cyberbotics / webots_ros2

Webots ROS 2 packages
Apache License 2.0
389 stars 141 forks source link

Forest files cannot be referenced by world launched by the ros driver #864

Closed andyblarblar closed 7 months ago

andyblarblar commented 7 months ago

Describe the Bug My project (which lives inside a ros package) has the following strucuture:

.
├── controllers
├── libraries
├── plugins
│   ├── physics
│   ├── remote_controls
│   └── robot_windows
├── protos
│   ├── Phoenix.proto
│   └── Phoenix_textures
└── worlds
    ├── forest
    │   ├── -745.forest
    │   ├── -759.forest
    │   └── -767.forest
    └── purdue_track.wbt

and forests inside the world file like:

...
Forest {
  shape [
    -156.84 -82.94,     -119.93 14.02,     -111.24 86.07,     -148.15 -2.28,     -156.84 -82.94,
]
 type "birch tree"
  treesFiles [
    "forest/-767.forest"
  ]
}
...

When opening the world file in webots normally, everything works fine. However, when launching the world file using the WebotsLauncher class, the forests cannot be found by the world. Error: ERROR: JavaScript error: could not open file: /tmp/forest/-745.forest.. Interestingly, the protos, which are also referenced with a relitive path, are found correctly. I am installing the entire webots project to the shared folder.

Steps to Reproduce

  1. Create a webots world with a forest, and a forests directory alongside the world
  2. Launch the world using the ros2 launch file
  3. View error in console

Expected behavior Forests can be found by worlds launched by ROS

Affected Packages List of affected packages:

System

andyblarblar commented 7 months ago

Fixed by #865