Error: "no matching package named 'std_msgs' found"

Hi!

I am currently working on the final module for ROS2 Basics (Rust). I happen to have stumbled upon this issue when building the package, “topic_publisher_pkg”. Despite following all of the scripts/codes provided in the module, It indicates that the std_msgs package is unable to be detected by the system when running colcon build. May I kindly ask for your assistance on how to resolve this issue?

Thank you!

image

Hi,

std_msgs is a package that comes with ROS 2 installation. Try sourcing it with:

source /opt/ros/humble/setup.bash (make sure the distribution matches)

And compile again.

Hi @roalgoal,

Thank you for your suggestion! I tried performing it prior to having the package compiled; however, the same problem still persists.

How did you create this package in the first place?

  • Did you include std_msgs as a dependency when creating the package, or
  • You manually added it as a dependency after creating the package.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.