Robotics StackExchange | Archived questions

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.

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

// Create a Grid display.

grid1_ = manager->createDisplay( "rviz/PointCloud2", "/octomappointcloudcenters", true ); ROSASSERT( grid1 != NULL );

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

grid1->subProp("Topic")->setValue("/mycloud");

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);

Asked by Filipe on 2016-11-29 11:05:21 UTC

Comments

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

Asked by huanxiner on 2016-11-29 14:46:31 UTC

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:

Asked by Filipe on 2016-11-30 04:52:37 UTC

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

Asked by Filipe on 2016-11-30 04:53:53 UTC

Answers