Rosanswers logo


I have very strange problem related to my custom action msg. I compiled my msg, but I can't import it. When I try to run my py action server I am getting next error:

raceback (most recent call last):
File "/home/ivan/infocom_robotics_ws/src/dock_station_goal/src/turn_for_specific_angle_server.py", line 5, in from dock_station_goal.msg import DoTurnAction, DoTurnFeedback, DoTurnResult ImportError: No module named msg

But I can at the same time I can find my msg with: rosmsg list | grep DoTurn

ivan@ivan-desktop:~$ rosmsg list | grep DoTurn

dock_station_goal/DoTurnAction dock_station_goal/DoTurnActionFeedback dock_station_goal/DoTurnActionGoal dock_station_goal/DoTurnActionResult dock_station_goal/DoTurnFeedback dock_station_goal/DoTurnGoal dock_station_goal/DoTurnResult ivan@ivan-desktop:~$

Another strange thing is that when I am checking: rosmsg packages, the pkgs with my custom msgs are doubled:

ivan@ivan-desktop:~$ rosmsg packages

actionlib actionlib_msgs actionlib_tutorials base_local_planner beginner_tutorials beginner_tutorials bond control_msgs costmap_2d diagnostic_msgs dock_station_goal dock_station_goal dynamic_reconfigure geometry_msgs map_msgs move_base_msgs nav_msgs realsense2_camera robot_drive roscpp rosgraph_msgs rospy_tutorials rosserial_msgs sensor_msgs shape_msgs smach_msgs std_msgs stereo_msgs tf tf2_msgs trajectory_msgs turtle_actionlib turtlebot3_msgs turtlebot_msgs turtlesim visualization_msgs

You can see that beginner_tutorials and dock_station_goal are doubled

I am stack and getting crazy((( Can somebody help me?

Thank you!


I am using catkin_make, the output of $ROS_PACKAGE_PATH is:


And my Cmake list is:

cmake_minimum_required(VERSION 2.8.3) project(dock_station_goal)

find_package(catkin REQUIRED COMPONENTS message_generation
actionlib actionlib_msgs
move_base_msgs roscpp rospy
std_msgs genmsg )

add_action_files( DIRECTORY action FILES DoDocking.action
DoTurn.action )

generate_messages( DEPENDENCIES
std_msgs actionlib_msgs )

catkin_package( LIBRARIES dock_station_goal CATKIN_DEPENDS move_base_msgs roscpp rospy std_msgs actionlib_msgs DEPENDS system_lib
DEPENDS message_runtime )

${catkin_INCLUDE_DIRS} ) > > > ${catkin_EXPORTED_TARGETS})


Originally posted by Yehor on ROS Answers with karma: 166 on 2019-12-17

Post score: 0

Original comments

Comment by Yehor on 2019-12-17:
Another weird thing is that I can import my msg from /home/usr/my_ws by running python! But I cant import from my_pkg/src

Comment by mgruhler on 2019-12-17:
Could you please edit your post and provide the following information:

  • the CMakeLists.txt of your package (remove all comments, though),
  • the build tool you use (catkin_make or catkin_tools / catkin build)
  • the output of echo $ROS_PACKAGE_PATH
  • if possible, a link to your package source code (GitHub or similar)

Comment by Yehor on 2019-12-17:
@mgruhler I edited my post

Unfortunately I don't have this project on a github


1 Answer 1


Rosanswers logo

Sorry, it was my fail. I had the file with the same name as pkg in that folder and didn't notice that. Thank you for the response.

I will delete the question

Originally posted by Yehor with karma: 166 on 2019-12-17

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by gvdhoorn on 2019-12-17:\

I will delete the question

I've undeleted your question, as it is a valid question.

The fact that it has a "trivial" answer does not change this.

I've also accepted your comment as the answer.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.