ros3djs LaserScan does not display the points

asked 2021-01-18 20:39:08 -0500

AMLhk gravatar image

Hello, I'm having a problem displaying the laser scan on my browser. here is my code:

var viewer = new ROS3D.Viewer({
divID : 'scan',
width : 800,
height : 600,
background: '#444444',
antialias : true
});

var tfClient = new ROSLIB.TFClient({
  ros : ros,
  angularThres : 0.01,
  transThres : 0.01,
  rate : 10.0,
  fixedFrame : ''//laser_base_link
});

var scanclient = new ROS3D.LaserScan({
    ros: ros,
    topic: '/scanR',
    tfClient: tfClient,
    rootObject: viewer.scene,
    material: { size: 0.05, color: 0xff00ff }
});

when I recordĀ  a bagfile of the scan and run it on my laptop my browser display it perfectly, but when I try the same code on my jetson (nvidia nx) nothing displayed on the browser. and I tried to test the three.js & viewer from ros3djs by creating a simple Three JS cube and it was displayed. What am I missing here?

edit retag flag offensive close merge delete

Comments

Is the browser you used a laptop in both cases? If so, I think you need to be able to see the topics you are publishing in jetson on your laptop.

For example, you can set the ROS_IP and ROS_MASTER_URI. Alternatively, you can use rosbridge.

miura gravatar image miura  ( 2021-01-19 08:38:25 -0500 )edit

Thank you for your reply. Is the browser you used a laptop in both cases? No,I'm running the UI and the rosbridge on the same machine. I mean on the jetson.

On my laptop I tested it on a simulated robot in gazebo, and I tested the bag file that I recorded from the jetson.

On the jetson, Rviz displays laser scans perfectly, and I can see that the rosbridge_websocket is a subscriber in the /scan topic but it can not be displyed on the browser.

AMLhk gravatar image AMLhk  ( 2021-01-19 20:16:48 -0500 )edit

Is it possible that the IP and port used for the websocket connection is different between the laptop and the jetson?

miura gravatar image miura  ( 2021-01-20 07:12:55 -0500 )edit

Did you fix it? I am trying to display laserscan in a similar way you posted but it does not work. I can't find any good tutorials for this. Does anyone have one to share?

rezenders gravatar image rezenders  ( 2021-04-22 12:42:32 -0500 )edit

Hey, Did you fix it? I'm trying to show laser-scan data but I couldn't. I am subscribing scan topic but I can not see anything on div. Is there any solution to this problem?

mduz10 gravatar image mduz10  ( 2022-11-25 00:38:50 -0500 )edit