Create simple ROS package

Update ROS environment with locations to new packages

ROS environment might need to be updated each time new package was created or ROS_PACKAGE_PATH was changed

rospack profile

ROSPackProfile

Locate created packages

Now all packages made in the folder ~/ros-sandbox can be found by ROS. Command “rospack find package-name” finds the package and output path for it

rospack find example1

ROSFindPackage

ROS is able to find this package even from arbitrary folder (e.g. from home-folder)

ROSFindPackageFromArbitratryFolder

Command “roscd” sets the ROS distribution folder as current

roscd

ROSCommandRoscd

Command “roscd” with the name of a package as an argument sets the folder with this package as current

roscd example1

ROSCommandRoscdExample1

Dependencies of packages

The folder of the package contains a list of subfolders and files. File “manifest.xml” contains meta-information about the package, including dependencies to another packages defined during creating – “first-order dependencies”: std_msgs, rospy, roscpp

cat manifest.xml

ROSPackageFolderAndManifestXml

The same list of first-order dependencies can be displayed by the command “rospack” with the argument “depends1” and the package name

rospack depends1 example1

ROSDepends1Example1

hint Command 'rospack depends1' applicable to any packages

rospack depends1 rospy

ROSDepends1Rospy

All dependencies – first-order and indirect ones can be shown by command “rospack” with an argument “depends”

rospack depends example1

ROSDepensExample1

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail