ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can create a temporary topic subscription and call the processMessage function of ROS3D.PointCloud2 class.

var tmpSub = new ROS3D.PointCloud2({
   ros:ros,

You can create a temporary topic subscription and call the processMessage function of ROS3D.PointCloud2 class.class. In the below code call the displayCloud function with your sensor_msgs::PointCloud2 message.

var viewer = new ROS3D.Viewer({
  divID : 'webViewer',
  width : 800,
  height : 600,
  antialias : true,
  background : '#111111'
});
var tmpSub = new ROS3D.PointCloud2({
   ros:ros,
   tfClient: tfClient, 
   rootObject: viewer.scene,
   topic: '/tmp/points',
   material: {size: 0.01, color: 0xeeeeee }
});
function displayCloud(msg){
  tmpSub.processMessage(msg);
}

You can create a temporary topic subscription and call the processMessage function of ROS3D.PointCloud2 class. In the below code call the displayCloud function with your sensor_msgs::PointCloud2 message.

var viewer = new ROS3D.Viewer({
  divID : 'webViewer',
  width : 800,
  height : 600,
  antialias : true,
  background : '#111111'
});
var tmpSub = new ROS3D.PointCloud2({
   ros:ros,
   tfClient: tfClient, 
   rootObject: viewer.scene,
   topic: '/tmp/points',
   material: {size: 0.01, color: 0xeeeeee }
});
function displayCloud(msg){
  tmpSub.processMessage(msg);
}