QT With Librviz
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);
Is there any message when you echo the topic /my_cloud?
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:
name: x offset: 0 datatype: 7 count: 1
is_bigendian: False point_step: 16 row_step: 3392
and then comes the data