Package Setup

In this exercise, we will get dependencies and configure the package for the Qt Creator IDE.

Download debian dependencies

Note

Make sure you installed and configured the rosdep tool.

Then, run the following command from the src directory of your workspace:

rosdep install --from-paths . --ignore-src -y

Build your workspace

cd ~/perception_driven_ws
source /opt/ros/humble/setup.bash
colcon build

Note

If the build fails then revisit the previous two steps to make sure all the dependencies were downloaded.

Source the workspace

In a new terminal (where you didn’t build the workspace), run the following command from your workspace parent directory to enable the ROS tools to see the new packages

source install/setup.bash

Import Package into QTCreator

In QTCreator select the following menu item: File ‣ New File or Project.

In the dialog that appears, on the left select Other Project and in the middle section select ROS Workspace. Confirm your selection with the Choose button.

Choose a name for your workspace, select /opt/ros/humble/ as the ROS distribution, select colcon as the build system, and provide the path to your perception_ws directory as the workspace path. Click Next and Finish to complete the setup.

Rebuild the workspace inside of QTCreator, to create the metadata required for IDE code completion.

Open the Main Thread Source File

In the Edit tab, open the file pick_and_place_node.cpp in the directory [workspace source directory]/pick_and_place_application/src/nodes