librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

error in export_to_ply() in pyglet_pointcloud_viewer.py

Open AntonVeynshter opened this issue 7 years ago • 4 comments

Can not save ply in example. The rest works. I hadn't change any piece of code in example.

Traceback (most recent call last): File "/pyglet_pointcloud_viewer.py", line 467, in pyglet.app.run() File "/usr/local/lib/python3.6/dist-packages/pyglet/app/init.py", line 138, in run event_loop.run() File "/usr/local/lib/python3.6/dist-packages/pyglet/app/base.py", line 142, in run self._run() File "/usr/local/lib/python3.6/dist-packages/pyglet/app/base.py", line 154, in _run timeout = self.idle() File "/usr/local/lib/python3.6/dist-packages/pyglet/app/base.py", line 275, in idle redraw_all = self.clock.call_scheduled_functions(dt) File "/usr/local/lib/python3.6/dist-packages/pyglet/clock.py", line 309, in call_scheduled_functions item.func(dt, *item.args, **item.kwargs) File "/pyglet_pointcloud_viewer.py", line 461, in run points.export_to_ply('./out.ply', mapped_frame) TypeError: export_to_ply(): incompatible function arguments. The following argument types are supported: 1. (self: pyrealsense2.pyrealsense2.points, arg0: str, arg1: pyrealsense2.pyrealsense2.video_frame) -> None

Invoked with: <pyrealsense2.pyrealsense2.points object at 0x7fa5240b8a08>, './out.ply', <pyrealsense2.pyrealsense2.frame object at 0x7fa5240b8c70>


Required Info
Camera Model { D415 }
Operating System & Version Ubuntu 18.04
Version of SDK pyrealsense2-2.21.0.776

AntonVeynshter avatar May 02 '19 12:05 AntonVeynshter


@Leo16112 The error was caused incompatible type. Please modify https://github.com/IntelRealSense/librealsense/blob/master/wrappers/python/examples/pyglet_pointcloud_viewer.py#L391 to below and try again. Thanks!

other_frame = frames.first(other_stream).as_video_frame()


@Leo16112 Did you get it through? Looking forward to your update. Thanks!


@Leo16112 Will close this ticket if no other questions. Thanks!

Hello, thank you for reply. It worked for me.

AntonVeynshter avatar May 21 '19 06:05 AntonVeynshter