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

Loading scenes #5

Open
psychemedia opened this issue Sep 25, 2017 · 0 comments
Open

Loading scenes #5

psychemedia opened this issue Sep 25, 2017 · 0 comments

Comments

@psychemedia
Copy link

Trying to load scenes via the API, I keep getting errors, irrespective of whether I try to use relative or absolute paths on client or server side, from either server or client side depending on setting. The scene files are at the paths specified!

Code I'm using:

from pyrep import VRep
from pyrep.vrep.vrep import simxLoadScene
from pyrep.vrep import vrep as v
from pyrep.common import ReturnCommandError

class sceneloader:

    def __init__(self, api: VRep):
        self._api = api
        self._def_op_mode = v.simx_opmode_blocking #v.simx_opmode_oneshot_wait
        self.id = api._id

    def loadScene(self,path):
        clientID=self.id
        print(path)
        res = simxLoadScene(clientID, path, 1, self._def_op_mode)
        print(res)

        if res != v.simx_return_ok:
            raise ReturnCommandError(res)

scene="/Applications/V-REP_PRO_EDU_V3_4_0_Mac/scenes/khepera3.ttt"
#scene='./Pioneer.ttt'
with VRep.connect("127.0.0.1", 19997) as api:
    r=sceneloader(api)
    r.loadScene(scene)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant