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

Problem including nav_msgs/msg/odometry

asked 2021-11-08 02:39:30 -0600

s0nc gravatar image

Hi everyone,

when using the message type nav_msgs/msg/odometry ( I tried o include it using this piece of code:

#include <nav_msgs/msg/odometry.h>

In the CMakeList.txt I added find_package(nav_msgs REQUIRED) and in the package.xml I added <depend>nav_msgs</depend> so this should cause no problems. Even the command ros2 interface show nav_msgs/msg/Odometry returnes the expected output.

When building the package in the same prompt it says fatal error: nav_msgs/msg/odometry.h: No such file or directory

Can anyone help me with this?

Regards s0nc

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-11-08 17:21:35 -0600

Geoff gravatar image

The correct file to include is nav_msgs/msg/odometry.hpp.

edit flag offensive delete link more


Thank you, it finally works :)

s0nc gravatar image s0nc  ( 2021-11-09 01:27:12 -0600 )edit

Question Tools

1 follower


Asked: 2021-11-08 02:39:30 -0600

Seen: 759 times

Last updated: Nov 09 '21