Robotics StackExchange | Archived questions

ros3djs LaserScan does not display the points

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?

Asked by AMLhk on 2021-01-17 19:43:03 UTC

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.

Asked by miura on 2021-01-19 09:38:25 UTC

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.

Asked by AMLhk on 2021-01-19 21:16:48 UTC

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

Asked by miura on 2021-01-20 08:12:55 UTC

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?

Asked by rezenders on 2021-04-22 12:42:32 UTC

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?

Asked by mduz10 on 2022-11-25 01:38:50 UTC

Answers