.msg Module not being found
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
have you sourced the setup.bash for your workspace?
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 namesemantic_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 I can't believe this! You're damn right, I am supposed to run semantic_label_publisher.
I am an idiot. Thank you.