Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 49

cannot include custom .msg files in python code

$
0
0
I have created my own msg files and would now like to use them in python. One line trips me up over and over. from my_package.msg import * I get an error like this: > ImportError: No module named> my_package I do believe I have written the '.msg' files correctly, and I have executed 'catkin_make' successfully on the workspace I'm using for ros development. I also believe I've edited the CMakeLists.txt file correctly. cmake_minimum_required(VERSION 2.8.3) project(my_package) find_package(catkin REQUIRED COMPONENTS geometry_msgs roscpp rospy std_msgs message_generation map_store ) add_message_files( FILES MapListEntryList.msg MapListElement.msg # Message2.msg ) generate_messages( DEPENDENCIES #my_package # MapListEntryList # geometry_msgs# std_msgs ) catkin_package( # INCLUDE_DIRS include LIBRARIES my_package map_store CATKIN_DEPENDS message_runtime geometry_msgs roscpp rospy std_msgs # DEPENDS system_lib ) include_directories( ${catkin_INCLUDE_DIRS} ) install(PROGRAMS scripts/turtlebot_listen.py scripts/turtlebot_map.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) The two .msg files are trivial: # MapListEntryList.msg # num of available maps/ num of maps in list int8 len # list of available map_id objects my_package/MapListElement[] list and # MapListElement.msg string name string id I can use rosmsg to look at both messages. If anyone can point out what I'm doing wrong, I'd be grateful.

Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>