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

laurent2101's profile - activity

2015-01-25 22:38:13 -0600 received badge  Famous Question (source)
2014-11-13 22:47:12 -0600 received badge  Notable Question (source)
2014-10-19 11:56:49 -0600 received badge  Popular Question (source)
2014-10-17 13:24:17 -0600 answered a question ImportError package.msg

Yes, I used the old build system because the tutorials said it was simpler. After loading the manifest, the script worked perfectly. Thank you very much for your help.

2014-10-17 13:21:46 -0600 received badge  Supporter (source)
2014-10-17 13:21:44 -0600 received badge  Scholar (source)
2014-10-17 09:59:08 -0600 asked a question ImportError package.msg

Hi I have created a package(pwm), that contains a custom message(signal.msg). It seem to be compiled correctly. Because I can

ubuntu@arm:~/test/sandbox/pwm$ rosmsg show signal
[pwm/signal]:
uint8 freq
uint8 duty

ubuntu@arm:~/test/sandbox/pwm/msg$ ls
signal.msg

When i run a script which use the message i got an error.

ubuntu@arm:~$ rosrun pwm scripts/talker.py
Traceback (most recent call last):
  File "/home/ubuntu/test/sandbox/pwm/scripts/talker.py", line 4, in <module>
    from pwm.msg import signal
ImportError: No module named pwm.msg

Could you help me please ?

Here are some additional informations

CMakeLists.txt

ubuntu@arm:~/test/sandbox/pwm$ cat CMakeLists.txt 
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
#rosbuild_add_boost_directories()
#rosbuild_link_boost(${PROJECT_NAME} thread)
#rosbuild_add_executable(example examples/example.cpp)
#target_link_libraries(example ${PROJECT_NAME})

export

ubuntu@arm:~/test/sandbox/pwm/msg$ export | grep ROS
    declare -x ROSLISP_PACKAGE_DIRECTORIES="" 
    declare -x ROS_DISTRO="indigo" 
    declare -x ROS_ETC_DIR="/opt/ros/indigo/etc/ros"
    declare -x ROS_MASTER_URI="http://localhost:11311" 
    declare -x ROS_PACKAGE_PATH="/home/ubuntu/test/sandbox:/opt/ros/indigo/share:/opt/ros/indigo/stacks" 
    declare -x ROS_ROOT="/opt/ros/indigo/share/ros"
    declare -x ROS_WORKSPACE="/home/ubuntu/test"

Pythonpath

ubuntu@arm:~/test/sandbox/pwm/msg$ echo $PYTHONPATH 
/opt/ros/indigo/lib/python2.7/dist-packages

rosmake

ubuntu@arm:~/test/sandbox/pwm$ rosmake 
[ rosmake ] rosmake starting...                                                 
[ rosmake ] No package specified.  Building ['pwm']                             
[ rosmake ] Packages requested are: ['pwm']                                     
[ rosmake ] Logging to directory /home/ubuntu/.ros/rosmake/rosmake_output-20141015-233222
[ rosmake ] Expanded args ['pwm'] to:
['pwm']                                   
[rosmake-0] Starting >>> catkin [ make ]                                        
[rosmake-0] Finished <<< catkin ROS_NOBUILD in package catkin
 No Makefile in package catkin
[rosmake-0] Starting >>> genmsg [ make ]                                        
[rosmake-0] Finished <<< genmsg ROS_NOBUILD in package genmsg
 No Makefile in package genmsg
[rosmake-0] Starting >>> genlisp [ make ]                                       
[rosmake-0] Finished <<< genlisp ROS_NOBUILD in package genlisp
 No Makefile in package genlisp
[rosmake-0] Starting >>> genpy [ make ]                                         
[rosmake-0] Finished <<< genpy ROS_NOBUILD in package genpy
 No Makefile in package genpy
[rosmake-0] Starting >>> gencpp [ make ]                                        
[rosmake-0] Finished <<< gencpp ROS_NOBUILD in package gencppive 4/25 Complete ]
 No Makefile in package gencpp
[rosmake-0] Starting >>> message_generation [ make ]                            
[rosmake-0] Finished <<< message_generation ROS_NOBUILD in package message_generation
 No Makefile in package message_generation
[rosmake-0] Starting >>> cpp_common [ make ]                                    
[rosmake-0] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
 No Makefile in package cpp_common
[rosmake-0] Starting >>> rostime [ make ]                                       
[rosmake-0] Finished <<< rostime ROS_NOBUILD in package rostime
 No Makefile in package rostime
[rosmake-0] Starting >>> roscpp_traits [ make ]                                 
[rosmake-0] Finished <<< roscpp_traits ROS_NOBUILD in package ...
(more)