eProsima / Fast-DDS-Gen

Fast-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
82 stars 62 forks source link

I generated cpp files from DDS_Data.idl file . and error occured. it's report imformation likes below. please give me a help! #398

Open senses1 opened 2 months ago

senses1 commented 2 months ago

/home/people/Fast-DDS-Gen-master/scripts# ./fastddsgen ./DDS_Data.idl openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04) OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing) Processing the file DDS_Data.idl... ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

JesusPoderoso commented 2 months ago

Hi @senses1, thanks for your report. Which Fast DDS-Gen version are you using? And which Linux distribution? Could you share the .idl file content? Thanks!

senses1 commented 2 months ago

openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04) OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing) fastddsgen version 4.0.0

IDL content is below: `// 激光雷达数据 struct LaserData { sequence ranges; sequence intensity; unsigned long long time_stamp; };

//机器人位姿 struct RobotPose { float pose_x; float pose_y; float pose_theta; };

//机器人轮速 struct WheelSpeed { unsigned long speed_l; unsigned long speed_r; };

//机器人速度 struct Velocity { // 线速度 float v; // 角速度 float w; };

//机器人码盘值 struct Encoder { // 左 unsigned long enc_l; // 右 unsigned long enc_r; };

// 车体参数 struct RobotParams { //使用地图id unsigned long map_id; //机器人位姿 RobotPose pose; //机器人轮速 WheelSpeed robot_speed; //激光避停状态 boolean laser_blocking; //电池充电次数 unsigned long charge_cycles; //车体工作时长 unsigned long working_time; //车体当前运行模式 ,auto/manual unsigned long moving_status; };`

senses1 commented 2 months ago

addtionally 1 I removed all comments . 2 I removed all comments and left only one struct of any one . it sttill report this information.

JesusPoderoso commented 2 months ago

Hi @senses1, I could not reproduce your issue, but your idl is malformed. Mind that the sequence needs to be followed by the data type (check the sequence section of Fast DDS-Gen documentation). Once that is addressed, the code should be generated successfully.

senses1 commented 2 months ago

thanks @JesusPoderoso ,but I make the idl simple like: struct RobotPose { float pose_x; float pose_y; float pose_theta; }; it still report error: root@DESKTOP-A2ICLLO:/home/tby/Fast-DDS-Gen-master/scripts# ./fastddsgen ./DDS_Data.idl openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04) OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing) Processing the file DDS_Data.idl... ERROR: context [/struct_type /extensibility] 1:5 no such property or can't access: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied Caused by: org.stringtemplate.v4.misc.STNoSuchPropertyException: no such property: com.eprosima.fastdds.idl.parser.typecode.StructTypeCode.annotationExtensibilityNotApplied at org.stringtemplate.v4.misc.ObjectModelAdaptor.throwNoSuchProperty(ObjectModelAdaptor.java:163) at org.stringtemplate.v4.misc.ObjectModelAdaptor.getProperty(ObjectModelAdaptor.java:87) at org.stringtemplate.v4.Interpreter.getObjectProperty(Interpreter.java:1222) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:216) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.Interpreter.writeObject(Interpreter.java:755) at org.stringtemplate.v4.Interpreter.writeObjectNoOptions(Interpreter.java:687) at org.stringtemplate.v4.Interpreter._exec(Interpreter.java:291) at org.stringtemplate.v4.Interpreter.exec(Interpreter.java:151) at org.stringtemplate.v4.ST.write(ST.java:432) at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:100) at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:352) at com.eprosima.fastdds.fastddsgen.parseIDL(fastddsgen.java:867) at com.eprosima.fastdds.fastddsgen.process(fastddsgen.java:697) at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:466) at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1641)

senses1 commented 2 months ago

I move back to 2.2.1 ,it does not show this error infomation .

JesusPoderoso commented 1 month ago

Hi @senses1, have you tried to include the extensibility in your idl?

senses1 commented 1 month ago

Thanks for reply @JesusPoderoso , I had to heading to lcm lib at that time, and I would replace lcm with fastDDS when it work properly in my system.