gkjohnson / urdf-loaders

URDF Loaders for Unity and THREE.js with example ATHLETE URDF Files open sourced from NASA JPL
https://gkjohnson.github.io/urdf-loaders/javascript/example/bundle/index.html
Apache License 2.0
471 stars 122 forks source link

Don't parseFloat null values in setJointValue #282

Closed EzraBrooks closed 9 months ago

EzraBrooks commented 9 months ago

As discussed in #281:

Previously this code was parsing all values into numbers, including null, which we later attempt to use in the same function as a no-op. But with the current code, passing null would result in a NaN, making the if-null code unreachable.

EzraBrooks commented 9 months ago

FYI I'm headed out on vacation for a week, if you'd rather not include the JSDoc comment feel free to remove it and merge the PR.

I will say that in roslibjs we have had great success auto-generating TypeScript types from JSDoc comments, so that's a potential future value-add :)

gkjohnson commented 9 months ago

I will say that in roslibjs we have had great success auto-generating TypeScript types from JSDoc comments, so that's a potential future value-add :)

If this is something you want to contribute that would be great. The problem generally is maintaining docs, code, typescript definitions, and js doc. We'll merge it for now, though - thanks!