Skip to content

Tutorial System Integration

Tiago Alexandre Oliveira edited this page Aug 2, 2021 · 1 revision

In this tutorial we will learn how to add a third party dependency to an ESROCOS component.

Prerequisites: Please make sure a camera device with id 0 (video0) is available in your machine. In a Virtual Box system, this is possible by installing the Virtual Box Extension Pack and selecting a camera from Devices/Webcams in the main window of the running virtual machine. In a Docker image, it can be achieved by editing the docker run call.

Create the project

System project creation works the same way as component creation.

  1. Go to ESROCOS workspace and use the esrocos_create_project script to create a project named tutorials/system_integration. Choose the universe package set.
  2. When asked for dependencies, enter types/base.
  3. Checkout and install dependencies using the esrocos_fetch_dependencies script.

Open the TASTE GUI using the esrocos_edit_project script.

  1. On the top menu click on File and select the option Import Interface View.
  2. Go to ~/esrocos_workspace/install/share/taste_components/driver and select the interfaceview.aadl file.
  3. Repeat to import also the interfaceview.aadl file located in ~/esrocos_workspace/install/share/taste_components/cam_capture.
  4. Add a driver component and a camera component to the canvas and connect the trigger_out RI to the capture PI.

system_integration

Switch to the Deployment View. Right-click inside the x86_partition and use the Bind All function to add both functions to the deployment system.

system_integration_2

Delete the model/work folder to force TASTE to generate it again and call the esrocos_generate_skeletons script.

Add the dependencies in the TASTE model Makefile

TASTE uses a tool called Kazoo to generate code and build scripts from AADL models. In order to link libraries, include directories, and add compilation flags, you need to manually edit the Kazoo Makefile located in the model folder. For this tutorial we only need to link the opencv libraries. Add the following line to the Makefile:

export X86_PARTITION_USER_LDFLAGS = -L$(AUTOPROJ_CURRENT_ROOT)/install/lib  -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_videoio

Build the project

To build the project run the esrocos_build_project script.

cd ~/esrocos_workspace/tutorials/system_integration
source env.sh
esrocos_build_project

An executable is generated in model/work/binaries/x86_partition. You should be able to run it and see the image from the camera connected to video0. Congratulations, you successfully integrated two components into an ESROCOS system project.

Clone this wiki locally