0
$\begingroup$

Rosanswers logo

My directory structure is as recommended by the documentation:

.
├─ ros1_ws
│  └─ src
│     └─ bridge_msgs
│        └─ msg
│           └─ MyMessage.msg
├─ ros2_ws
│  └─ src
│     └─ bridge_msgs
│        ├─ msg
│           └─ MyMessage.msg
└─ bridge
   └─ src
      └─ ros1_bridge

When building, I get the following error

In file included from bridge/build/ros1_bridge/generated/get_factory.cpp:9:
bridge/build/ros1_bridge/generated/bridge_msgs_factories.hpp:13:10: fatal error: bridge_msgs/msg/my_message.hpp: No such file or directory
 #include <bridge_msgs/msg/my_message.hpp>

I inspected ros1_bridge/generated/bridge_msgs__msg__MyMessage__factories.cpp and it contains the relevant mapping (not dummy).

Also, the relevant my_message.hpp file has been generated beforehand in

./ros2_ws/install/bridge_msgs/include/bridge_msgs/msg/my_message.hpp
./ros2_ws/build/bridge_msgs/rosidl_generator_cpp/bridge_msgs/msg/my_message.hpp

I've tried multiple clean rebuilds of all workspaces, sourcing and building bridge last


Originally posted by Rufus on ROS Answers with karma: 1083 on 2020-07-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It seems before sourcing, I should clean all ROS related environment variables first. This solved my problem

unset $(env | grep "ROS_\|AMENT_\|COLCON_\|CATKIN_" | egrep -o '^[^=]+')  

Originally posted by Rufus with karma: 1083 on 2020-07-15

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.