0
$\begingroup$

Rosanswers logo

Hello

I am trying to implement a GUI (using C++ and QT) to control my robot. I would like to have a simulation of my robot to be part of the GUI so that I can first move my robot on the simulation (using my GUI controls) and see if the move is collision-free and then move the real robot.

I can run my robot's simulation in RViz and move my robot. Now I would like to "embed" what I see in RViz (as the simulation of my robot) into my GUI application as a QWidget.

I know this tutorial on librviz, however this tutorial is too simplistic as it only adds an empty grid into custom C++ GUI app but does not implement any robot visualization/interaction.

Can you suggest any better documentation or example projects that I can dig into? Any help or suggestion would be very much appreciated.

Thanks in advance!


Originally posted by firim on ROS Answers with karma: 3 on 2018-02-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

There isn't a whole lot more to it than the tutorial if you are only concerned with Displays- you can take every Display you have in rviz and use it in librviz with createDisplay and subProp and setValue calls. All the names are the same as what is in rviz, to know that 'Grid' has to be 'rviz/Grid' go into the Add | By display type and the first part of the name is the same as the folder the display is in.

I haven't run this code in a while but this https://github.com/lucasw/rviz_camera_stream/blob/librviz_node/librviz_camera/src/panel.cpp was a project to make a librviz panel that was initially blank but could be configured to any display via service calls.

The other parts of rviz I'm not sure about, and probably deserve the own questions (if there aren't already questions and answers here): how to have tools like '2D nav goal' in a librviz panel, or how to programmatically control the type, position, and angle of the camera (there is ViewController documentation about this?).


Originally posted by lucasw with karma: 8729 on 2018-02-17

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.