RethinkRobotics-opensource / gennodejs

ROS JavaScript message definition and serialization generators
Apache License 2.0
7 stars 21 forks source link

Generated files for custom messages have duplicate entries #26

Open jmachuca77 opened 4 years ago

jmachuca77 commented 4 years ago

When trying to import some custom messages I get an error:

my_node.js: Identifier 'my_custom_message' has already been declared

when checking the generated files in my_ws/devel/share/gennodejs/ros I see the files are generated for my node, but they have duplicated entries in _index.js

"use strict";

let my_custom_message1 = require('./my_custom_message1.js');
let my_custom_message2 = require('./my_custom_message2.js');
let my_custom_message1 = require('./my_custom_message1.js');
let my_custom_message2 = require('./my_custom_message2.js');

module.exports = {
  my_custom_message1: my_custom_message1,
  my_custom_message2: my_custom_message2,
  my_custom_message1: my_custom_message1,
  my_custom_message2: my_custom_message2,
};

Any idea what could be causing this? Manually removing the duplicates fixes the issue but I would rather not have to do this every time I do a build.

Originally posted in RethinkRobotics-opensource/rosnodejs#146

chris-smith commented 4 years ago

Any chance you can put your workspace on GitHub somewhere?

jmachuca77 commented 4 years ago

Hi, Sorry for the late response, unfortunately no, this is a private development. Im not sure how to debug this.. maybe I can build a package with a similar structure and see if the issues show up there too.