Giter Club home page Giter Club logo

fast-dds-gen's Introduction

fast-dds-gen's People

Contributors

adriancampo avatar chrisfwp avatar eduponz avatar elianalf avatar fschoenm avatar ikerluengo avatar jamoralp avatar jesuspoderoso avatar jlbuenolopez avatar jsan-rt avatar mario-dl avatar miguelcompany avatar mtheall avatar pablogs9 avatar panicgh avatar raquelalvarezbanos avatar richiprosima avatar richiware avatar rsanchez15 avatar tsc21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast-dds-gen's Issues

Fast-RTPS-Gen build problems.

I have tried to build fast-rtps-gen v1.0.4 and had the same problem reported in #31. The instructions at https://dev.px4.io/master/en/setup/fast-rtps-installation.html#fast-rtps-gen state:

git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 ~/Fast-RTPS-Gen \
    && cd ~/Fast-RTPS-Gen \
    && gradle assemble \
    && gradle install

After reading #31, I used the following:

git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 ~/Fast-RTPS-Gen \
    && cd ~/Fast-RTPS-Gen \
    && ./gradlew assemble \
    && ./gradlew install

This built OK but failed to install:

BUILD SUCCESSFUL in 25s
6 actionable tasks: 6 executed
> Task :install FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/andy/git/fast-rtps/Fast-RTPS-Gen/build.gradle' line: 58

* What went wrong:
Execution failed for task ':install'.
> Could not copy file '/home/andy/git/fast-rtps/Fast-RTPS-Gen/scripts/fastrtpsgen' to '/usr/local/bin/fastrtpsgen'.
   > /usr/local/bin/fastrtpsgen (Permission denied)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 535ms
1 actionable task: 1 executed

As I need to get something working quickly, I updated my script to manually copy the files I think I need:

    cd ${FAST_RTPS_GEN_DIR}
    ./gradlew assemble
    # ./gradlew install
    sudo mkdir -p /usr/local/share/fastrtps/
    sudo cp -f ./share/fastrtpsgen/java/fastrtpsgen.jar /usr/local/share/fastrtps/
    sudo cp -f scripts/fastrtpsgen /usr/local/bin/

Please fix the problem with the installation and then update the instructions to use the ./gradlew command.

gradle build failed: unmappable character (0xC3) for encoding US-ASCII [13729]

Non ascii symbol at line com/eprosima/fastdds/idl/grammar/Context.java:283 causes gradel build failure

# gradle build

> Task :submodulesUpdate
Submodule path 'thirdparty/idl-parser': checked out '69a469c48ca0456a32b4eeea28aed8d58fa82845'

> Task :compileJava
/root/workspace/Fast-DDS-Gen/src/main/java/com/eprosima/fastdds/idl/grammar/Context.java:283: error: unmappable character (0xC3) for encoding US-ASCII
    // TODO Lleva la cuenta de generaci??n de nuevos nombres.
                                       ^
/root/workspace/Fast-DDS-Gen/src/main/java/com/eprosima/fastdds/idl/grammar/Context.java:283: error: unmappable character (0xB3) for encoding US-ASCII
    // TODO Lleva la cuenta de generaci??n de nuevos nombres.

Warning for deprecated features in Gradle [13722]

Using Gradle 6.2, I get the following warning when using assemble or build:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

Using --warning-mode all indicates what are the deprecated features. I did some changes on build.gradle and could easily fix some of those, but there are also a lot in the IDL-Parse.

It might be reasonable to fix those eventually.

fastddsgen -python option can't find template module.st [13638]

Every time I use the fastddsgen -python option I get the following error :

ERROR: Can't find template module.st; group hierarchy is [FastCdrCommon]
Exception in thread "main" java.lang.NullPointerException
at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:401)
at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1474)

I didn't see the module.st anywhere in the eProsima Fast DDS v2.5.0 installation.

I get the same error on both Ubuntu v20.04.3 and Win10 21H2 on same dual boot laptop. Both with Fast DDS v2.5.0.

Fastddsgen works fine on both installations without the -python option.

Originally posted by @webhoppery in eProsima/Fast-DDS#2444

error: Illegal identifier: geometry_msgs::msg::accel is already defined

I am using 1.0.4. When I generated code with the attached idl files, I got an error

vincent@vincent-VirtualBox:/mnt/ramdisk$ fastrtpsgen geometry_msgs/msg/*.idl
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-2ubuntu218.04, mixed mode, sharing)
Loading templates...
Processing the file geometry_msgs/msg/Accel.idl...
Generating Type definition files...
Generating TopicDataTypes files...
Adding project: geometry_msgs/msg/Accel.idl
Processing the file geometry_msgs/msg/AccelStampednh.idl...
geometry_msgs/msg/AccelStampednh.idl:25:35: error: Illegal identifier: geometry_msgs::msg::accel is already defined (Type: geometry_msgs::msg::Accel=com.eprosima.idl.parser.tree.TypeDeclaration@6b26e945)
Exception in thread "main" java.lang.NullPointerException
	at com.eprosima.fastrtps.fastrtpsgen.execute(fastrtpsgen.java:343)
	at com.eprosima.fastrtps.fastrtpsgen.main(fastrtpsgen.java:1207)

geometry_msgs.zip

fastrtpsgen: no viable alternative at input 'struct Object' [13727]

fastrtpsgen seems unable to handle calling a struct Object. Renaming the struct to something else e.g. Object1 works.

I have the following IDL file:

module pk_msgs {
    module msg {
        struct Object {
            int64 id;
        };
    };
};

Trying to generate code for this IDL file shows the following error:

openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
Loading templates...
Processing the file obj.idl...
obj.idl:3:15: error: no viable alternative at input 'struct Object'
obj.idl:7:0: error: Unexpected input '}'
Exception in thread "main" java.lang.NullPointerException
        at com.eprosima.fastrtps.fastrtpsgen.execute(fastrtpsgen.java:343)
        at com.eprosima.fastrtps.fastrtpsgen.main(fastrtpsgen.java:1207)

fastrtpsgen is version 1.0.4.

openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
fastrtpsgen version 1.0.4

Steps to Reproduce

  1. Use the IDL file above.
  2. Call fastrtpsgen -d output obj.idl
  3. Observe error.
  4. Rename Object to something else, e.g. Object1 and repeat the steps without error.

System information

  • Fast-RTPS version: n/a
  • OS: Ubuntu 20.04.1
  • Network interfaces: n/a
  • ROS2: n/a

gradle assemble fails on line 94 [13732]

Just cloned Fast-DDS-Gen and tried to compile with gradle.assemble.
It gets to line 94 of build.gradle and is missing file in thirdparty/idl-parser/build/libs/idlparser-1.0.0.jar
I thought i followed directions on installing fast-dds-gen, but obviously i'm missing something.
Any help would be appreciated.
Thanks
Connie

Maps should support non-primitive types [13386]

when i try following idl file:

struct nest
{
    double y;
    double x;
};

struct AsyncCommand
{
    string app_id;
    string command;
    map<string, double> parameters;
    map<string, nest> parameters1;
};

i get the error:

ERROR<Exception>: no such attribute: typeCodeMapElement in template context [struct_type if(ctx.anyCdr)_subtemplate anonymous if(!member.annotationNonSerialized)_subtemplate max_serialized_size elseif(typecode.isMapType)_subtemplate map_max_serialized_size map_max_serialized_size_element]

Originally posted by @hehenihao in #50 (comment)

Issue with sequence<T_Char> not being sent when it reaches length 101...

We are trying to implement strings as sequence<T_Char> and have issues with the DataWriter returning false and not seeing the message being recieved by the subscriber.

To demonstrate the issue we created a test IDL file:

typedef char T_Char;
typedef sequence<T_Char> T_Payload;
struct I_Kit_Logging {
  T_Payload A_payload;
};

Using this IDL we generated an example application using fastrtpsgen -example (v.1.0.4). We then added the code to encode strings and decode (on subscriber). The resulting example is on Github (https://github.com/ross-newman/fastdds-vector-limit).

The Publisher always retunrs false (https://github.com/ross-newman/fastdds-vector-limit/blob/master/testPublisher.cxx Line 110) when the number of chars reaches 101. This seems to be a limit? Is there a QoS setting we need to modify? Have reviewed the defaults but cant not find a setting that would limit the size of the vector?

Installation Fast-RTPS-Gen [13584]

Following this guideline https://dev.px4.io/master/en/setup/fast-rtps-installation.html, when I execute sudo gradle install, I get the following error:

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/droneuser/Fast-RTPS-Gen/build.gradle' line: 23

  • What went wrong:
    Could not compile build file '/home/droneuser/Fast-RTPS-Gen/build.gradle'.

startup failed:
build file '/home/droneuser/Fast-RTPS-Gen/build.gradle': 23: unable to resolve class org.gradle.api.tasks.options.Option
@ line 23, column 1.
import org.gradle.api.tasks.options.Option;
^

1 error

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

fastrtpsgen -example x64Linux2.6gcc <path/to/file.idl> returns error status 255

For the following IDL file (position_setpoint_triplet.idl):

#ifndef __position_setpoint_triplet__idl__
#define __position_setpoint_triplet__idl__

#include "position_setpoint.idl"

struct position_setpoint_triplet
{
    unsigned long long timestamp_;
    position_setpoint previous_;
    position_setpoint current_;
    position_setpoint next_;

}; // struct position_setpoint_triplet

#pragma keylist position_setpoint_triplet

#endif  // __position_setpoint_triplet__idl__

where position_setpoint.idl has the following stucture:

#ifndef __position_setpoint__idl__
#define __position_setpoint__idl__

const octet position_setpoint__SETPOINT_TYPE_POSITION = 0;
const octet position_setpoint__SETPOINT_TYPE_VELOCITY = 1;
const octet position_setpoint__SETPOINT_TYPE_LOITER = 2;
const octet position_setpoint__SETPOINT_TYPE_TAKEOFF = 3;
const octet position_setpoint__SETPOINT_TYPE_LAND = 4;
const octet position_setpoint__SETPOINT_TYPE_IDLE = 5;
const octet position_setpoint__SETPOINT_TYPE_OFFBOARD = 6;
const octet position_setpoint__SETPOINT_TYPE_FOLLOW_TARGET = 7;
const octet position_setpoint__VELOCITY_FRAME_LOCAL_NED = 1;
const octet position_setpoint__VELOCITY_FRAME_BODY_NED = 8;


struct position_setpoint
{
    unsigned long long timestamp_;
    boolean valid_;
    octet type_;
    float x_;
    float y_;
    float z_;
    boolean position_valid_;
    float vx_;
    float vy_;
    float vz_;
    boolean velocity_valid_;
    octet velocity_frame_;
    boolean alt_valid_;
    double lat_;
    double lon_;
    float alt_;
    float yaw_;
    boolean yaw_valid_;
    float yawspeed_;
    boolean yawspeed_valid_;
    octet landing_gear_;
    float loiter_radius_;
    octet loiter_direction_;
    float pitch_min_;
    float a_x_;
    float a_y_;
    float a_z_;
    boolean acceleration_valid_;
    boolean acceleration_is_force_;
    float acceptance_radius_;
    float cruising_speed_;
    float cruising_throttle_;
    boolean allow_weather_vane_;

}; // struct position_setpoint

#pragma keylist position_setpoint

#endif  // __position_setpoint__idl__

I am getting a status error of 255 when running fastrtpsgen -example x64Linux2.6.gcc for the position_setpoint_triplet.idl file, which is not really verbose.

@LuisGP @raquelalvarezbanos is there a way of verifying what exactly is causing this error? I am not even sure if this is on the Fast-RTPS-Gen or in the IDLParser. Thanks in advance!

fastrtpsgen -version returns 0.0.0 [6488]

After building using gradle assemble and copied both fastrtpsgen script and fastrtpsgen.jar to /usr/local/bin/ and /usr/local/share/fastrtps/ respectively, using fastrtpsgen -version returns:

openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
fastrtpsgen version 0.0.0

"./gradlew assemble" command fails

I got following error when executing ./gradlew assemble as instructed in the installation documentation for MacOS

% ./gradlew assemble

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Fast-DDS-Gen'.
> Could not open proj remapped class cache for dl8f7ksixylcrg4me6p85bu6p (/Users/mahmutdemir/.gradle/caches/6.4/scripts-remapped/build_294dif05r7s7jee5f380flnql/dl8f7ksixylcrg4me6p85bu6p/projec1525274270c23312956132134b4620).
   > Could not open proj generic class cache for build file '/Users/mahmutdemir/Fast-DDS/Fast-DDS-Gen/build.gradle' (/Users/mahmutdemir/.gradle/caches/6.4/scripts/dl8f7ksixylcrg4me6p85bu6p/proj/projec1525274270c23312956132134b4620).
      > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 487ms

fastrtpsgen generates fixed getMaxCdrSerializedSize for strings and sequences

Let's take a look at HelloWorld.idl

struct HelloWorld
{
    string msg;
    char a[1024];
    sequence<char> msg2;
};

And now let's take a look at getMaxCdrSerializedSize

size_t HelloWorld::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    // probably string, implicitly 255 bytes plus probably '\0'
    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1;

    // definitely char array
    current_alignment += ((1024) * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    // probably vector size
    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);

    // probably vector itself, max 100 elements
    current_alignment += (100 * 1) + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);

    return current_alignment - initial_alignment;
}

That's called only in HelloWorldPubSubType

HelloWorldPubSubType::HelloWorldPubSubType()
{
    setName("HelloWorld");
    m_typeSize = static_cast<uint32_t>(HelloWorld::getMaxCdrSerializedSize()) + 4 /*encapsulation*/;
    ... 
}

Since there are these lines about m_typeSize in a doxygen

Maximum serialized size of the type in bytes.
If the type has unbounded fields, and therefore cannot have a maximum size, use 0.

I suppose codegen is a bit outdated or there is another reason I know nothing about.

Please clarify if it's an error or not, will it be fixed soon or not, should I bother with PR if you have more important things to do or not.

Strings as keys in IDL maps

After the modification fastrtpsgen kindly offered in
https://github.com/eProsima/Fast-RTPS-Gen/tree/feature/complex_key_map
we have found:

  • one line is missing in grade.build to generate the "share" folder:
    destinationDir = file(new File(projectDir, 'share/fastrtpsgen/java'))
  • in the new code in "else" remained preventing the execution of the new functionality.
  • although after changing that the same error persists:

scripts/fastrtpsgen prueba.idl -replace
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
Loading templates...
Processing the file prueba.idl...
ERROR: Class com.eprosima.idl.parser.typecode.StringTypeCode has no such attribute: size in template context [struct_type if(ctx.anyCdr)_subtemplate anonymous if(!member.annotationNonSerialized)_subtemplate max_serialized_size elseif(typecode.isMapType)_subtemplate map_max_serialized_size]
java.lang.NoSuchFieldException: size
at java.base/java.lang.Class.getField(Class.java:1999)
at org.antlr.stringtemplate.language.ASTExpr.rawGetObjectProperty(ASTExpr.java:524)
at org.antlr.stringtemplate.language.ASTExpr.getObjectProperty(ASTExpr.java:416)
at org.antlr.stringtemplate.language.ActionEvaluator.attribute(ActionEvaluator.java:351)
at org.antlr.stringtemplate.language.ActionEvaluator.expr(ActionEvaluator.java:136)
at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:84)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
at org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ConditionalExpr.writeSubTemplate(ConditionalExpr.java:152)
at org.antlr.stringtemplate.language.ConditionalExpr.write(ConditionalExpr.java:113)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
at org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ConditionalExpr.writeSubTemplate(ConditionalExpr.java:152)
at org.antlr.stringtemplate.language.ConditionalExpr.write(ConditionalExpr.java:103)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:722)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:742)
at org.antlr.stringtemplate.language.ASTExpr.writeAttribute(ASTExpr.java:659)
at org.antlr.stringtemplate.language.ActionEvaluator.action(ActionEvaluator.java:86)
at org.antlr.stringtemplate.language.ASTExpr.write(ASTExpr.java:148)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.language.ConditionalExpr.writeSubTemplate(ConditionalExpr.java:152)
at org.antlr.stringtemplate.language.ConditionalExpr.write(ConditionalExpr.java:103)
at org.antlr.stringtemplate.StringTemplate.write(StringTemplate.java:700)
at org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java:1635)
at org.antlr.stringtemplate.StringTemplate.toString(StringTemplate.java:1626)
at com.eprosima.idl.generator.manager.TemplateGroup.setAttribute(TemplateGroup.java:90)
at com.eprosima.idl.parser.grammar.IDLParser.specification(IDLParser.java:331)
at com.eprosima.fastrtps.fastrtpsgen.parseIDL(fastrtpsgen.java:602)
at com.eprosima.fastrtps.fastrtpsgen.process(fastrtpsgen.java:495)
at com.eprosima.fastrtps.fastrtpsgen.execute(fastrtpsgen.java:334)
at com.eprosima.fastrtps.fastrtpsgen.main(fastrtpsgen.java:1199)

It looks likes the class StringTypeCode does not implement the function size(), neither the class StructTypeCode implements getSize()

Thanks

error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’ [7963]

FAST RTPS version: 1.8.2
FAST RTPS GEN version: 1.0.2

Expected Behavior

Running ... should work
PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;

For this file: 'Firmware/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent/adc_report_Publisher.cpp'

Current Behavior

code fails with: error: ‘class eprosima::fastrtps::rtps::BuiltinAttributes’ has no member named ‘discovery_config’

Steps to Reproduce

  1. Setting up Firmware environment: https://dev.px4.io/master/en/setup/dev_env_linux_ubuntu.html
  2. Install FAST RTSP and FAST RTPS GEN from Sources: https://dev.px4.io/master/en/setup/fast-rtps-installation.html
  3. Follow steps from: https://dev.px4.io/master/en/middleware/micrortps.html

make px4_sitl_rtps

cd Firmware/build/px4_sitl_rtps/src/modules/micrortps_bridge/micrortps_client/micrortps_agent

mkdir build && cd build

cmake ..

make

System information

  • Fast-RTPS version: 1.8.2
  • OS: Ubuntu 18.04
  • Network interfaces: As given in link (UDP interface for SITL target)
  • Ros1: Melodic
  • ROS2: Dashing

Strings not working with map [12537]

When I try to generate the cxx and h files from the next idl:

struct AsyncCommand
{
    string app_id;
    string command;
    map<string, double> parameters;
};

I get the following error:

...
ERROR: Class com.eprosima.idl.parser.typecode.StringTypeCode has no such attribute: size in template context [struct_type if(ctx.anyCdr)_subtemplate anonymous if(!member.annotationNonSerialized)_subtemplate max_serialized_size elseif(typecode.isMapType)_subtemplate map_max_serialized_size]
...

But not getting the error when not using string in the map:

struct AsyncCommand
{
    string app_id;
    string command;
    map<double, double> parameters;
};

Fast DDS Gen Multidimensional Array Publication - Issues with serialization/deserialization [13726]

We are currently working on a distributed service supported by eprosima FastDDS (tag v2.0.0)/FastDDSGen and we are having issues with a particular IDL message that we have created. The IDL message contains a 2D array of enums and is defined generally as follows:

   enum T_Occupancy
   {
      UNKNOWN,
      OCCUPIED,
      FREE
   };
   struct Occupancy_Map
   {
      T_Occupancy A_map[256][256];
   };

Expected Behavior

We have a conventional pub-sub set up (based on eprosima pub-sub examples) for the IDL topic and we have a unit test that does integrity checks on the received message to make sure the 2D array map is successfully serialized/deserialized. We set up an array to be published which is filled with enums and publish it. At the subscriber end in the onData event, we receive it into the data member of the SubListener and walk over the rows (row-major order) and columns of the std::array<std::array<T_Occupancy, 256>, 256> to ensure that they are equal to the map that was sent. We expect that all singular elements of the 2D array that was received to be equal to that which was sent.

Current Behavior

At the receiving end, we find that all of the elements for the first row are correct and as they should be, but subsequent rows are being wiped to 0. If we flatten the array in the IDL definition, it fixes the problem and all of the data gets sent appropriately. We believe this is due to how the serialization function works that is generated from Fast DDS Gen. That is to say that the call to serialize the array in the generated serialization function:

 scdr.serializeArray(reinterpret_cast<const uint32_t*>(m_A_map.data()), m_A_map.size());

which calls the following function declared/defined in Cdr.h

    /*!
    * @brief This function serializes an array of unsigned longs.
    * @param ulong_t The array of unsigned longs that will be serialized in the buffer.
    * @param numElements Number of the elements in the array.
    * @return Reference to the eprosima::fastcdr::Cdr object.
    * @exception exception::NotEnoughMemoryException This exception is thrown when trying to serialize a position that exceeds the internal memory size.
    */
inline
    Cdr& serializeArray(const uint32_t *ulong_t, size_t numElements)
    {
        return serializeArray(reinterpret_cast<const int32_t*>(ulong_t), numElements);
    }

We think this isn't correct. The size call on the outer array will return a size() of 256 which in the context of the call to serializeArray(...) will result in only the first row being serialized, which is what we see in our testing of multidimensional IDL arrays compiled with Fast-DDS-Gen. We debugged our code to the point where we were testing integrity immediately at the points of calling writer_->write(&data) and receiving at reader->take_next_sample(&map_, &info) so we are fairly sure that this is the issue. Happy to be wrong though!

Steps to Reproduce

  • Create an IDL struct containing a 2D array that holds integers (or in our case IDL defined enums).
  • Create a simple pub sub for the IDL topic, use Fast DDS Gen (2.0.0) to generate C++ code.
  • Instantiate the publisher and publish an array with dummy data (keep the published datatype variable for equality checks).
  • In the subscriber check received array for equality with sent array, i.e. walk over the 2D array element by element and check for equality.

System information

  • OS: Ubuntu 18.04
  • Fast-DDS-Gen version: 2.0.0
  • Fast-DDS version: 2.0.0
  • Network: localhost/shared memory interface

Problem with constants and namespace [13731]

Could be that fastddsgen generates code that it does not properly handle namespace (IDL module names) and constant

Expected Behavior

The generated code should add module (namespace) name to the constant.

Current Behavior

The generated code uses constant w/o namespace

Steps to Reproduce

Please use the following idl file:

module ExampleNs {
const unsigned long N_X = 25;

struct HelloWorld {
unsigned long index;
string message;

char ex[N_X];

};
};

  1. generated the code:
    fastddsgen -replace -example CMake HelloWorld.idl

  2. try to build code using cmake and make

You should get smth like:
make
[ 14%] Building CXX object CMakeFiles/HelloWorld_lib.dir/HelloWorld.cxx.o
/MyPath/Fast-DDS-app/HelloWorld.cxx:244:24: error: ‘N_X’ was not declared in this scope; did you mean ‘ExampleNs::N_X’?
244 | const std::array<char, N_X>& ExampleNs::HelloWorld::ex() const
| ^~~
| ExampleNs::N_X

System information

  • fastddsgen version 2.0.0
  • OS: Linux (CentOS 7 & 8)

'fastrtpsgen -version' just works correctly the second time gradle assembles

Steps to reproduce:

  1. Clone Fast-RTPS-Gen
  2. gradle assemble
  3. Set PATH (PATH=$PATH..../Fast-RTPS-Gen/scripts)
  4. Running fastrtpsgen -version returns:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
ERROR: Getting version. null
  1. If issuing gradle assemble a second time and running fasrtpsgen -v, it now works:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
fastrtpsgen version 1.0.0

Is there an explanation for this?

BTW, this is running on a Ubuntu Bionic docker container, with Gradle 5.6.2 and JDK 1.8 installed in it. More specifically: https://github.com/PX4/containers/blob/master/docker/px4-dev/Dockerfile_base-bionic

DDS XTypes and @optional [13735]

Hi,

I’m looking to use FastDDS to write some microservices and need to utilize the @optional IDL annotation and the corresponding optional functionality described in DDS XTypes (e.g., 7.2.1.3, 7.4.1, 7.4.1.2, 7.5.1.2.4.2 of DDX-XTypes v 1.3). As far as I can tell, based on documentation here and my own experiments, FastDDS version 2.3 does not support this functionality. Is this there a plan to add @optional in a future release? If so, is there an estimated timeline?

Thanks.

Geoff Goehle

Include guard issue - include guards are being created based on the file name but don't include anything about the path, creating conflicts when using two files with the same name [13730]

We have two IDLs with the same name but different namespaces:

e.g.
one_project/a_folder/SomeThing.idl
one_project/b_folder/SomeThing.idl

Using the FastDDSGen tool we have seen that the generated code is actually creating matching include guards because the include guards are just based on the file name.

Can this be patched to generate the include guards using the folder the IDL is in or some additional information to distinguish between two IDLs with matching names and different contents?

eProsima Apache license header on all generated code? [13736]

(apologies if this has been discussed before, I could not find a relevant (closed) issue on the tracker)

It seems files generated by the code generator are all (?) given the following header:

// Copyright 20XX Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

While for open-source projects that would be OK, it seems strange for all generated code to fall under eProsima's copyright, let alone putting all generated code under the Apache license, unconditionally.

Was this done for a particular reason, or is this just a case of "template has this header, template gets copied, final output has this header"?

FastDDSGen autogenerate ROS2 Service scripts? [13738]

So I currently know you can use fastddsgen -typeros2 -example CMake Message.idl to generate a FastDDS publisher and subscriber that can then interact with ROS2 topics of the same message type.

However, I would like to do the same but with ROS2 services instead of ROS2 topics. In this other repo, there are files that are similar to the generated FastDDSGen files, but for services. Is there a command with FastDDSGen or another tool that will autogenerate these files that will allow me to interact with ROS2 services? (I would rather not use the Integration Service as I would like more direct communication as opposed to this added layer.)

fastddsgen hang when using two -I options pointing to the same folder [13740]

The following command uses -I options both pointing to the same "other" folder
fastddsgen -replace -cs -I base/ -I other/ -I /home/eltdev/tmp/fastddsgen_bug/other/ sub/IcdTypesComplexTest.idl

It cases the tool to hang.

Patch applied to resolve the issue:

 .../java/com/eprosima/fastdds/fastddsgen.java | 37 ++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/main/java/com/eprosima/fastdds/fastddsgen.java b/src/main/java/com/eprosima/fastdds/fastddsgen.java
index 48f3a1e..d193251 100644
--- a/src/main/java/com/eprosima/fastdds/fastddsgen.java
+++ b/src/main/java/com/eprosima/fastdds/fastddsgen.java
@@ -40,8 +40,12 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.IOError;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.nio.file.InvalidPathException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
@@ -281,7 +285,10 @@ public class fastddsgen
             {
                 if (count < args.length)
                 {
-                    m_includePaths.add("-I".concat(args[count++]));
+                    String pathStr = args[count++];
+                    if (!isIncludePathDuplicated(pathStr)) {
+                        m_includePaths.add("-I".concat(pathStr));
+                    }
                 }
                 else
                 {
@@ -306,6 +313,34 @@ public class fastddsgen
 
     }
 
+    private boolean isIncludePathDuplicated(String pathToCheck) {
+        try {
+            Path path = Paths.get(pathToCheck);
+            String absPath = path.toAbsolutePath().toString();
+            boolean isDuplicateFound = false;
+            for (String includePath : m_includePaths) {
+                // include paths are prefixed with "-I"
+                if (includePath.length() <= 2) {
+                    continue;
+                }
+                String absIncludePath = Paths.get(includePath.substring(2)).toAbsolutePath().toString();
+                if (absPath.toLowerCase().equals(absIncludePath.toLowerCase())) {
+                    isDuplicateFound = true;
+                    break;
+                }
+            }
+
+            if (isDuplicateFound) {
+                return true;
+            }
+
+        } catch (InvalidPathException | IOError | SecurityException ex) {
+            // path operations failed, just returning false
+        }
+
+        return false;
+    }
+
     /*
      * ----------------------------------------------------------------------------------------
      *

Auto generated code for Inherited structure type IDL doesn't seem to work

This is a copy of the following comment:
eProsima/Fast-DDS#903 (comment)
Raising it as new as the other thread was closed already.

Hi ,
I was trying to check the sample code workign for inherited struct types in the IDL.
Though the subscriber seems to receive the data from other applications, the publisher crashes in CDR serialize(int32) with NoMemoryException.

I was wondering if it was related to the incomplete support for XCDR in serialization library.
Could you please confirm if the sample generated for the following IDL is due to this issue?

struct Msg {
@key long userID;
//@id 0
string message; //@id 1

};
//@extensibility EXTENSIBLE_EXTENSIBILITY

struct MsgExtended : Msg {
long dummy; //@id 2
};
//@extensibility EXTENSIBLE_EXTENSIBILITY
HelloWorld_IDL.txt

I made further changes in the test code (and some debug logs in Cdr.cpp too)to check if things would work but without any luck.
As the sample code itself crashes ,I am atttaching only the IDL .
Please let me know if any additional info is required.
The installation was from master. (i.e. compiled from source)

Thank you,
Viresh

Update:
Additional info:
Changes to Sample code made were:
a> change the topicKind to WITH_KEY from NO_KEY
b>Add sample data to the MsgExtended structure before publishing.

I think the keylessTopic might work but the intention was to achieve keyed topic . Ther applications in the system are using key and RTI admin console reported topic consistency error for mismatch between OSPL and FastRTPS application.

fastrtpsgen: Create/keep directory structure to be equivalent to rtiddsgen? [6239]

Hey,

We have a few IDL files in a folder structure representing their namespace structure.
A simplified example:
common/Header.idl
common/Time.idl
system/TestMessage.idl
devices/ImuMessage.idl

Now, TestMessage and ImuMessage reference the Header and Time types.
I'm passing the right -I arguments so that fastrtpsgen can find the IDL files.

Using the RTI Connext generator tool, what I get is a directory structure:
common/Header.[h|cxx]
common/Time.[h|cxx]
system/TestMessage.[h|cxx}
devices/ImuMessage.[h|cxx]

But fastrtpsgen is creating the common types inside both the system and devices folder.
That means, I get multiple definitions for Header and Type.

Is there a way to keep the directory structure and get the common types only generated once?

Is this possible without code change?

Regards,
Dom

fastddsgen.jar internal exception while generating code from idl

Running the jar file to build code from an idl file halts at an exception.

Loading templates...
Processing the file H:/Storage/Vcom3D/AMM/Projects/_CompatibilityTestingWorkspace/FastDdsCpp01/Nike.idl...
ERROR<callPreprocessor>: Cannot execute the preprocessor. Reason: Cannot run program "cl.exe": CreateProcess error=2, The system cannot find the file specified
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.eprosima.fastdds.solution.Project.getIDLIncludeFiles()" because "project" is null
        at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:343)
        at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1207)

This is from running the fastddsgen bat script.

Not sure if I built the tool corrrrectly. I working with a lack of instructions.
I cloned the repo, ran gradle build then just ran the scripts until I hit this error.

Problem when deserializing nested maps

Hello,

I am sending a nested map using the
https://github.com/eProsima/Fast-RTPS-Gen/tree/feature/complex_key_map branch that was provided a few days ago to allow strings as keys in maps.

The structure is:

  struct DotKernel {
        map<long, string> ds;
    };
    struct AworSet {
        long id;
        DotKernel dk;
    };
    struct OrMap {
        long id;
        map<long, AworSet> m;
    };

and after it is sent and deserialized, data has duplicated map values.

These are the structures sent and received:

sent: OrMap:
id: 0
Map: 0->AworSet: ID:[0], Data: [1804289383-->prueba, ]
1->AworSet: ID:[1], Data: [846930886-->prueba, ]

received: OrMap:
id: 0
Map: 0->AworSet: ID:[0], Data: [1804289383-->prueba, ]
1->AworSet: ID:[1], Data: [846930886-->prueba, 1804289383-->prueba, ]

To reproduce:

  1. save the nested map as prueba.idl
  2. fastrtpsgen prueba.idl -example CMake
  3. Add this code to send the map:
  std::map<int32_t, AworSet> nodes;
    int x = 2;
    for (int i = 0 ; i < x; ++i)
    {
        AworSet set;
        set.id(i);
        DotKernel dk;
        std::map<int, std::string> ds;
        ds.insert(std::make_pair(rand(), "prueba"));
        dk.ds(ds);
        set.dk(dk);
        nodes.insert(std::make_pair(i,set));
    }
    OrMap st;
    st.id(0);
    st.m(nodes);

    std::cout << "sent: " << st << std::endl;
    mp_publisher->write(&st);

We think that the problem might be in this method:

   template<class _K, class _T>
                    Cdr& deserialize(std::map<_K, _T> &map_t)
                    {
                        uint32_t seqLength = 0;
                        state state_(*this);

                        *this >> seqLength;
   
                        try
                        {
                            //map_t.resize(seqLength);
                            _K key;
                            _T value;
                            for (uint32_t i = 0; i < seqLength; ++i)
                            {
                                *this >> key;
                                *this >> value;
                                map_t.emplace(std::pair<_K, _T>(key, value));
                            }
                            //return deserializeArray(vector_t.data(), vector_t.size());
                        }
                        catch(eprosima::fastcdr::exception::Exception &ex)
                        {
                            setState(state_);
                            ex.raise();
                        }

                        return *this;
                    }

It looks like the variable value is re-used when the maps are nested.

Thanks a lot.

Empty sequence CDR serialized size

Hi,
I'd like to clarify the expected behavior for the empty sequences CDR serialized size.

At the moment, the generated code for getCdrSerializedSize includes alignment, even if the sequence is empty:

https://github.com/eProsima/Fast-RTPS-Gen/blob/34f0a2534420762348a7c260270a3a246b9cba63/src/main/java/com/eprosima/fastcdr/idl/templates/FastCdrCommon.stg#L387

Looking at the CORBA v3.3 spec there's nothing special about arrays/sequences serialization, and hence my question:

is is the expected behavior to have an extra alignment bytes in case of an empty array or is it a bug?

Thank you,
Vasily.

FastDDS Compilation Error [13741]

Hello,

I'm trying to compile Fast-RTPS for ROS'. I installed java 11 headless and java 13 headless packages (jre and jdk packages). Then I tried to gradle assemble with gradle on the system. I got an error. When I searched the internet and said that the problem is related to gradle, I tried to compile it with the following command.

./gradlew build

This time I got another error:

> Task :submodulesUpdate
Altmodül yolu 'thirdparty/idl-parser': '1dc2c3a46421a15c9c09d86d2203be9efd9a6199' çıkışı yaptı

> Task :idl-parser:antlr4 FAILED
Exception in thread "main" java.lang.NullPointerException
        at org.antlr.v4.tool.Rule.resolveToAttribute(Rule.java:258)
        at org.antlr.v4.tool.Alternative.resolveToAttribute(Alternative.java:102)
        at org.antlr.v4.semantics.AttributeChecks.qualifiedAttr(AttributeChecks.java:121)
        at org.antlr.v4.parse.ActionSplitter.mQUALIFIED_ATTR(ActionSplitter.java:394)
        at org.antlr.v4.parse.ActionSplitter.mTokens(ActionSplitter.java:868)
        at org.antlr.v4.parse.ActionSplitter.nextToken(ActionSplitter.java:89)
        at org.antlr.v4.parse.ActionSplitter.getActionTokens(ActionSplitter.java:43)
        at org.antlr.v4.semantics.AttributeChecks.examineAction(AttributeChecks.java:108)
        at org.antlr.v4.semantics.AttributeChecks.checkAllAttributeExpressions(AttributeChecks.java:85)
        at org.antlr.v4.semantics.SemanticPipeline.process(SemanticPipeline.java:142)
        at org.antlr.v4.Tool.processNonCombinedGrammar(Tool.java:400)
        at org.antlr.v4.Tool.process(Tool.java:387)
        at org.antlr.v4.Tool.processGrammarsOnCommandLine(Tool.java:346)
        at org.antlr.v4.Tool.main(Tool.java:193)

> Task :buildIDLParser FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':idl-parser:antlr4'.
> Process 'command '/usr/lib/jvm/java-13-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUİLD FAILED in 2s
4 actionable tasks: 4 executed
19:00:56.997 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on execution history cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/5.6.2/executionHistory).
19:00:56.998 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
19:00:56.999 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
19:00:57.000 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 4 resolution results binary files in 0.002 secs
19:00:57.001 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for file hash cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/5.6.2/fileHashes)
19:00:57.001 [DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Closing cache fileHashes.bin (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/5.6.2/fileHashes/fileHashes.bin)
19:00:57.001 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on file hash cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/5.6.2/fileHashes).
19:00:57.001 [DEBUG] [org.gradle.cache.internal.DefaultPersistentDirectoryStore] VCS Checkout Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/vcs-1) has last been fully cleaned up 0 hours ago
19:00:57.001 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache VCS Checkout Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/vcs-1) was closed 0 times.
19:00:57.001 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache VCS metadata (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/thirdparty/idl-parser/.gradle/5.6.2/vcsMetadata-1) was closed 0 times.
19:00:57.002 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute build for :buildIDLParser'
19:00:57.002 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute build for :buildIDLParser' completed
19:00:57.002 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for {} from context.
19:00:57.002 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :buildIDLParser'
19:00:57.003 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :buildIDLParser' completed
19:00:57.003 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :buildIDLParser (Thread[Execution worker for ':',5,main]) completed. Took 1.84 secs.
19:00:57.003 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':': released lock on :
19:00:57.003 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.3 completed (1 worker(s) in use)
19:00:57.003 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':': released lock on root.1.3
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':',5,main]] finished, busy: 1.908 secs, idle: 0.005 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 5,5,main]] finished, busy: 0.0 secs, idle: 1.911 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 3,5,main]] finished, busy: 0.0 secs, idle: 1.913 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 12,5,main]] finished, busy: 0.0 secs, idle: 1.909 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 10,5,main]] finished, busy: 0.0 secs, idle: 1.909 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 4,5,main]] finished, busy: 0.034 secs, idle: 1.878 secs
19:00:57.004 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Daemon worker Thread 4,5,main]] finished, busy: 0.0 secs, idle: 1.908 secs
19:00:57.004 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 14,5,main]] finished, busy: 0.0 secs, idle: 1.908 secs
19:00:57.004 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 15,5,main]] finished, busy: 0.0 secs, idle: 1.908 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 13,5,main]] finished, busy: 0.0 secs, idle: 1.908 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 8,5,main]] finished, busy: 0.0 secs, idle: 1.91 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 11,5,main]] finished, busy: 0.0 secs, idle: 1.909 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 9,5,main]] finished, busy: 0.0 secs, idle: 1.91 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 6,5,main]] finished, busy: 0.0 secs, idle: 1.911 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 7,5,main]] finished, busy: 0.0 secs, idle: 1.911 secs
19:00:57.003 [DEBUG] [org.gradle.execution.plan.DefaultPlanExecutor] Execution worker [Thread[Execution worker for ':' Thread 2,5,main]] finished, busy: 0.0 secs, idle: 1.913 secs
19:00:57.005 [DEBUG] [org.gradle.execution.taskgraph.DefaultTaskExecutionGraph] Timing: Executing the DAG took 1.917 secs
19:00:57.005 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
19:00:57.005 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed
19:00:57.006 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
19:00:57.006 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 4: released lock on root.1
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':idl-parser:antlr4'.
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command '/usr/lib/jvm/java-13-openjdk-amd64/bin/java'' finished with non-zero exit value 1
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] 
19:00:57.006 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
19:00:57.007 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] 
19:00:57.007 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUİLD FAILED in 3s
19:00:57.007 [LIFECYCLE] [org.gradle.internal.buildevents.TaskExecutionStatisticsReporter] 4 actionable tasks: 2 executed, 2 up-to-date
19:00:57.007 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run build'
19:00:57.007 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run build' completed
19:00:57.012 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for file content cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/fileContent)
19:00:57.012 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on file content cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/fileContent).
19:00:57.013 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for Build Output Cleanup Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/buildOutputCleanup)
19:00:57.013 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on Build Output Cleanup Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/buildOutputCleanup).
19:00:57.013 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for execution history cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/executionHistory)
19:00:57.013 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on execution history cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/executionHistory).
19:00:57.014 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for cache directory md-supplier (/home/lorentrs/.gradle/caches/5.6.2/md-supplier)
19:00:57.014 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cache directory md-supplier (/home/lorentrs/.gradle/caches/5.6.2/md-supplier).
19:00:57.015 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for cache directory md-rule (/home/lorentrs/.gradle/caches/5.6.2/md-rule)
19:00:57.015 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on cache directory md-rule (/home/lorentrs/.gradle/caches/5.6.2/md-rule).
19:00:57.016 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
19:00:57.016 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.CachedStoreFactory] Resolution result cache closed. Cache reads: 0, disk reads: 0 (avg: 0.0 secs, total: 0.0 secs)
19:00:57.016 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory] Deleted 2 resolution results binary files in 0.0 secs
19:00:57.017 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopping 0 deployment handles
19:00:57.017 [DEBUG] [org.gradle.deployment.internal.DefaultDeploymentRegistry] Stopped deployment handles
19:00:57.017 [DEBUG] [org.gradle.cache.internal.LockOnDemandCrossProcessCacheAccess] Releasing file lock for file hash cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/fileHashes)
19:00:57.017 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on file hash cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/fileHashes).
19:00:57.018 [DEBUG] [org.gradle.cache.internal.DefaultPersistentDirectoryStore] VCS Checkout Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/vcs-1) has last been fully cleaned up 0 hours ago
19:00:57.018 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache VCS Checkout Cache (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/vcs-1) was closed 0 times.
19:00:57.018 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache VCS metadata (/home/lorentrs/px4_ros_com_ros2/ext/Fast-RTPS-Gen/.gradle/5.6.2/vcsMetadata-1) was closed 0 times.
19:00:57.020 [DEBUG] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] The daemon has finished executing the build.
19:00:57.076 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientInputForwarder] Dispatching close input message: org.gradle.launcher.daemon.protocol.CloseInput@595d6241
19:00:57.076 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 24: dispatching class org.gradle.launcher.daemon.protocol.CloseInput
19:00:57.079 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Received result Success[value=org.gradle.launcher.exec.BuildActionResult@3243b914] from daemon DaemonInfo{pid=2364, address=[b766a7ce-3a88-4cbe-bf59-145fafcad50d port:42327, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], state=Idle, lastBusy=1640102170664, context=DefaultDaemonContext[uid=9921258e-221e-4277-b5c8-dcd5ed98d696,javaHome=/usr/lib/jvm/java-13-openjdk-amd64,daemonRegistryDir=/home/lorentrs/.gradle/daemon,pid=2364,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=TR,-Duser.language=tr,-Duser.variant]} (build should be done).
19:00:57.079 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: dispatching class org.gradle.launcher.daemon.protocol.Finished
19:00:57.079 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClientConnection] thread 1: connection stop

I installed all dependencies. what could be the problem. Thank you for helping out.

'gradle build' fails on test stage

Issuing gradle build fails on the test phase with the following error code:

> Task :test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> Process 'Gradle Test Executor 7' finished with non-zero exit value 255
  This problem might be caused by incorrect test process configuration.
  Please refer to the test execution section in the User Manual at https://docs.gradle.org/6.2/userguide/java_testing.html#sec:test_execution

Using:

test {
    useTestNG()
}

works without any error. I assume that for JUnit it might be missing some configurations.

@LuisGP @richiware FYI.

Use Gradle Wrapper instead of system Gradle for Java

Most Java project use the Gradle Wrapper in order to perform builds. The wrapper is a small downloader provided by gradle, and helps ensure that the same gradle version is used for all builds. In addition, it makes it so gradle doesn't need to be installed on the target system. It is their recommendation to use it to make builds easier and more repeatable.

Would you be willing to accept a PR that moves to that? It's just 3 small files, and would help make the Java portion of the build much easier.

FAILURE: Build failed with an exception at build.gradle line: 23

I have tryed to build release v1.0.4 in a Dockercontainer with:

git clone \
 		--branch ${TAG_FASTRTPSGEN} 	--recursive \
 		https://github.com/eProsima/Fast-RTPS-Gen.git && \
 	cd Fast-RTPS-Gen && \
 	gradle assemble && \
 	mkdir /usr/local/share/fastrtpsgen/ && \
 	mv scripts/ /usr/local/share/fastrtpsgen/ && \
 	mv share/ /usr/local/share/fastrtpsgen/

and got this error message:

Cloning into 'Fast-RTPS-Gen'...
Note: checking out '56044ae7c493834f4789893a360c6df28642691e'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Submodule 'thirdparty/idl-parser' (https://github.com/eProsima/IDL-Parser.git) registered for path 'thirdparty/idl-parser'
Cloning into '/opt/build/Fast-RTPS-Gen/thirdparty/idl-parser'...
Submodule path 'thirdparty/idl-parser': checked out '1dc2c3a46421a15c9c09d86d2203be9efd9a6199'
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '/opt/build/Fast-RTPS-Gen/build.gradle' line: 23

* What went wrong:
Could not compile build file '/opt/build/Fast-RTPS-Gen/build.gradle'.
> startup failed:
  build file '/opt/build/Fast-RTPS-Gen/build.gradle': 23: unable to resolve class org.gradle.api.tasks.options.Option
   @ line 23, column 1.
     import org.gradle.api.tasks.options.Option;
     ^
  
  1 error


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
The command returned a non-zero code: 1

What is going wrong here?

You can reproduce this by using the Dockerfile in https://github.com/Alex031544/docker_fastrtps with this arguments set:

ARG TAG_DEBIAN='10-slim'
ARG TAG_FASTRTPS='v1.10.0'
ARG TAG_FASTCDR='v1.0.13'
ARG TAG_FASTRTPSGEN='v1.0.4'
ARG TAG_FOONATHAN='v0.5.0'

and then using the build script.

fastddsgen does not process @key annotation correctly [11563]

Hi,

Using fastddsgen version 2.0.0, which I compiled from the FastDDS 2.3 source code provided at eprosima.com the @key annotation does not produce the correct key serialization code. Using the following IDL

struct HelloWorld
{
    @key unsigned long index;
    string message;
};

the following HelloWorld.cxx file is produced

// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file HelloWorld.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace {
char dummy;
}  // namespace
#endif  // _WIN32

#include "HelloWorld.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

HelloWorld::HelloWorld()
{
    // m_index com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3d8314f0
    m_index = 0;
    // m_message com.eprosima.idl.parser.typecode.StringTypeCode@2a40cd94
    m_message ="";

}

HelloWorld::~HelloWorld()
{


}

HelloWorld::HelloWorld(
        const HelloWorld& x)
{
    m_index = x.m_index;
    m_message = x.m_message;
}

HelloWorld::HelloWorld(
        HelloWorld&& x)
{
    m_index = x.m_index;
    m_message = std::move(x.m_message);
}

HelloWorld& HelloWorld::operator =(
        const HelloWorld& x)
{

    m_index = x.m_index;
    m_message = x.m_message;

    return *this;
}

HelloWorld& HelloWorld::operator =(
        HelloWorld&& x)
{

    m_index = x.m_index;
    m_message = std::move(x.m_message);

    return *this;
}

size_t HelloWorld::getMaxCdrSerializedSize(
        size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + 255 + 1;


    return current_alignment - initial_alignment;
}

size_t HelloWorld::getCdrSerializedSize(
        const HelloWorld& data,
        size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4) + data.message().size() + 1;


    return current_alignment - initial_alignment;
}

void HelloWorld::serialize(
        eprosima::fastcdr::Cdr& scdr) const
{

    scdr << m_index;
    scdr << m_message;

}

void HelloWorld::deserialize(
        eprosima::fastcdr::Cdr& dcdr)
{

    dcdr >> m_index;
    dcdr >> m_message;
}

/*!
 * @brief This function sets a value in member index
 * @param _index New value for member index
 */
void HelloWorld::index(
        uint32_t _index)
{
    m_index = _index;
}

/*!
 * @brief This function returns the value of member index
 * @return Value of member index
 */
uint32_t HelloWorld::index() const
{
    return m_index;
}

/*!
 * @brief This function returns a reference to member index
 * @return Reference to member index
 */
uint32_t& HelloWorld::index()
{
    return m_index;
}

/*!
 * @brief This function copies the value in member message
 * @param _message New value to be copied in member message
 */
void HelloWorld::message(
        const std::string& _message)
{
    m_message = _message;
}

/*!
 * @brief This function moves the value in member message
 * @param _message New value to be moved in member message
 */
void HelloWorld::message(
        std::string&& _message)
{
    m_message = std::move(_message);
}

/*!
 * @brief This function returns a constant reference to member message
 * @return Constant reference to member message
 */
const std::string& HelloWorld::message() const
{
    return m_message;
}

/*!
 * @brief This function returns a reference to member message
 * @return Reference to member message
 */
std::string& HelloWorld::message()
{
    return m_message;
}

size_t HelloWorld::getKeyMaxCdrSerializedSize(
        size_t current_alignment)
{
    size_t current_align = current_alignment;





    return current_align;
}

bool HelloWorld::isKeyDefined()
{
    return true;
}

void HelloWorld::serializeKey(
        eprosima::fastcdr::Cdr& scdr) const
{
    (void) scdr;
      
}

In particular even though isKeyDefined returns true (as it should), serializeKey doesn't actually serialize the index variable. If the @Key annotation is used then the serializeKey function is generated as

void HelloWorld::serializeKey(
        eprosima::fastcdr::Cdr& scdr) const
{
    (void) scdr;
     scdr << m_index;
       
}

fastddsgen can not handle nested module [13737]

I find that fastddsgen will report error when have three nested modules(maybe another reason?)

For example,idl like this works well:

module dds{
    module interface{
        const int32 some_val = 0x1;
    };
};

But add one module would leading error:

module dds {
    module interface {
        module test {
            const int32 some_val = 0x1;
        };
    };
};

I want to know how to solve this problem,thank you!

Error generating ROS2 idl messages [10690]

Hello everybody,
I am trying to generate structures to communicate using ros2 idl messages.
I'm able to run fastddgen for all packages except for ros2 navigation ones

The error that appears for the nav_msgs / msg / OccupancyGrid.idl message is

builtin_interfaces :: msg :: Time is already defined

I enclose the structure here

// generated from rosidl_adapter / resource / msg.idl.em
// with input from nav_msgs / msg / OccupancyGrid.msg
// generated code does not contain a copyright notice

#include "nav_msgs / msg / MapMetaData.idl"
#include "std_msgs / msg / Header.idl"

module nav_msgs {
  module msg {
    @verbatim (language = "comment", text =
      "This represents a 2-D grid map, in which each cell represents the probability of occupancy.")
    struct OccupancyGrid {
      std_msgs :: msg :: Header header;

      @verbatim (language = "comment", text =
        "MetaData for the map")
      nav_msgs :: msg :: MapMetaData info;

      @verbatim (language = "comment", text =
        "The map data, in row-major order, starting with (0,0). Occupancy" "\ n"
        "probabilities are in the range [0,100]. Unknown is -1.")
      sequence <int8> data;
    };
  };
};

You can also tell me why, for some messages are only generated the structure
Generating Type definition files ...
Generating TypeObject files ...
And not even pubsub files?

Thanks in advance

fastrtpsgen generates wrong absolute include pathes [5686]

When you use nested idl files with
#include "idltypeB.idl"
in "idltypeA.idl", the generator transforms it into:
#include "<absolute path to where the idl files are >/idltypeB.h"

If you hold the generated files in a different directory than the idl files with " -d : sets an output directory for generated files." this will fail on compile time.

Expected Behavior:
The generator should translate relative includes to relative includes.
e.g.
#include <idltypB.idl> --> #include <idltypeB.h>
From my point of view the user/developer is responsible to have all the nessesary files in its compilers include pathes.
Thanks!

Generated VS project doesn't seem to be linking deps corrently [13728]

UPDATE:
So, using the gen tool to build a x64Win64VS2015 project doesn't seem to build right a project with corrently linked libraries, but generating a CMake project does corrently link libraries and those projects build successfully.
Something is clearly up with the Windows flags on the generator.

Oen more thing: running the example project built with the gen tool that created a cmake project that was built doesn't run correctly. It runs into an issue with shared libraries. I guess I don't have something installed correctly, or the program is looking in places different from the install instructions.

Ghost@DESKTOP-G1T94C6 MINGW64 ~/Workspace/Nike-Cpp/build/Debug
$ ./Nike.exe subscriber
C:/Users/Ghost/Workspace/Nike-Cpp/build/Debug/Nike.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

UPDATE:
I have it working now with the CMake generated project. I just added all the fastdds, fastcdr, and foonathan stuff to environment varaibles, and that solved the issue with missing shared libraries. I thought the FASTDSHOME variable would have been enough, but apparently not.

=========================================================

I generated a simple IDL and used the gen tool to make a VS 2015 project.
I have foonathan_memory_vendor, fastdds, and fastcdr corrently installed on my system.
I also have env vars corrently set to these dirs, but the VS compiler cannot find header files.

/// Nike.idl
struct Messenger {
   string msg;
}

Output from building project generated by Fast-DDS-Gen

1>------ Build started: Project: NikeTypes, Configuration: Debug DLL x64 ------
1>  Nike.cxx
1>h:\storage\vcom3d\amm\projects\_compatibilitytestingworkspace\fastddscpp01\nike.cxx(28): fatal error C1083: Cannot open include file: 'fastcdr/Cdr.h': No such file or directory
2>------ Build started: Project: NikePublisherSubscriber, Configuration: Debug DLL x64 ------
2>  NikeSubscriber.cxx
2>h:\storage\vcom3d\amm\projects\_compatibilitytestingworkspace\fastddscpp01\nikesubscriber.cxx(22): fatal error C1083: Cannot open include file: 'fastdds/dds/domain/DomainParticipantFactory.hpp': No such file or directory
2>  NikePublisher.cxx
2>h:\storage\vcom3d\amm\projects\_compatibilitytestingworkspace\fastddscpp01\nikepublisher.h(26): fatal error C1083: Cannot open include file: 'fastdds/dds/domain/DomainParticipant.hpp': No such file or directory
2>  NikePubSubTypes.cxx
2>h:\storage\vcom3d\amm\projects\_compatibilitytestingworkspace\fastddscpp01\nikepubsubtypes.cxx(23): fatal error C1083: Cannot open include file: 'fastcdr/FastBuffer.h': No such file or directory
2>  NikePubSubMain.cxx
2>h:\storage\vcom3d\amm\projects\_compatibilitytestingworkspace\fastddscpp01\nikepublisher.h(26): fatal error C1083: Cannot open include file: 'fastdds/dds/domain/DomainParticipant.hpp': No such file or directory
2>  Generating Code...
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Dependenceis installed
image

Environment vars
image

VS linker input
image

Preprocessor error when fastddsgen.bat run on IDL

I used FastDDS windows installer exe VS2017 x64 to install FastDDS on my windows-10 PC
after installation completed

I tried to generate DDS support files as below using fastddsgen.bat and cmake
I am using the workplace as example folder in the installation directory

Inside FastDDSGenHelloWorld1 I have HelloWorld.idl file and the CMakeLists.txt

C:\Program Files\eProsima\fastrtps 2.3.0\examples\C++\DDS\FastDDSGenHelloWorld1>fastddsgen.bat -example CMake HelloWorld.idl
Loading templates...
Processing the file HelloWorld.idl...
ERROR: Cannot execute the preprocessor. Reason: Cannot run program "cl.exe": CreateProcess error=2, The system cannot find the file specified
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.eprosima.fastdds.solution.Project.getIDLIncludeFiles()" because "project" is null
at com.eprosima.fastdds.fastddsgen.execute(fastddsgen.java:343)
at com.eprosima.fastdds.fastddsgen.main(fastddsgen.java:1207)

IDL generated code suggestions [13724]

When looking at the IDL generated code (for example https://github.com/eProsima/Fast-DDS/blob/master/examples/C%2B%2B/Keys/sample.h) I have the following suggestions:

  • Make use of C++11 uniform initialization (see for example) https://www.geeksforgeeks.org/uniform-initialization-in-c/ to initialize all members, that way the constructor can just be default
  • Make use of the default feature for copy/move assignment/constructor, only unions need some special handling, for structs there is nothing special so the compiler default should work
  • isKeyDefined() could maybe be a std::true_type or std::false_type, see https://stackoverflow.com/questions/58694521/what-is-stdfalse-type-or-stdtrue-type and also the IDL to C++11 language mapping uses that for its IDL traits
  • destructor can be default in most cases
  • there are some static methods generated which are fastdds specific, maybe move them to a separate templated struct so they are clearly separated, the user doesn't want to see those when he looks at his idl defined type
  • this example doesn't use any array/vector, so why add includes for that to the header?
  • the class has no explicit constructor accepting values for each struct member in the order they are specified in IDL
  • there is no namespace level swap generated as defined by IDL to C++11

clang errors occuring: performance-noexcept-move-constructor, performance-move-const-arg [13733]

Hi everyone,

I am trying to build my project with clang-tidy. However, when I use the following .idl file I run into two errors.

module msgs{
  struct Vector{
    float pos[3];
    float normal[3];
  };
};
  1. error: move constructors should be marked noexcept [performance-noexcept-move-constructor,-warnings-as-errors]
    msgs::Vector::Vector(Vector &&x)
  2. error: std::move of the expression of the trivially-copyable type 'std::array<float, 3>' has no effect; remove std::move() [performance-move-const-arg,-warnings-as-errors]
    m_pos = std::move(x.m_pos);

My .clang-tidy settings are as follows:

Checks: '*'
WarningsAsErrors: 'performance-*'

fastrtpsgen version is 1.0.4.

[Feature request] Set typename by argument

In a context where standalone FastRTPS communicates with ROS2 FastRTPS, one issue that was reported many times already (ex: https://answers.ros.org/question/319723/use-ros2-fastrtps-with-standalone-fastrtps-programs/ or eProsima/Fast-DDS#829) is the fact that the generator for the PubSubTypes automatically sets the type naming from scope. Since the type naming doesn't match the type naming that ROS2 expects, this requires one to manually set the type naming in order to match the expected one. As an example, https://github.com/PX4/Firmware/blob/master/msg/templates/urtps/Publisher.cpp.em#L104-L109.

Is it possible that we can overwrite the scope name set above with some argument that we can pass when using fastrtpsgen -example? If yes, do you have the bandwidth to add that? Or can you add some pointers on how to pass that argument to the struct?

version string in build.gradle inconsistent with tags [13739]

The currently released version 2.0.2 prints 2.0.1, when executing fastddsgen -version.

Could this in the future be somehow linked to tags or checked during a build?

This could lead to confusion when the version string does not match the released version.

Union support not optimal in memory usage [13725]

The current code generation for IDL unions generates a class with for each case a plain member resulting in memory usage for all types independent of the discriminator, see for example https://github.com/eProsima/Fast-DDS/blob/6fa5e5cc8abcf506e70be203934bd3c522bd3edf/test/xtypes/idl/Types.h#L4693. This leads to a lot of memory usage when larger unions are used. This can be done much more optimized by using an union internally, see for example https://github.com/RemedyIT/idl2cpp11/blob/master/examples/union/testC.h for a possible solution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.