Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating ROS2 idl messages #389

Open
com-server-ap opened this issue Aug 1, 2024 · 2 comments
Open

Error generating ROS2 idl messages #389

com-server-ap opened this issue Aug 1, 2024 · 2 comments

Comments

@com-server-ap
Copy link

com-server-ap commented Aug 1, 2024

Hello everyone ,
I am trying to generate structures to communicate using ros2 idl messages.
fastddsgen runs fine until it encounters nav_msg/srv.
The error that appears for the nav_msgs / srv / GetMap.idl message is

/opt/ros/humble/share/nav_msgs/srv/GetMap.idl:17:35: error: Unexpected input 'map'

the GetMap.idl is below:

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

#include "nav_msgs/msg/OccupancyGrid.idl"

module nav_msgs {
  module srv {
    @verbatim (language="comment", text=
      "Get the map as a nav_msgs/OccupancyGrid")
    struct GetMap_Request {
      uint8 structure_needs_at_least_one_member;
    };
    @verbatim (language="comment", text=
      "The current map hosted by this map service.")
    struct GetMap_Response {
      nav_msgs::msg::OccupancyGrid map;
    };
  };
};

Is it possible that fastddsgen is treating the map value as a type? Or could it be due to other reasons? How can this be resolved?

reproduce step:

fastddsgen -typeros2  -I /opt/ros/humble/share/   /opt/ros/humble/share/nav_msgs/srv/GetMap.idl -cs

Thanks in advance

@MiguelCompany
Copy link
Member

map is a reserved word. You could use _map instead, and it will be generated without the underscore

@com-server-ap
Copy link
Author

com-server-ap commented Aug 2, 2024

map is a reserved word. You could use _map instead, and it will be generated without the underscore

thanks a lot , it can meet my need.

by the way,
when i generate TwistWithCovariance.idl structure,it will raise

TwistWithCovariance.idl:9:12: error: 'double' was redefined

the idl file is :

#include "Twist.idl"

module geometry_msgs {
  module msg {
    typedef double double__36[36];
    @verbatim (language="comment", text=
      " This expresses velocity in free space with uncertainty.")
    struct TwistWithCovariance {
      geometry_msgs::msg::Twist twist;

      @verbatim (language="comment", text=
        " Row-major representation of the 6x6 covariance matrix" "\n"
        " The orientation parameters use a fixed-axis representation." "\n"
        " In order, the parameters are:" "\n"
        " (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)")
      double__36 covariance;
    };
  };
};

Do you have any suggestions for solving this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants