Building Packages

Once all the system dependencies are installed, we can build our package that we just created.

Using rosmake

rosmake is just like the make command, but it does some special ROS magic. When you type rosmake beginner_tutorials, it builds the beginner_tutorials package, plus every package that it depends on, in the correct order. Since we listed rospy, roscpp, and std_msgs as dependencies when creating our ROS package, these packages (and their dependiencies, and so on) will be built by rosmake as well.

Usage:

rosmake [package]

Try:

$ rosmake beginner_tutorials

This previous command may take a while to finish. As it is running you should see some output like:

  • [ rosmake ] No package specified.  Building ['beginner_tutorials']
    [ rosmake ] Logging to directory
    [ rosmake ] /home/dbking/.ros/rosmake_output-2009-09-22-03-17-14
    [ rosmake ] [ 0 of 18  Completed ]
    [rosmake-0] >>> genmsg_cpp >>> [ make ]
    [rosmake-0] <<< genmsg_cpp <<< [PASS] [ 0.39 seconds ]
    [ rosmake ] [ 1 of 18  Completed ]
    ...
    ...
    ...
    [ rosmake ] [ 17 of 18  Completed ]
    [rosmake-0] >>> beginner_tutorials >>> [ make ]
    [rosmake-0] <<< beginner_tutorials <<< [PASS] [ 0.79 seconds ]

On Fuerte, since dependencies are greatly reduced, this takes almost no time and produces:

  • [ rosmake ] rosmake starting...                                                                     
    [ rosmake ] Packages requested are: ['beginner_tutorials']                                          
    [ rosmake ] Logging to directory /home/alex/.ros/rosmake/rosmake_output-20120603-082414             
    [ rosmake ] Expanded args ['beginner_tutorials'] to:
    ['beginner_tutorials']                         
    [rosmake-0] Starting >>> std_msgs [ make ]                                                          
    [rosmake-1] Starting >>> roslang [ make ]                                                           
    [rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
     No Makefile in package std_msgs  
    [rosmake-1] Finished <<< roslang ROS_NOBUILD in package roslang
     No Makefile in package roslang     
    [rosmake-1] Starting >>> rospy [ make ]                                                             
    [rosmake-2] Starting >>> roscpp [ make ]                                                            
    [rosmake-1] Finished <<< rospy ROS_NOBUILD in package rospy
     No Makefile in package rospy           
    [rosmake-2] Finished <<< roscpp ROS_NOBUILD in package roscpp
     No Makefile in package roscpp        
    [rosmake-2] Starting >>> beginner_tutorials [ make ]                                                
    [rosmake-2] Finished <<< beginner_tutorials [PASS] [ 1.14 seconds ]                                 
    [ rosmake ] Results:                                                                                
    [ rosmake ] Built 5 packages with 0 failures.                                                       
    [ rosmake ] Summary output to directory                                                             
    [ rosmake ] /home/alex/.ros/rosmake/rosmake_output-20120603-082414  

rosmake multiple packages

We can also use rosmake to build multiple packages at once.

Usage:

rosmake [package1] [package2] [package3]

Review

Lets just list some of the commands we've used so far:

  • rosdep = ros+dep(endencies) : a tool to install package dependencies
  • rosmake = ros+make : makes (compiles) a ROS package

Wiki: ROS/Tutorials/rosbuild/BuildingPackages (last edited 2016-09-27 13:29:11 by yoyekw)