Rospkg in Service Unit

Can anyone explain about rospkg? Why we need to import this? Whats the differences between rospkg and rospy? Thanks

Hi,

So both of them are the python modules forinteract with basic systems of ROS.
rospy has everything needed for rosnode starting, messages and basic system fucntionality related to ROS in python.
rospkg deals with accessing packages and files through the ROS path systems. You use it for accesing config files located in ros packages structure inside python.