RobotWebTools / ros3djs

3D Visualization Library for use with the ROS JavaScript Libraries
https://robotwebtools.github.io/ros3djs
Other
368 stars 216 forks source link

OccupancyMap and OccupancyMapClient are not being built #347

Closed AliKarpuzoglu closed 1 year ago

AliKarpuzoglu commented 3 years ago

Hi, even after adding

export * from './navigation/OccupancyMap'
export * from './navigation/OccupancyMapClient'

to es6-support/index.js

the grunt build fails with an "unexpected token"

Warning: Command failed: rollup -c

src-esm/index.js → ./build/ros3d.js...
[!] (commonjs plugin) SyntaxError: Unexpected token (59:35) in /PATH/ros3djs/src-esm/navigation/OccupancyMap.js
src-esm/navigation/OccupancyMap.js (59:35)

is the file not finished? the weird thing is that the issue only occurs after the es6 output

psaripp commented 3 years ago

It seems the issue is it fails to generate classes from the es5 code. It's responsible by es6-transpiler, but I could not understand how the code supposed to be formatted or written to be satisfied by that regex madness there. If someone with a better understanding of that may explain it to me, I'm happy to reformat these parts to satisfy this thig.

AliKarpuzoglu commented 3 years ago

@psaripp I am wondering: how did you get the code to run if they didn't get included in the js? Are you using a different building method?

brean commented 3 years ago

After converting the code to ES5 and giving every class its own js-file I was able to transpile it, but it is hardcoded to work with the message type "octomap_msgs/Octomap" only, not (in my case) "nav_msgs/OccupancyGrid", so it does not work as OccupancyGridMap which I would have expected...

I can create a pull request providing my fixes but I think this needs some more discussion and development, I just made stuff work without knowing what it should do.


I also highly support the move to ES6 as described in https://github.com/RobotWebTools/ros3djs/issues/228