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

std_msgs/Float32.h not found

asked 2023-05-15 21:38:46 -0500

ALNA_Perera gravatar image

Hi,

I am relatively new to trying to do anything with c++ in ros, so I'm sorry if this is a stupid question.

I am trying to get AMCL to publish max weight. The plan is to publish it to a float 32 message for now when it's publishing amcl_pose, as amcl_pose checks for the particle with the maximum weight anyway. To do that, I need a float 32 message working, which is where I'm stuck. Error message:

Starting >>> nav2_amcl_1
--- stderr: nav2_amcl_1                             
/home/_/Projects/nav2_amcl_1/src/amcl_node.cpp:45:10: fatal error: std_msgs/Float32.h: No such file or directory
   45 | #include <std_msgs/Float32.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/amcl_1_core.dir/build.make:76: CMakeFiles/amcl_1_core.dir/src/amcl_node.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:241: CMakeFiles/amcl_1_core.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< nav2_amcl_1 [0.42s, exited with code 2]

Summary: 0 packages finished [0.62s]
  1 package failed: nav2_amcl_1
  1 package had stderr output: nav2_amcl_1

I have added std_msgs as a dependancy to CMakeLists.txt, and I have added it to amcl_node.hpp as well, but nothing seems to solve the problem.

Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-15 23:54:28 -0500

ALNA_Perera gravatar image

Solved it. The include should be

#include "std_msgs/msg/float32.hpp"
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2023-05-15 21:38:46 -0500

Seen: 232 times

Last updated: May 15 '23