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

Generated header guards collide #30

Closed
ipa-mdl opened this issue May 8, 2019 · 12 comments

Comments

@ipa-mdl
Copy link

commented May 8, 2019

control_msgs contains a GripperCommand action, which uses the GripperCommand msg.

For ROS2 dashing, this package (released version, 0.7.0, and master) generates C header files with duplicated guard names, e.g.

$ grep -r _GRIPPERCOMMAND__H_ .
./build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/msg/dds_opensplice/GripperCommand_.h:#ifndef _GRIPPERCOMMAND__H_
./build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/msg/dds_opensplice/GripperCommand_.h:#define _GRIPPERCOMMAND__H_
./build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/GripperCommand_.h:#ifndef _GRIPPERCOMMAND__H_
./build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/GripperCommand_.h:#define _GRIPPERCOMMAND__H_

For this reason the build fails with:

In file included from /root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/ccpp_GripperCommand_.h:4:0,
                 from /root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/gripper_command__rosidl_typesupport_opensplice_cpp.hpp:10,
                 from /root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/gripper_command__type_support.cpp:17:
/root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/GripperCommand_.h:41:37: error: ‘dds_’ in namespace ‘control_msgs::msg’ does not name a type
                ::control_msgs::msg::dds_::GripperCommand_ command_;
                                     ^~~~
/root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/gripper_command__type_support.cpp: In function ‘void control_msgs::action::typesupport_opensplice_cpp::convert_ros_message_to_dds(const __ros_msg_type_GripperCommand_Goal&, control_msgs::action::typesupport_opensplice_cpp::__dds_msg_type_GripperCommand_Goal&)’:
/root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/gripper_command__type_support.cpp:108:38: error: ‘using __dds_msg_type_GripperCommand_Goal = struct control_msgs::action::dds_::GripperCommand_Goal_ {aka struct control_msgs::action::dds_::GripperCommand_Goal_}’ has no member named ‘command_’
     ros_message.command, dds_message.command_);
                                      ^~~~~~~~
/root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/gripper_command__type_support.cpp: In function ‘void control_msgs::action::typesupport_opensplice_cpp::convert_dds_message_to_ros(const __dds_msg_type_GripperCommand_Goal&, control_msgs::action::typesupport_opensplice_cpp::__ros_msg_type_GripperCommand_Goal&)’:
/root/target_ws/build/control_msgs/rosidl_typesupport_opensplice_cpp/control_msgs/action/dds_opensplice/gripper_command__type_support.cpp:164:17: error: ‘const __dds_msg_type_GripperCommand_Goal {aka const struct control_msgs::action::dds_::GripperCommand_Goal_}’ has no member named ‘command_’
     dds_message.command_, ros_message.command);

Furthermore, JointTrajectory.action (control_msgs) collides with JointTrajectory.msg (trajectory_msgs), both use _JOINTTRAJECTORY__H_.

For ROS2 crystal the generated header guards are less likely to collide, because goal, feedback and result are generated separately. (before #11?)

To avoid this problem the guards should contain the package name and the type to make them unique.
The files in dds_opensplice get generated by idlpp though.

@dirk-thomas

This comment has been minimized.

Copy link
Member

commented May 8, 2019

The files in dds_opensplice get generated by idlpp though.

Can you please report the bug upstream.

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented May 9, 2019

Can you please report the bug upstream.

This is not necessarily a bug upstream.
You could even take care of it in the post-processing or by making the file names unique.
This is completely up to you.
I just noticed that my dashing test job started to fail recently.

@dirk-thomas

This comment has been minimized.

Copy link
Member

commented May 9, 2019

It is certainly a bug upstream. Both types have the same name but different namespaces which distinguishes them. The header guard must include the namespaces.

We could workaround the problem in post processing but would rather see this fixed upstream.

@anasarrak

This comment has been minimized.

Copy link

commented May 14, 2019

Any fix for this? I'm struggling with the same problem

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented Jun 28, 2019

This issues seems to be resolved 👍

@ipa-mdl ipa-mdl closed this Jun 28, 2019

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

This issues seems to be resolved +1

Not resolved, but rosidl_typesupport_opensplice is not part of the dashing Docker image anymore..

@dirk-thomas

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

Reopening since the problem hasn't been resolved yet.

@dirk-thomas dirk-thomas reopened this Jul 15, 2019

@MarcelJordense

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2019

@ipa-mdl Is the problem still present when using the latest OpenSplice release? When I try to build the control_msgs with the latest OpenSplice release I do not see any problems.

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

Is the problem still present when using the latest OpenSplice release?

It is still present if I install rosidl_typesupport_opensplice from the official ROS2 repository, which pulls libopensplice69 (Version: 6.9.190705+osrf1-1~bionic).
(I am not actually using OpenSplice..)

@MarcelJordense

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2019

@ipa-mdl Which version of rosidl_typesupport_opensplice are you using? It should have be resolved in dashing.

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

Which version of rosidl_typesupport_opensplice are you using? It should have be resolved in dashing.

@MarcelJordense: the latest release: ros-dashing-rosidl-typesupport-opensplice-cpp, version ros-dashing-rosidl-typesupport-opensplice-cpp

I will try to come up with a Travis build

@ipa-mdl

This comment has been minimized.

Copy link
Author

commented Aug 19, 2019

@MarcelJordense:
After reinstalling ROS dashing (purge + install) it works properly.
A full upgrade and a freshly created workspace did not work.
I guess something was broken in my system.

Travis confirms that it works.

I will close this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.