Skip to content

IndexError: list index out of range [Only when running with ros2]  #124

@AjinJayan

Description

@AjinJayan

@wangg12 @shanice-l @Rainbowend @tzsombor95 need your help.

The inference script runs successfully without any errors when executed as a standalone Python script. By when running with ros2, ie., calling script inside ros2 node, the following error occurs. This error is happening at the pose refinement stage.

The error occurs at the line "used_program.draw("triangles", model.index_buffer)" inside renderer.py.
I also tried changing app backends and gl backends, but same error


WARNING: OpenGL version could not be determined, which might be a sign that OpenGL is not loaded correctly.
2024-09-09 14:01:55,310 - WARNING - OpenGL version could not be determined, which might be a sign that OpenGL is not loaded correctly.
Traceback (most recent call last):
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_iris/lib/xrm_perception_iris/perception.server.v2.py", line 283, in
main()
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_iris/lib/xrm_perception_iris/perception.server.v2.py", line 273, in main
executor.spin()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 294, in spin
self.spin_once()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 794, in spin_once
self._spin_once_impl(timeout_sec)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 791, in _spin_once_impl
future.result()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 94, in result
raise self.exception()
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/task.py", line 239, in call
self._handler.send(None)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 437, in handler
await call_coroutine(entity, arg)
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 391, in _execute_service
response = await await_or_execute(srv.callback, request, srv.srv_type.Response())
File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/executors.py", line 107, in await_or_execute
return callback(*args)
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_iris/lib/xrm_perception_iris/perception.server.v2.py", line 239, in srv_task_callback
self.perception.inference_call(request)
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_iris/local/lib/python3.10/dist-packages/xrm_perception_iris/pipeline/pipeline_v2/init.py", line 85, in inference_call
self.pipeline.inference_call()
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_iris/local/lib/python3.10/dist-packages/xrm_perception_iris/pipeline/pipeline_v2/pipeline.py", line 139, in inference_call
self.gdrnpp1.inference(self.data.color.copy(), self.data.depth.copy(), target_obj )
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_modules/local/lib/python3.10/dist-packages/xrm_perception_modules/models/gdrnpp/get6dpose.py", line 64, in inference
poses = self.gdrn_predictor.postprocessing(data_dict, out_dict)
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_modules/local/lib/python3.10/dist-packages/xrm_perception_modules/models/gdrnpp/predictor_gdrn.py", line 216, in postprocessing
self.process_depth_refine(data_dict, out_dict)
File "/home/rack/Workspace/projects/xrm/install/xrm_perception_modules/local/lib/python3.10/dist-packages/xrm_perception_modules/models/gdrnpp/predictor_gdrn.py", line 281, in process_depth_refine
self.ren.draw_model(
File "/home/rack/Workspace/projects/3rdparty/gdrnpp_ws/gdrnpp/lib/render_vispy/renderer.py", line 407, in draw_model
used_program.draw("triangles", model.index_buffer)
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/program.py", line 543, in draw
canvas.context.flush_commands()
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/context.py", line 172, in flush_commands
self.glir.flush(self.shared.parser)
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 584, in flush
self._shared.flush(parser)
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 506, in flush
parser.parse(self._filter(self.clear(), parser))
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 824, in parse
self._parse(command)
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 798, in _parse
ob.attach(*args)
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 1803, in attach
self.deactivate()
File "/home/rack/.pyenv/versions/gdrnpp/lib/python3.10/site-packages/vispy/gloo/glir.py", line 1774, in deactivate
gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, stack[-1])
IndexError: list index out of range
The following exception was never retrieved: cannot use Destroyable because destruction was requested
[ros2run]: Process exited with failure 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions