Ask Your Question
1

Displaying point cloud in browser

asked 2014-06-05 14:48:20 -0600

jdreic gravatar image

I've been looking into displaying a point cloud in the browser using ros3djs and rosbridge. There's a tutorial for streaming point cloud data from a Kinect, but I just want to take a pointcloud2 message and render it with ros3djs. As documented, it seems like it can only take a stream directly from a camera, but is there a way within the current framework to just display directly from a pointcloud2 message?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-11-09 15:23:35 -0600

jacksonkr_ gravatar image

This must be the tutorial you're talking about (I've only ever seen one)

http://wiki.ros.org/ros3djs/Tutorials...

If your point cloud is coming from a topic then that's all you need. The reason this is easy with a camera is because the point cloud sources, nodes, and topics already written and work.

That being said, the PointCloud2 topic over rosbridge websocket is wonky as of indigo, good luck with that..

edit flag offensive delete link more
1

answered 2018-09-26 00:50:13 -0600

sharath gravatar image

updated 2018-09-26 01:02:19 -0600

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);
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-06-05 14:48:20 -0600

Seen: 818 times

Last updated: Sep 26 '18