python-getRangeImage function for kinect camera | by farinaz alamiyan (19) 2018-12-16 13:34:33 | O.S : windows 10
Webots: Free Pro R2018b
Hi,
I try to get the depth image of a Kinect camera using Python. The webots can detect Kinect device successfully and can enable it too. but, when I try to use getRangeImage function to get the depth values, the controller is crashed.
My code is as follows:
self.kinectrange=self.getRangeFinder("kinect range")
self.kinectrange.enable(timestep)
image=self.kinectrange.getRangeImage ()
What is the problem?
Thanks in advance |
|
Re: python-getRangeImage function for kinect camera | by Fabien Rohrer (Webots PRO - 1324) 2018-12-17 10:15:30 | Hi,
I just checked and there is indeed a weird crash in the python controller library there, but only if you call the getRangeImage() call before any Robot.step() call.
Meanwhile we could provide a better fix, I adapt your snippet to workaround this issue:
self.kinectrange=self.getRangeFinder("kinect range")
self.kinectrange.enable(timestep)
self.step(timestep)
image=self.kinectrange.getRangeImage ()
|
Sincerely,
Fabien Rohrer |
|
Re: python-getRangeImage function for kinect camera | by farinaz alamiyan (19) 2018-12-18 07:39:28 | Dear Fabien
Thank you a lot for your answer
I followed your suggestion but the problem still hasn't been solved!
Please let me know if there is any other solution.
Regards |
|
Re: python-getRangeImage function for kinect camera | by Fabien Rohrer (Webots PRO - 1324) 2018-12-18 13:19:58 | Hi,
Just to inform you that we tried again, on R2018b, macOS and windows, and we can reproduce the issues, but it can be solved with the workaround I mentioned in my previous post.
I continue to think that my workaround is good.
Could you share with us your controller?
Sincerely,
Fabien Rohrer |
|
|
|
|