uzh-rpg / rpg_esim

ESIM: an Open Event Camera Simulator
MIT License
589 stars 124 forks source link

ERROR: failed to set up multisampled framebuffer #1

Open supitalp opened 6 years ago

supitalp commented 6 years ago

When I launch the OpenGL renderer, I get a crash with the following log:

NODES
 /
   dvs_renderer (dvs_renderer_advanced/dvs_renderer_advanced)
   esim_node (esim_ros/esim_node)
   hector_trajectory_server (hector_trajectory_server/hector_trajectory_server)
   optic_flow_viz (esim_visualization/optic_flow_converter.py)
   sync (topic_tools/transform)

ROS_MASTER_URI=http://127.0.0.1:11311

process[esim_node-1]: started with pid [11771]
process[dvs_renderer-2]: started with pid [11772]
process[sync-3]: started with pid [11773]
process[optic_flow_viz-4]: started with pid [11774]
process[hector_trajectory_server-5]: started with pid [11802]
[ INFO] [1534428879.606363020]: Waiting for tf transform data between frames map and cam0 to become available
[ INFO] [1534428879.693591802]: Changing framerate to 30 Hz
[INFO] [1534428880.726421]: Started flow converter node
[INFO] [1534428880.726993]: Step size between arrows: 7
[INFO] [1534428880.727366]: Scale factor: 0.07
[INFO] [1534428880.727705]: Upsample factor: x1
[INFO] [1534428880.728048]: Publish rate: 100 Hz
I0816 16:14:41.142905 11771 data_provider_online_render.cpp:63] Horizontal FOV: 61.7164 deg
I0816 16:14:41.143277 11771 data_provider_online_render.cpp:64] Vertical FOV: 48.2168 deg
I0816 16:14:41.143301 11771 data_provider_online_render.cpp:65] Diagonal FOV: 73.4823 deg
I0816 16:14:42.228034 11771 model.h:54] will load model at: /home/ggb/ros/catkin_ws/src/rpg_event_camera_simulator/event_camera_simulator/imp/imp_opengl_renderer/resources/objects/flying_room/flying_room.obj
F0816 16:14:42.913523 11771 opengl_renderer.cpp:115] ERROR: failed to set up multisampled framebuffer
*** Check failure stack trace: ***
   @     0x7f770901b03d  google::LogMessage::Fail()
   @     0x7f770901cea3  google::LogMessage::SendToLog()
   @     0x7f770901abcb  google::LogMessage::Flush()
   @     0x7f770901d88e  google::LogMessageFatal::~LogMessageFatal()
   @     0x7f77050587f0  event_camera_simulator::OpenGLRenderer::init()
   @     0x7f7705059558  event_camera_simulator::OpenGLRenderer::setCamera()
   @     0x7f770a986667  event_camera_simulator::DataProviderOnlineMoving3DCameraRig::DataProviderOnlineMoving3DCameraRig()
   @     0x7f770a984af9  event_camera_simulator::loadDataProviderFromGflags()
   @           0x421e17  main
   @     0x7f77086cd830  __libc_start_main
   @           0x421b89  _start
[esim_node-1] process has died [pid 11771, exit code -6, cmd /home/ggb/ros/catkin_ws/devel/lib/esim_ros/esim_node --v=1 --vmodule=data_provider_from_folder=10 --flagfile=/home/ggb/ros/catkin_ws/src/rpg_event_camera_simulator/event_camera_simulator/esim_ros/cfg/opengl.conf __name:=esim_node __log:=/home/ggb/.ros/log/b282cc46-a159-11e8-a753-3c970e1b96f5/esim_node-1.log].
log file: /home/ggb/.ros/log/b282cc46-a159-11e8-a753-3c970e1b96f5/esim_node-1*.log
^C[hector_trajectory_server-5] killing on exit
[optic_flow_viz-4] killing on exit
[sync-3] killing on exit
[dvs_renderer-2] killing on exit
shutting down processing monitor...
supitalp commented 6 years ago

The problem comes from the GPU / OpenGL version not supporting the number of anti-aliasing samples (currently hard-coded to 16 here: https://github.com/uzh-rpg/rpg_esim/blob/master/event_camera_simulator/imp/imp_opengl_renderer/src/opengl_renderer.cpp#L97)

As a quick fix, change this line: https://github.com/uzh-rpg/rpg_esim/blob/master/event_camera_simulator/imp/imp_opengl_renderer/src/opengl_renderer.cpp#L97 to set a smaller value (maybe, 4?), and recompile. The problem should disappear.

I will soon commit a patch for this, properly looking up the maximum allowed number of samples through OpenGL.

gaImdea commented 5 years ago

I have the same problem when I launch the OpenGL renderer, I get a crash as follows:


> NODES
  /
    dvs_renderer (dvs_renderer/dvs_renderer)
    esim_node (esim_ros/esim_node)
    hector_trajectory_server (hector_trajectory_server/hector_trajectory_server)
    optic_flow_viz (esim_visualization/optic_flow_converter.py)

auto-starting new master
process[master]: started with pid [12592]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 12f9bcc8-fd22-11e8-9c01-34e6d7284e42
process[rosout-1]: started with pid [12605]
started core service [/rosout]
process[esim_node-2]: started with pid [12619]
process[dvs_renderer-3]: started with pid [12623]
process[optic_flow_viz-4]: started with pid [12624]
process[hector_trajectory_server-5]: started with pid [12625]
I1211 09:52:23.211774 12619 data_provider_online_render.cpp:63] Horizontal FOV: 61.7164 deg
I1211 09:52:23.216259 12619 data_provider_online_render.cpp:64] Vertical FOV: 48.2168 deg
I1211 09:52:23.216284 12619 data_provider_online_render.cpp:65] Diagonal FOV: 73.4823 deg
[ INFO] [1544518343.227088247]: Waiting for tf transform data between frames map and cam0 to become available
I1211 09:52:23.283802 12619 model.h:54] will load model at: /home/oaiepc/sim_ws/src/rpg_esim/event_camera_simulator/imp/imp_opengl_renderer/resources/objects/flying_room/flying_room.obj
[INFO] [1544518343.658850]: Started flow converter node
[INFO] [1544518343.659282]: Step size between arrows: 7
[INFO] [1544518343.659455]: Scale factor: 0.07
[INFO] [1544518343.659613]: Upsample factor: x1
[INFO] [1544518343.659764]: Publish rate: 100 Hz
F1211 09:52:23.684607 12619 opengl_renderer.cpp:116] ERROR: failed to set up multisampled framebuffer
*** Check failure stack trace: ***
    @     0x7f3b756fb43d  google::LogMessage::Fail()
    @     0x7f3b756fd253  google::LogMessage::SendToLog()
    @     0x7f3b756fafcb  google::LogMessage::Flush()
    @     0x7f3b756fdc3e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f3b7173d62a  event_camera_simulator::OpenGLRenderer::init()
    @     0x7f3b7173dd7a  event_camera_simulator::OpenGLRenderer::setCamera()
    @     0x7f3b76cda786  event_camera_simulator::DataProviderOnlineMoving3DCameraRig::DataProviderOnlineMoving3DCameraRig()
    @     0x7f3b76cd2a97  event_camera_simulator::loadDataProviderFromGflags()
    @           0x404e4e  main
    @     0x7f3b74b8b830  __libc_start_main
    @           0x4057c9  _start
[esim_node-2] process has died [pid 12619, exit code -6, cmd /home/oaiepc/sim_ws/devel/lib/esim_ros/esim_node --v=1 --vmodule=data_provider_from_folder=10 --flagfile=/home/oaiepc/sim_ws/src/rpg_esim/event_camera_simulator/esim_ros/cfg/opengl.conf __name:=esim_node __log:=/home/oaiepc/.ros/log/12f9bcc8-fd22-11e8-9c01-34e6d7284e42/esim_node-2.log].
log file: /home/oaiepc/.ros/log/12f9bcc8-fd22-11e8-9c01-34e6d7284e42/esim_node-2*.log

I have changed the number of samples from 16 to 4 in opengl_renderer.cpp#L96 , but this does not seems to work either, any suggestion?

supitalp commented 5 years ago

Have you tried to set it to something smaller? Maybe 2, or 1? What kind of GPU do you have?

gaImdea commented 5 years ago

Yes, I have tried all values between 1 and 16. These are the details of my GPU

00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a16] (rev 0b) (prog-if 00 [VGA controller]) DeviceName: Onboard IGD Subsystem: Dell Haswell-ULT Integrated Graphics Controller [1028:05cb] Flags: bus master, fast devsel, latency 0, IRQ 45 Memory at f7800000 (64-bit, non-prefetchable) [size=4M] Memory at e0000000 (64-bit, prefetchable) [size=256M] I/O ports at f000 [size=64] [virtual] Expansion ROM at 000c0000 [disabled] [size=128K] Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit- Capabilities: [d0] Power Management version 2 Capabilities: [a4] PCI Advanced Features Kernel driver in use: i915 Kernel modules: i915

Just to avoid misunderstandings when you say to change the value of the number of samples and to recompile , you mean

  1. To edit the file opengl_renderer.cpp
    1. save and exit
  2. run again the simulator by typing roslaunch esim_ros esim.launch config:=cfg/opengl.conf

right ?

supitalp commented 5 years ago

Thank you for the info. You also need ro recompile between step 2 and step 3 (catkin build esim_ros), can you confirm you also did that?

gaImdea commented 5 years ago

No , that was the problem, now it perfectly works, thanks a lot for the support !

supitalp commented 5 years ago

Nice! I will leave the issue open still since other people might encounter the same issue. Will close it when I fix this. Thanks for your feedback.

Jee-King commented 5 years ago

Hi, I have the same problem, but the above link https://github.com/uzh-rpg/rpg_event_camera_simulator/blob/master/event_camera_simulator/imp/imp_opengl_renderer/src/opengl_renderer.cpp#L96 is not fount. So could you give me some other suggestions?

Thank you very much!! @supitalp @galmdea

Jee-King commented 5 years ago

Hi,I have changed the number of samples from 16 to 4 in opengl_renderer.cpp#L96. runroslaunch esim_ros esim.launch config:=cfg/opengl.conf 1 and run rviz -d cfg/esim.rviz 2

can you give some suggestion?

supitalp commented 5 years ago

Hi, Glad that you found a solution to your first problem. Here is the fixed URL: https://github.com/uzh-rpg/rpg_esim/blob/master/event_camera_simulator/imp/imp_opengl_renderer/src/opengl_renderer.cpp#L97

Regarding your second question, what is the problem exactly? The events (and everything else) should be published on their respective topic, I don't see anything wrong with your screenshot.

Jee-King commented 5 years ago

Thank you for your reply. I am a newer, I just do not know how to use this simulator, the visualization is like some random chaos.

supitalp commented 5 years ago

Hi, I see. It's a good point, there is currently no "beginner-friendly" tutorial, we assume that users have familiarity with ROS already. If you do not know anything about ROS, giving a quick look at the ROS tutorials would be a good starting point. ESIM will publish data from the different simulated sensors (most importantly, the events) on different topics, and additionally save everything to a rosbag (the data format of ROS), Then, you can either: 1) write a ROS node to listen to one or more topics to do some processing in real-time, or 2) read data from the rosbag (offline) (see tutorial here).

Finally, we provide two simple ways to visualize the data in real-time as it is simulated through the tools rviz and rqt. The "random chaos" you describe in your rviz screenshot above is the camera trajectory (by default, it is set to a random spline).

Hope that helps.

Jee-King commented 5 years ago

Thank you for your detailed reply. Your suggestion is very helpful!

shiba24 commented 4 years ago

Hi @supitalp, related to this - is it possible to run OpenGLRenderer on CPU? In such a case is it ok to set 1 instead of 16, as you mentioned? https://github.com/uzh-rpg/rpg_esim/issues/1#issuecomment-434198219