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

hywel1994's profile - activity

2017-12-06 02:06:53 -0500 received badge  Enthusiast
2017-11-22 03:13:13 -0500 answered a question gazebo ros plugin make error: This file requires compiler and library support for the ISO C++ 2011 standard

I get the answer in this Q&A. https://answers.ros.org/question/216842/ros-using-c-11-how-to-use-with-catkin/ You c

2017-08-10 21:03:34 -0500 received badge  Famous Question (source)
2017-04-25 14:22:36 -0500 received badge  Teacher (source)
2017-04-25 14:22:36 -0500 received badge  Self-Learner (source)
2017-04-25 14:22:28 -0500 received badge  Popular Question (source)
2017-04-25 14:22:28 -0500 received badge  Notable Question (source)
2017-01-20 00:53:40 -0500 received badge  Editor (source)
2017-01-20 00:52:54 -0500 answered a question importerror:no module named basic.msg

Hahaha. I find the answer #q246689.

I didn't do soure ...devel/setup.bash

2017-01-20 00:37:09 -0500 asked a question importerror:no module named basic.msg

Hi, I have a problem on creating msg and writing publisher(python). when I creating msg and 'catkin_make', there is no error. But when I try to run the python node (rosrun baisc message_publisher.py), I got a error:

Traceback (most recent call last):
  File "/home/hywel/catkin_ws/src/basic/scripts/message_publisher2.py", line 4, in <module>
    from basic.msg import Complex2
ImportError: No module named basic.msg

the basic tree:

basic/
├── CMakeLists.txt
├── msg
│   └── Complex2.msg
├── package.xml
├── scripts
│   ├── message_publisher2.py
│   └── message_subcriber2.py
└── src

my CMakelists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(basic)
find_package(catkin REQUIRED COMPONENTS
  rospy
  std_msgs
  message_generation
)
## Generate messages in the 'msg' folder
add_message_files(
  FILES
  Complex2.msg
#   Message1.msg
#   Message2.msg
)
## Generate added messages and services with any dependencies listed here
generate_messages(
  DEPENDENCIES
  std_msgs
)
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES basic
#  CATKIN_DEPENDS rospy std_msgs

 CATKIN_DEPENDS message_runtime
       #  DEPENDS system_lib
 )

 # include_directories(include)
 include_directories(
     ${catkin_INCLUDE_DIRS}
 )

my package.xml:

<?xml version="1.0"?>
<package>
  <name>basic</name>
  <version>0.0.0</version>
  <description>The basic package</description>
  <maintainer email="hywel@todo.todo">hywel</maintainer>
  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>message_gengeration</build_depend>
  <run_depend>message_runtime</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>std_msgs</run_depend>

  <export>
  </export>
</package>

Thanks!

hywel