ros3djs icon indicating copy to clipboard operation
ros3djs copied to clipboard

OccupancyMap and OccupancyMapClient are not being built

Open AliKarpuzoglu opened this issue 4 years ago • 3 comments

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

AliKarpuzoglu avatar Nov 18 '20 14:11 AliKarpuzoglu

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.

psaripp avatar Dec 16 '20 12:12 psaripp

@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?

AliKarpuzoglu avatar Jan 06 '21 13:01 AliKarpuzoglu

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

brean avatar Mar 11 '21 14:03 brean