QT With Librviz

asked 2016-11-29 10:05:21 -0600

Filipe gravatar image

updated 2016-11-29 11:36:33 -0600

Hello I manage to follow the tutorial and made it work on my project to integrate librviz in a qt4 qwidget. My problem now is that i want to publish a message from type point cloud2 in the librviz i manage to find some inputs and follow them and i think I'm linked to the right topic and all but the rviz window doesn't draw anything into the screen and it doesn't replay any error so could you help me. I leave here my code, I'm playing a bag with the topic that I'm subscribing.

render_panel_->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); manager_ = new rviz::VisualizationManager( render_panel_ ); render_panel_->initialize( manager_->getSceneManager(), manager_ ); manager_->initialize(); manager_->startUpdate();

// Create a Grid display.

grid1_ = manager_->createDisplay( "rviz/PointCloud2", "/octomap_point_cloud_centers", true ); ROS_ASSERT( grid1_ != NULL );

// // Configure the GridDisplay the way we like it.

grid1_->subProp("Topic")->setValue("/my_cloud");

grid1_->subProp( "Color" )->setValue( Qt::yellow );

grid1_->setFixedFrame("/world");

grid1_->subProp("Style")->setValue("Flat Squares");

grid1_->setProperty("Size",0.1);

grid1_->setProperty("Decay Time",10);

edit retag flag offensive close merge delete

Comments

Is there any message when you echo the topic /my_cloud?

huanxiner gravatar imagehuanxiner ( 2016-11-29 13:46:31 -0600 )edit

yes here is a example of ros topic echo.

header: seq: 27253 stamp: secs: 1446727940 nsecs: 971097230 frame_id: base_link height: 1 width: 212 fields:

Filipe gravatar imageFilipe ( 2016-11-30 03:52:37 -0600 )edit

name: x offset: 0 datatype: 7 count: 1

name: y
offset: 4
datatype: 7
count: 1

name: z
offset: 8
datatype: 7
count: 1

name: index
offset: 12
datatype: 5
count: 1

is_bigendian: False point_step: 16 row_step: 3392

and then comes the data

Filipe gravatar imageFilipe ( 2016-11-30 03:53:53 -0600 )edit