simxLoadScene error

Typically: "How do I... ", "How can I... " questions
Post Reply
robotLab
Posts: 7
Joined: 11 Aug 2017, 18:10

simxLoadScene error

Post by robotLab » 13 Jan 2018, 17:30

Hello,

I am trying to load a previously saved scene via python remote API, but the function simxLoadScene does not work, and the scene doesn't open. I get an unusual return code:

(0, '***', 0, 65536)

where *** is the exact path and file name I had given to simxLoadScene. I could not interpret this return code since it was not just one number. Can you please help me in figuring out the problem?

Thank you.

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

Re: simxLoadScene error

Post by coppelia » 15 Jan 2018, 18:34

Hello,

what is the integer returned by simxLoadScene? IF simulation is running, you won't be able to load a new scene.

Cheers

robotLab
Posts: 7
Joined: 11 Aug 2017, 18:10

Re: simxLoadScene error

Post by robotLab » 16 Jan 2018, 15:16

Thank you for your response.

That is the unusual thing, simxLoadScene does not return an integer, it returns a tuple, which I mentioned before:
(0, '***', 0, 65536)-where *** is the exact path and file name I had given to simxLoadScene.
No, the simulation is not running, and I am even able to close the current scene with simxCloseScene. But I am not able to load any scenes.

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

Re: simxLoadScene error

Post by coppelia » 18 Jan 2018, 08:03

So how exactly are you using that function?

Following works fine and prints 0 for res:

Code: Select all

res=vrep.simxLoadScene(clientID,"c:/Python27/6DoFHolonomicPathPlanning.ttt",0,vrep.simx_opmode_blocking)
Cheers

robotLab
Posts: 7
Joined: 11 Aug 2017, 18:10

Re: simxLoadScene error

Post by robotLab » 20 Jan 2018, 08:24

This is my complete code:

Code: Select all

import vrep

vrep.simxFinish(-1) # just in case, close all opened connections
clientID=vrep.simxStart('127.0.0.1',19997,True,True,5000,5) # Connect to V-REP
if clientID!=-1:
    print ('Connected to remote API server')

res=vrep.simxLoadScene=(clientID,"C:/Users/mahsa/Desktop/robot/asli.ttt",0,vrep.simx_opmode_blocking)
print('open res:',res)
I have also tried opening a file directly located in drive C, or on Desktop. None of them would open, and I get the same unusual result from simxLoadScene. Trying it on another device did not work either, and resulted in the same return code.

Thank you.

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

Re: simxLoadScene error

Post by coppelia » 22 Jan 2018, 09:58

Have again a look at your code: don't you see a difference between below two?

Code: Select all

res=vrep.simxLoadScene=(clientID,"C:/Users/mahsa/Desktop/robot/asli.ttt",0,vrep.simx_opmode_blocking)
res=vrep.simxLoadScene(clientID,"c:/Python27/6DoFHolonomicPathPlanning.ttt",0,vrep.simx_opmode_blocking)
Cheers

robotLab
Posts: 7
Joined: 11 Aug 2017, 18:10

Re: simxLoadScene error

Post by robotLab » 22 Jan 2018, 13:30

Yes, sorry.

Thank you.

Post Reply