Ask Your Question
0

.msg Module not being found

asked 2017-05-17 18:32:58 -0500

Tex gravatar image

I am running ROS Indigo on Ubuntu 14.04. Here is my package and cmake file:

CMAKELIST:

cmake_minimum_required(VERSION 2.8.3)
project(semantic_label_publisher)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  rospy
  std_msgs
  message_generation
)


## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   SemLabel.msg
#   Message2.msg
 )

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs  # Or other packages containing msgs
 )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES semantic_label_publisher
  CATKIN_DEPENDS rospy std_msgs
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
  ${catkin_INCLUDE_DIRS}
)

package.xml File:

<?xml version="1.0"?>
<package>
  <name>semantic_label_publisher</name>
  <version>0.0.0</version>
  <description>The semantic_label_publisher package</description>


  <maintainer email="xxx@todo.todo">xxx</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>



  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>message_generation</build_depend>
  <run_depend>message_runtime</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>std_msgs</run_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- You can specify that this package is a metapackage here: -->
    <!-- <metapackage/> -->

    <!-- Other tools can request additional information be placed here -->



  </export>
</package>

I built my package, did everything, but when I run

rosrun semantic_label_publisher semantic_label_publisher_node.py

I get the following error:

ImportError: No module named semantic_label_publish.msg

Is there something I am doing wrong? If you need anymore info let me know.

Thanks

edit retag flag offensive close merge delete

Comments

have you sourced the setup.bash for your workspace?

ahendrix gravatar image ahendrix  ( 2017-05-17 19:50:23 -0500 )edit
1

Yes, first check, that you didn't forget to source devel/setup.bash. My guess would be, that you are trying to import in python by name semantic_label_publish.msg (as it says in the error), but your module has name - semantic_label_publishER (as it says in CMakeLists and package.xml)

spooner-dev gravatar image spooner-dev  ( 2017-05-18 00:48:06 -0500 )edit

@spooner-dev I can't believe this! You're damn right, I am supposed to run semantic_label_publisher.

I am an idiot. Thank you.

Tex gravatar image Tex  ( 2017-05-18 11:40:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-05-18 04:41:25 -0500

angeltop gravatar image

I suggest to try in your script to import:

from semantic_label_publisher.msg import SemLabel
edit flag offensive delete link more

Comments

Yeah, that's it. officially the largest idiot.

Tex gravatar image Tex  ( 2017-05-18 11:41:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-05-17 18:32:58 -0500

Seen: 127 times

Last updated: May 18 '17