Error loading physics engine pluggin when executing coppeliaSim.exe

Typically: "How do I... ", "How can I... " questions
Post Reply
javl0p
Posts: 9
Joined: 24 Mar 2023, 10:42

Error loading physics engine pluggin when executing coppeliaSim.exe

Post by javl0p »

Hi!

I am working on an application in which Coppelia needs to be launched, and a certain scene loaded directly from Python.

In order to do so, I'm using the subprocess Python module and, specifically, the command Popen().

Code: Select all

sp.Popen(["coppeliaSim.exe", str(scene_path.replace("\\","/"))], shell=False,
             stdin=None, stdout=None, stderr=None)
The scene does open but a warning pops out.

Code: Select all

[CoppeliaSim:warning] The physics engine currently selected is not supported (you might be missing a required plugin). Simulation will not run correctly.
Which does not appear when I open Coppelia directly by double clicking the Desktop shortcut or the .ttt scene itself.

I see this is a problem that dates back to 2016, since I found it perfectly described in this forum page:

https://forum.coppeliarobotics.com/view ... 3&start=10

Do you know why this happens? Is there a proven why ti fix it?

Thanks a lot in advance!

Update: Not only does the physics engine pluggin not load, but also de code editor and, who knows, many more!

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Error loading physics engine pluggin when executing coppeliaSim.exe

Post by coppelia »

Hello,

my best guess is that you are not providing the location of the working directory (which should be the one where coppeliaSim.exe is located in). Use cwd=directory in Popen.

Cheers

javl0p
Posts: 9
Joined: 24 Mar 2023, 10:42

Re: Error loading physics engine pluggin when executing coppeliaSim.exe

Post by javl0p »

Yes, thank you!

I had added the CoppeliaSim.exe location to the system variable path but that wasn't enough apparently.

I used shutil.which function to locate the directory dinamycally and then added cwd=directory as an option within the Popen command.

Something like this

Code: Select all

from shutil import which


coppelia_path = os.path.dirname(which("coppeliaSim.exe"))
sp.Popen(["coppeliaSim.exe", str(scene_path.replace("\\", "/"))], cwd=coppelia_path, shell=False, stdin=None, stdout=None, stderr=None)
Thanks! it solved the problem right away!

Post Reply