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

Cannot find messages after successfully creating them

asked 2020-11-14 02:26:48 -0500

Kansai gravatar image

updated 2020-11-14 02:59:41 -0500

I am in the middle of creating a custom message. I have

  1. created a package in my workspace
  2. Create a folder called msg in the package folder
  3. Create a message file there. The message does not depend on other custom messages
  4. Modify package.xml to contain build depend and exec depend for message_generation and message_runtime
  5. Modify CMakeLists.txt to 5.1 find_package with message_generation 5.2 add_message_files with my custom message file 5.3 generate_messages( with std_msgs) (I dont know if this is necessary 5.4 catkin_package( with CATKIN_DEPENDS message_runtime

  6. from the workspace folder did catkin_make

I can see that the custom message is being generated (for lisp cpp eus nodejs and py)

However, after this I do

rosmsg show Mymessage

Could not find msg 'Mymessage'

and also if I list the messages with rosmsg list, it is not there

What is happening?

P.S

As predicted when I tried to use the message from a pythong program I got the

from myPackage.msg import Mymessage ModuleNotFoundError: No module named 'myPackage'

What?? The package is not being recognized as a module??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-14 03:36:14 -0500

Kansai gravatar image

I kind of made it work although I am not entirely sure how

I based this on this answer https://answers.ros.org/question/6058...

I am using a docker file I build myself and it seems on some terminals I had forgotten to source the setup bash? or perhaps I entered the docker image before I build the message files. so they didnt get recognized. I exited and entered again, source the setup bash and now it is running

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-11-14 02:26:48 -0500

Seen: 147 times

Last updated: Nov 14 '20