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

Displaying point cloud in browser

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

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 -0500

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 -0500

sharath gravatar image

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

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

Comments

did this work for you ?

roua gravatar image roua  ( 2020-06-07 14:35:09 -0500 )edit

Yeah, it works!

sharath gravatar image sharath  ( 2020-06-08 22:21:28 -0500 )edit

How is the latency using this? And how is the bandwidth requirements? Is there some kind of compression?

Bender_From_Futurama gravatar image Bender_From_Futurama  ( 2021-09-09 07:36:21 -0500 )edit

How do you decode the point cloud from roslibjs to get the raw data?

Bender_From_Futurama gravatar image Bender_From_Futurama  ( 2021-09-14 00:41:51 -0500 )edit

Question Tools

3 followers

Stats

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

Seen: 1,908 times

Last updated: Sep 26 '18