Table of Contents

Example: System Builder - Adding Behavior to a System Project

This tutorial explains how a system builder adds task plots to his/her system.

Basic Information

Level Beginner
Role system builder
Assumptions You know how to develop a software component
System Requirements Virtual Appliance installed, see ready-to-go virtual appliance
You will learn - how to …
- how to …
- how to …
Options - …

Introduction

You have seen how to realize the tasks in Example: Behavior Developer - Realizing Tasks. These tasks are implemented in an abstract manner using the skill definitions independent of how these skills are realized. To use the tasks in a system project, we must map the abstract instances of coordination modules with the coordination modules realized by the components used in the system.

In this tutorial, we show the mapping of coordination modules with an example by using the behavior project BehaviorRobotinoBoxTransportationTasks in the system project SystemWebotsNavMpsDockingOPCUA.

Coordination Module Mapping

step 1: In this step, we import the behavior project in system project. Initially make sure that the behavior project is available in the workspace. You can check this by opening the Behavior Developer (Tier 3) view.

Now change to the System Builder (Tier 3) view. In the system project, right click on the imports folder and select Manage Project Imports as shown below:

Now you see the set of behavior projects and component projects that are available in your workspace. Select the required behavior project as indicated in the figure below:

step 2: In this step, we link the behavior project to our system project. This is done in the system architecture model. Open the system architecture model in textual form by selecting the SystemWebotsNavMpsDockingOPCUA.componentArch file in the model folder.

Link the behavior project in the system project using the keyword BehaviorTaskRef in the system architecture model.

step 3: In this step, we check which coordination modules are used in task realizations by looking at the *.taskRealization file. Below code listing from the BehaviorRobotinoBoxTransportationTasks.taskRealization shows the abstract coordination module instances used in the task realization.

  1. TaskRealizationModel BehaviorRobotinoBoxTransportationTasks {
  2. AbstractCoordinationModuleInstance navigation coordModuleDef CommNavigationObjects.NavigationModule
  3. AbstractCoordinationModuleInstance kbModInst coordModuleDef CommBasicObjects.KBModule
  4. AbstractCoordinationModuleInstance localizationModInst coordModuleDef CommLocalizationObjects.LocalizationModule
  5. AbstractCoordinationModuleInstance base coordModuleDef CommNavigationObjects.MobileBaseModule
  6. AbstractCoordinationModuleInstance MPS coordModuleDef CommRobotinoObjects.MPSModule
  7. }

From the above code listing, we know the abstract instances of those coordination modules that are used. In this example, we have to map the coordination modules navigation, kbModInst, localizationModInst, base, MPS to component(s) in the system.

step 4a: In this step, we explain the mapping of the coordination module navigation. To map the coordination module navigation (which is an abstract instance of CommNavigationObjects.NavigationModule), we need to know which component(s) in the system have realized the CommNavigationObjects.NavigationModule and what is the name of the realized module instance. We can see this in the component model file *.skillRealization.

The SmartCdlServer.skillRealization file of the software component SmartCdlServer is shown below:

As you can see, MovementMod2 is the realization of CommNavigationObjects.NavigationModule and it uses the three coordination services CommNavigationObjects.CdlCoordinationService, CommNavigationObjects.MapperCoordinationService and CommNavigationObjects.PlannerCoordinationService. These are implemented by the software components SmartCdlServer, SmartMapperGridMap, SmartPlannerBreadthFirstSearch.

step 4b: In the same way as for the coordination module navigation, we now map the other coordination modules kbModInst, localizationModInst, base and MPS. This is shown in the below code listing.

  1. CoordinationModuleMapping {
  2. moduleInstance BehaviorRobotinoBoxTransportationTasks.localizationModInst realizedby locModRealization {
  3. interfaceInstance amcl realizedby SmartAmcl
  4. }
  5. }
  6.  
  7. CoordinationModuleMapping {
  8. moduleInstance BehaviorRobotinoBoxTransportationTasks.kbModInst realizedby kbModule
  9. {
  10. interfaceInstance kb realizedby ComponentKB
  11. }
  12. }
  13. CoordinationModuleMapping {
  14. moduleInstance BehaviorRobotinoBoxTransportationTasks.base realizedby baseInst {
  15. interfaceInstance base realizedby ComponentWebotsMobileRobot
  16. }
  17. }
  18.  
  19. CoordinationModuleMapping {
  20. moduleInstance BehaviorRobotinoBoxTransportationTasks.MPS realizedby mpsModRealization {
  21. interfaceInstance BELT realizedby ComponentWebotsConveyorBeltOpcua
  22. interfaceInstance MPSDOCKING realizedby ComponentWebotsMpsDocking
  23. }
  24. }

Note: In the editor, press Ctrl + Space to view the possible keywords and also for auto completion. The keyword Name-ID indicates that the user has to give an identifier name.

What to do next?

:!: «to be added»

Acknowledgements

DokuWiki Appliance - Powered by TurnKey Linux