ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros1_bridge not finding generated message .hpp file

asked 2020-07-14 05:13:51 -0600

Rufus gravatar image

updated 2020-07-14 20:46:46 -0600

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

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-07-15 00:04:24 -0600

Rufus gravatar image

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 '^[^=]+')
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-07-14 05:13:51 -0600

Seen: 252 times

Last updated: Jul 15 '20