Ask Your Question
0

Is there a way to fix rviz lag?

asked 2019-05-20 18:41:46 -0500

etorobot gravatar image

updated 2019-05-21 07:25:25 -0500

Remote PC specs: 16GB ram, Nvidia GTx, 2.4GHz i7. It maps using a kinect with sufficient speed

The robot PC is a Compaq Mini, no Nvidia, 1.6 Ghz Intel Processor, not the most responsive PC out there...

remote operation is through ssh, from the remote PC to the mini with the kinect on the bot. a simple rosrun rviz rviz (with no pointclouds or anything at all) is incredibly slow when moving the empty grid and is just as slow with actual images

Can anything be done to speed up rviz noticeably?

edit retag flag offensive close merge delete

Comments

What computer are you running rviz on?

SleepyTurtle gravatar imageSleepyTurtle ( 2019-05-21 00:59:20 -0500 )edit

@SleepyTurtle the remote PC

etorobot gravatar imageetorobot ( 2019-05-21 02:09:36 -0500 )edit
1

Just making sure: you're not using "X forwarding" with SSH, right (so using ssh -X ip.of.your.robot)?

What sort of graphics hw does the compaq mini have? Do you have any drivers installed, or are you running on an unaccelerated framebuffer?

gvdhoorn gravatar imagegvdhoorn ( 2019-05-21 02:51:39 -0500 )edit

@gvdhoorn it wouldn't run without the -X (waiting for master error).

compaq mini specs (from windows 7, it's dual boot with lubuntu):

processor - Intel Atom 1.6GHz, 1 GB RAM

adapter - Intel 945 Express Chiset

total available graphics memory - 251MB

dedicated video memory - 0 mb

system video memory - 64mb

shared system memory - 187 MB

Lubuntu Partition - 45 GB

etorobot gravatar imageetorobot ( 2019-05-21 05:40:16 -0500 )edit
1

If you're using X forwarding then RViz is running on your robot, not on your own compaq mini PC. Only the graphics output is forwarded to your compaq mini over the network. That is most likely why it is so slow.

Looking at the specs of your compaq mini, running RViz on the mini is probably not going to be very fast, and forwarding the results over an SSH connection to another PC is not improving that.

gvdhoorn gravatar imagegvdhoorn ( 2019-05-21 05:57:07 -0500 )edit

@gvdhoorn the mini IS [on] the robot.

the remote PC is an Acer Aspire; 16GB RAM, Nvidia GTX, i7. Handheld mapping isn't too slow, especially compared with the ssh mini.

RViz doesn't even work directly on the mini; segmentation fault (core dumped).

etorobot gravatar imageetorobot ( 2019-05-21 07:12:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-05-21 09:38:24 -0500

gvdhoorn gravatar image

updated 2019-05-21 12:35:23 -0500

a simple rosrun rviz rviz (with no pointclouds or anything at all) is incredibly slow when moving the empty grid and is just as slow with actual images [..] It wouldn't run without ssh -X (waiting for master error).

if you're using X forwarding you're essentially using whichever computer you're using to SSH from as the display device. You're running a heavy graphical application over a network connection. With all the rendering happening on the SSH server (that depends slightly on the exact SSH and X server configuration, but in general this is how it works). That's the most likely cause of the lag you're experiencing.

the remote PC is an Acer Aspire; 16GB RAM, Nvidia GTX, i7.

Ok, then I would suggest to run RViz on your Acer.

Treat it as a multi-machine ROS network setup. Be sure to set ROS_MASTER_URI and ROS_IP to appropriate values and things should work.

For your setup, something like this should work:

  • on the Acer: ROS_MASTER_URI=http://ip.of.compaq.mini:11311, ROS_IP=ip.of.acer.aspire
  • on the Mini: ROS_MASTER_URI=http://localhost:11311 (or whatever it is right now), ROS_IP=ip.of.compaq.mini

If you now start a roscore on the mini, you should be able to rostopic list from your Acer. Make sure to check the network setup pages on the wiki, especially the troubleshooting section (make sure clocks are synchronised fi).

PS: publishing pointclouds over a network connection is always going to be slower than processing / visualising them locally, so may still not necessarily work.


Edit:

i am running rviz on the acer through ssh -X to the mini.

you're not running it on the acer, but on the mini. X forwarding is similar to Windows Remote Desktop.

withouth the -X, I get segmentation fault (core dumped),

Do you have drivers installed for your Nvidia video card on the acer? What is the output of dpkg -l | grep nvidia?

which is the same thing i get trying to run rviz on the mini by itself.

The mini almost has no graphics hw. An intel945 is old and may not be capable of the accelerated OpenGL that RViz needs.

Are you saying run rviz on the acer without ssh to the mini

yes.

making the acer the master?

No. That is not needed.

edit flag offensive delete link more

Comments

i am running rviz on the acer through ssh -X to the mini. withouth the -X, I get segmentation fault (core dumped), which is the same thing i get trying to run rviz on the mini by itself. the mini is the master, and the rest of my network config is as you described.

Are you saying run rviz on the acer without ssh to the mini (making the acer the master)?

etorobot gravatar imageetorobot ( 2019-05-21 11:50:19 -0500 )edit

dpkg -l | grep nvidia gives no output, just a new line. apologies, i mixed up the errors.

without ssh, i tried rosrun rviz rviz as well as roscore on just the Acer: RViz waiting for master, could not contact ROS master at [ http://miniSTATION:11311 ], retrying .. .

if i try 'rosrun rviz rviz' in an ssh to mini terminal: QXcbConnection: could not connect to display

i only successfully rosrun rviz by ssh to the mini then roscore, then ssh -X to the mini, rosrun rviz from that window

edit: i "solved" the waiting for master by changing ROS_MATER_URI on the acer from mini's ip to "localhost", and the empty map responds at regular speed. the problem now is there are no options under fixed frame or topics to add as before, so nothing shows.

etorobot gravatar imageetorobot ( 2019-05-21 13:28:44 -0500 )edit
1

Please read my first answer, especially the values I suggested for ROS_MASTER_URI and ROS_IP.

Do not use hostnames.

And install a proper Nvidia driver on your system. If you're using Ubuntu, use the Additional Drivers tab of the Software & Updates applet. Refer to sites such as this one for some guidance.

You'll want to start all regular nodes on your robot, and just RViz on your acer.

Be sure to add the ROS_MASTER_URI and ROS_IP variables to your .bashrc (if using bash). Otherwise make sure to export those variables in all terminals that you open and use.

gvdhoorn gravatar imagegvdhoorn ( 2019-05-21 14:30:35 -0500 )edit

@gvdhoorn it works! no more lag! thank you! what is the problem with hostnames then?

It appears there are two Nvidia drivers installed, but the device is using an alternative, Nouveau display driver. clueless as to why.

etorobot gravatar imageetorobot ( 2019-05-21 15:12:31 -0500 )edit
1

what is the problem with hostnames then?

there is no problem per se, but if you don't have a working DNS server that can resolve all hostnames into IPs, you're going to run into problems. Seeing as I don't expect you have a working DNS server -- and seeing the error you posted earlier -- I figured IP addresses would probably be easier to get working. If you can setup DNS you can use hostnames of course.

It appears there are two Nvidia drivers installed, but the device is using an alternative, Nouveau display driver.

It's up to you, but the nvidia driver (so not Nouveau) is typically preferred when using ROS.

gvdhoorn gravatar imagegvdhoorn ( 2019-05-22 01:33:01 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-05-20 18:41:46 -0500

Seen: 173 times

Last updated: May 21