Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why can I import from a package which is not part of my dependencies?

I created a ROS package, my_package, with dependencies rospy and geometry_msgs. Then I created a Python script, my_script.py, (which is located under src) for my_package.

To my surprise, in my_script.py, I can import from the package turtlesim, like from turtlesim.msg import Pose, without getting errors. So, turtlesim seems to be part of my dependencies. Why is that?

If execute the following command on the terminal rospack depends my_package, the output is the following:

cpp_common
rostime
roscpp_traits
roscpp_serialization
catkin
genmsg
genpy
message_runtime
std_msgs
geometry_msgs
gencpp
geneus
gennodejs
genlisp
message_generation
rosbuild
rosconsole
rosgraph_msgs
xmlrpcpp
roscpp
rosgraph
ros_environment
rospack
roslib
rospy

which does not include turtlesim.