0
$\begingroup$

I have two packages, gps_driver and gps_msg.

Driver: gps_driver->gps_driver->python->gps_driver.py Msg: gps_msg->msg->GpsMsg.msg In the relevant package.xml, gps_msg is listed as a dependency for gps_driver. The gps_driver has the following line:

from gps_msg.msg import GpsMsg

which causes the error: ModuleNotFoundError: No module named gps_msg

Both packages are in the .src folder of the same workspace, everything is built.

$\endgroup$

1 Answer 1

0
$\begingroup$

Check in the GPS Msg package (not your package) if the message is being set in the CMakeLists.txt. Something like this:

set(msg_files
  "msg/GpsMsg.msg"
  ...
)
...
rosidl_generate_interfaces(${PROJECT_NAME}
  ${msg_files}
  ...
  DEPENDENCIES std_msgs sensor_msgs ...
)

ament_export_dependencies(rosidl_default_runtime)

ament_package()

Also, check if the name in the project is the same in both your driver package and message package (project(gps_msgs) in CMakeLists.txt and <name>gps_msgs</name> in package.xml).

And, after building it, don't forget to source your workspace.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.