ros3djs icon indicating copy to clipboard operation
ros3djs copied to clipboard

Change minimum step size for displaying changes in joint angle or position

Open joshua-glazer opened this issue 6 years ago • 2 comments

I've figured out how to display a URDF of my team's robot arm in a webpage using ros3djs. I'm using joint_state_publisher to move the model. My issue is that the fingers have a small-ish displacement (0-20mm) and the viewer seems to only update the model in steps of about 10mm (0.01m).

If I echo the /joint_states topic I can see that I'm publishing fractional values such as 0.00255 so I'm relatively confident that it's not related to the joint_state_publisher. Is there any way to adjust the minimum step size in the javascript? I'm not sure what variable would need to be adjusted or whether there's an interface that I have access to for adjusting it.

joshua-glazer avatar Aug 26 '19 21:08 joshua-glazer

I think that in the tf2_web_republisher node there is a line which publishes new TFs only if TF(t) - TF(t-1) is less then 0.01. You can change that instruction and put your own threshold and it should probably be shown on your html page.

MerAARIZOU avatar Aug 28 '19 09:08 MerAARIZOU

Ah, it was right under my nose. The thresholds are set when the tf client is created in the javascript:

let tfClient = new ROSLIB.TFClient({
    ros : ros,
    angularThres : 0.01,
    transThres : 0.01,
    rate : 10.0
  })

The webpage generates tf requests which contain the thresholds and the web republisher then catches the request in requestCB().

joshua-glazer avatar Aug 28 '19 18:08 joshua-glazer