ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

RViz segfaults unless a monitor is connected, any way to prevent this?

asked 2011-04-15 09:54:03 -0600

splasho gravatar image

updated 2014-01-28 17:09:32 -0600

ngrennan gravatar image

So I connect to my robot running Ubuntu 10.10, Diamondback via VNC. Everything is fine except RViz. It gives no output except for "Segmentation Error" unless a monitor is plugged in by VGA. Beyond this point I can just unplug the monitor and continue to work over VNC. But it's fairly frustrating. Anybody got any suggestion as to how to prevent this? Thanks in advance for any ideas.

edit retag flag offensive close merge delete

8 Answers

Sort by » oldest newest most voted
2

answered 2011-04-18 13:04:32 -0600

mjcarroll gravatar image

Ubuntu will not initialize X Windows (the windowing/graphics system) if there is not a monitor at boot. This means that VNC and remote desktop will not start either (nor network manager, which is a pain sometimes).

So, in order to "fool" your computer into thinking that there is a monitor, get a VGA cable, and make a loopback or dummy connector for when you run headless. Connect pins 1 to 6, 2 to 7, and 3 to 8 using 50-200 ohm resistors (tutorials seem to vary, 200 is on the safe side).

Your new "dummy" will show up as a 1024x768 VGA monitor, good to go. X windows will now start at boot.

DISCLAIMER: I don't claim that this will work, but other people on the internet do. Try at your own risk.

edit flag offensive delete link more

Comments

This wasn't the case for me - VNC was starting fine, but RViz wasn't. But thanks for the VGA trick.
splasho gravatar image splasho  ( 2011-04-22 07:09:00 -0600 )edit
I did try the vga dummy but I get a max resolution of 640x480, the other option was 320x240. How do I get at least 1024x768 resolution?
Homer Manalo gravatar image Homer Manalo  ( 2011-04-28 14:59:44 -0600 )edit
4

answered 2011-04-17 13:21:56 -0600

Eric Perko gravatar image

What you are likely seeing is that, without the VGA connected, your graphics doesn't startup at all. On our robots, without a monitor plugged in on bootup, the discrete graphics cards don't get initialized and X never starts, so VNC with RViz wouldn't work so well.

In either case, VNC or forwarding X is probably not the best way to work with rviz remotely. A much better plan would be to follow the directions on NetworkSetup to get your computer connected to the robot's rosmaster (setting the ROS_MASTER_URI and ROS_IP for both machines is what I do instead of setting up DNS). This way, you can run rviz locally on your computer, only sending ROS data across the network instead of forwarding X or VNC, both of which I found to be quite slow when working with a 3D application like rviz.

edit flag offensive delete link more

Comments

Yeah unfortunately for complex reasons my second computer had to be running windows, I agree VNC is slow. In my case X was starting, it wasn't simply a matter of boot up, regardless of how I booted up RViz would not start without a monitor plugged in. Thanks though.
splasho gravatar image splasho  ( 2011-04-22 07:10:36 -0600 )edit
2

answered 2011-04-28 14:57:26 -0600

Homer Manalo gravatar image

updated 2011-04-28 15:01:58 -0600

Try virtualgl. It did solve the rviz segfault for me. When your finished setting up just run rviz like this:

vglrun rosrun rviz rviz
edit flag offensive delete link more
1

answered 2011-04-22 09:24:38 -0600

http://en.wikipedia.org/wiki/Xvfb is something what helped me on case when I needed dummy graphics.

edit flag offensive delete link more
0

answered 2011-04-17 12:07:50 -0600

Nick H gravatar image

Load it up under gdb and run a backtrace to see what the root cause is. I'd guess that it's probably the graphics drivers causing the segfault, there are a number of Rviz segfaults that go away when using better/newer graphics drivers.

edit flag offensive delete link more
0

answered 2017-06-24 03:18:13 -0600

Kitkat7 gravatar image

A dummy driver can help!

Just following the first voted answer here https://askubuntu.com/questions/453109/add-fake-display-when-no-monitor-is-plugged-in.

It works for me in Ubuntu 16.04 with a little modification:

  • Replace the installation with sudo apt install xserver-xorg-video-dummy-lts-xenial.
  • And write in the configuration file /usr/share/X11/xorg.conf.d/xorg.conf following the above link.
Section "Device"
    Identifier  "Configured Video Device"
    Driver      "dummy" EndSection

Section "Monitor"
    Identifier  "Configured Monitor"
    HorizSync 31.5-48.5
    VertRefresh 50-70 EndSection

Section "Screen"
    Identifier  "Default Screen"
    Monitor     "Configured Monitor"
    Device      "Configured Video Device"
    DefaultDepth 24
    SubSection "Display"
    Depth 24
    Modes "1024x800"
    EndSubSection EndSection
  • Reboot, and now RViz can work over VNC without monitor.
edit flag offensive delete link more
0

answered 2011-04-15 10:07:54 -0600

splasho gravatar image

Ironically the monitor does not even need to be switched on, so maybe I can wire up a VGA cable to pretend to be a monitor.. But a software solution would be ideal, especially as I have know idea how to do the hardware option.

edit flag offensive delete link more
0

answered 2011-04-22 09:26:21 -0600

Another thing - monitors do use I2C for identification purposes. They use 0x37 and some other address. Maybe you need to set up some dummy i2c client. More info is here http://www.paintyourdragon.com/?p=43

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2011-04-15 09:54:03 -0600

Seen: 4,629 times

Last updated: Apr 28 '11