Ask Your Question
1 - Build package - colcon

asked 2019-12-02 18:55:02 -0600

Doug gravatar image

Hi all,

I am running on Ubuntu 16.04 with ROS Kinetic and Autoware's Docker image (Generic amd64 (64-bit x86) Docker). I am trying to add a package that would run simultaneously to other packages. I've only been using catkin so far but more recent versions of Autoware use colcon for building, which I have never used and find myself confused about.

What would be a proper way to build this package and where should I put my package ?

Thanks in advance for any help :)

Output of - env | grep ROS - : (Inside container)







/home/autoware/Autoware/install/autoware_build_flags/share:/home/autoware/Autoware/install/autoware_bag_tools /share:/home/autoware/Autoware/install/adi_driver/share:/opt/ros/melodic/share



Output of - gcc --version - : (Inside container)

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-12-03 13:10:52 -0600

Josh Whitley gravatar image

updated 2019-12-03 13:12:22 -0600

Hey, @Doug! Thanks for your question. If you are using the pre-built version of the Docker container (autoware/autoware:latest-melodic or autoware/autoware:latest-melodic-cuda), then I recommend doing the following:

  1. Create a new workspace in the shared_dir folder on your machine (cd $HOME/shared_dir && mkdir my_workspace).
  2. Create a src folder in the workspace.
  3. Run the Docker container using the script in the docker repository.

In the Docker container, you should now see the ~/shared_dir/my_workspace/src folder. Inside this folder, run colcon create pkg <package_name> to create your new package. Once you've modified the package to your liking and added your code, go up to the root of the workspace (cd ~/shared_dir/my_workspace) and run colcon build. This should build your new package. To access the package, you'll need to "source" the workspace by running source /home/autoware/shared_dir/my_workspace/install/setup.bash --extend and you should then have access to your package through the normal ROS tools (roscd, rosrun, etc.).

Just a note: anything you do in the Docker container will be wiped out except data you store in the shared_dir folder, which will be available on your local machine in /home/<your_username>/shared_dir after you shut down the container.

edit flag offensive delete link more


Thanks ! It helps a lot !

Little concern about colcon create pkg <package_name> though. I'm getting the following error:

/usr/bin/colcon: error: argument verb_name: invalid choice: 'create' (choose from 'build', 'extension-points', 'extensions', 'graph', 'info', 'list', 'metadata', 'test', 'test-result', 'version-check')

Which seems normal given that colcon doesn't seem to provide a create arg. Am I wrong ?

Doug gravatar image Doug  ( 2019-12-03 13:40:55 -0600 )edit

@Doug I think @Maximus5684 meant catkin_create_package since the Autoware packages are catkin pkgs but are all build using colcon

sgermanserrano gravatar image sgermanserrano  ( 2019-12-04 02:58:13 -0600 )edit

@sgermanserrano@Maximus5684 Yes thanks, this is what I thought.

After sourcing, roscd works fine. However, I added a .launch file but I can't launch it. No error, there is just no autocompletion when I type roslaunch <my_pkg>

I noticed there is no launch folder in


However I noticed here is one when I copy, build and source any other Autoware package. I don't know if this is the reason why, but I noticed that in other Autoware packages' CMakeLists.txt, there is:

install( DIRECTORY launch/

I added the same paragraph in my package's CMakeLists.txt. After building and sourcing, I can run roslaunch test_dg chatter.launch but I get the following error: ERROR: cannot launch node of type [test_dg/]: can't locate node [] in package [test_dg]

Any thoughts on that ? Should I ...(more)

Doug gravatar image Doug  ( 2019-12-04 12:05:19 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-12-02 18:55:02 -0600

Seen: 367 times

Last updated: Dec 03 '19