SRRC Wiki

Service Robotics Research Center
at Ulm University of Applied Sciences

User Tools

Site Tools


tutorials:real-world-deployment:start

Creating your Own Real-World Deployment

In this tutorial you learn how to replace simulation components by real-world components. We do this by the example of the laser obstacle avoid (reactive navigation).

We start with the system you developed in Develop Your First System by Composing Software Components (reactive navigation with laser obstacle avoid). We do all the steps to make it work on a real robot instead of just in simulation. We focus on the differences between deployment for simulator and deployment for real-world. Finally, you end up at exactly the system for real-world deployment you have already seen in Deploy a Simple System onto a P3DX (or a Robotino).

Basic Information

Level Beginner
Role System builder, but also other roles while browsing through the system's building blocks
Assumptions Having completed the tutorial Deploy a Simple System onto a P3DX (or a Robotino)
System Requirements Virtual Machine Image Installed, see ready-to-go virtual machine
You will learn - how to convert a system from simulation to a physical robot setting
- how to deploy a system to a physical robot via the SmartMDSD toolchain
- how to start the deployed system, run the physical robot, and stop the system
Options

Description

Creating a System Project

Step 1: Open System Builder perspective

Click on File → New → System Project (Tier 3).

Enter the project name SystemP3dxLaserObstacleAvoidRealWorld. Uncheck the Use default location and browse to the location $SMART_ROOT_ACE/repos/SystemRepository.

Now click on Create Folder.

Enter SystemP3dxLaserObstacleAvoidRealWorld as the folder name and click on create.

Now click on Open.

Verify the project name and the location of the system project. If it is fine, press Next.

You now see the model types of the system project. Just keep the check boxes as is and click Next.

Now you see the set of components that are available in your workspace. Since we are creating a system for real world, we choose the components SmartLaserLMS200Server, SmartPioneerBaseServer which abstract the SICK LMS200 laser and Pioneer3DX respectively. We use ComponentLaserObstacleAvoid in the same way as in the system for with simulator Develop Your First System by Composing Software Components because this component doesn't differentiate whether their ports are connected to components for simulated hardware or to components for real hardware. Select the three components we need for our system as indicated in the figure below:

Now click Finish. The toolchain now creates the system project.

System Architecture: Composition of Components

Step 2.a: Open the component architecture file by double-clicking on ComponentArchitecture file

Step 2.b: guides you through creating the instances of the components. Drag the ComponentInstance from the System Tools into the empty system architecture file. A selection wizard opens. Select the Component Definition ComponentLaserObstacleAvoid and click Finish.

Now the ComponentLaserObstacleAvoid instance got added. You can rearrange the ports and the port names to get the following result:

Drag the ComponentInstance from the System Tools into the empty system architecture file. A selection wizard opens. Select the Component Definition SmartLaserLMS200Server and click Finish.

Now the SmartLaserLMS200Server instance got added. You can rearrange the ports and the port names to get the following result:

Drag the ComponentInstance from the System Tools into the empty system architecture file. A selection wizard opens. Select the Component Definition SmartPioneerBaseServer and click Finish.

Now the SmartPioneerBaseServer instance got added. You can rearrange the ports and the port names to get the following result:

Optionally, you can remove the unused ports to make the graphical view of the System architecture better. To remove a unused port, select the port –> right click –> Edit –> Delete from Model

After removing the unused the ports, the system looks as following:

Step 2.c: We now connect the ports of the components. Drag the Connection from the System Tools to the LaserServiceIn port of the ComponentLaserObstacleAvoid and click and continue to drag to the LaserServiceOut port of the SmartLaserLMS200Server.

Drag the Connection from the System Tools to the BaseStateServiceIn port of the SmartLaserLMS200Server and click and continue to drag to the BaseStateServiceOut port of the SmartPioneerBaseServer.

Drag the Connection from the System Tools to the NavigationVelocityServiceOut port of the ComponentLaserObstacleAvoid and click and continue to drag to the NavigationVelocityServiceIn port of the SmartPioneerBaseServer.

You can rearrange the wiring visually to get the following result:

Target Platform Model

We now model the target platform which we need later on when we assign software components to processing units. Step 3.a: Open the target platform model by double clicking the target platform model:

Step 3.b: Drag the TargetPlatform form the Platform Tools to the empty Target Platform Model.

Optionally, you can change the target name from its default name “PC1”. Here we use the name “P3dx” as follows:

Step 3.c: Now add the network interface by dragging the NetworkInterface from the Platform Tools onto the P3dx box. Since our system runs on the Pioneer3dx robot, we configure the host address as IP address of the robot. This IP address is used during the deployment to deploy the system files onto the robot and also to remotely connect to the robot using vncviewer.

Step 3.d: We now have to add the username of a login account on the target system. This is used later on in the deployment step. During the deployment step, you need the password for this user account.

Now we completed the target platform model. You can rearrange the model elements to look as in the following picture:

Deployment Model

The deployment model defines which components are going to be deployed / transferred to which target platform(s) / processing unit(s) / computer(s). We deploy our system to a Pioneer3dx robot.

Step 4.a: Open the deployment model:

Step 4.b: Add the TargetPlatformReference by dragging. A selection wizard opens. Select the target platform (in this case, you see the target platform as configured in the Target Platform Model steps) and click Finish.

It now looks as follows:

Step 4.c: Now add the LoginAccount by dragging it from the Deployment Tools. A selection wizard opens. Select the login account (in this case, you see the login account as configured in the Target Platform Model steps) and click Finish.

Step 4.d: Add the UploadDirectory by dragging. Keep the /tmp default path (in case you want the system to reside in a different place, then you can specify this here to your needs):

Step 4.e: Add the NetworkInterface by dragging:

Step 4.f: Add an instance of the NamingService by dragging it from the Deployment Tools:

Step 4.g: We now add the ComponentArtefacts by dragging from the Deployment Tools. This opens a wizard where you select a component instance. You need to repeat that for all the components used in our system.

Step 4.h: We now need to assign the component instances to the target platform. This specifies where the component instance gets deployed and executed. You do the connections by dragging the Deployment from the Deployment Tools.

Now we completed the deployment model. You can rearrange the model elements to look as in the following picture:

Step 4.i: Save the models by clicking “Save All”.

System Parameters

Step 5.a: Open the system parameter modeler. Now you see the empty system parameter file:

Step 5.b: Copy & Paste the following content into your system parameter file:

SystemP3dxLaserObstacleAvoidRealWorld.systemParam
​
SystemParameterModel SystemP3dxLaserObstacleAvoidRealWorld extendsSystem SystemP3dxLaserObstacleAvoidRealWorld {	
	ComponentParameterInstance SmartLaserLMS200Server refinesParamStruct SmartLaserLMS200ServerParams {
		ParameterRefinement Laser {
			sick_type = "LMS"
			x = 70.0
			y = 0.0
			z = 0.0
			azimuth = 0.0
			device = "/dev/sick"
			baudrate = 500000
			resolution = 50
			length_unit = 1
			verbose = false
		}
	}	
 
	ComponentParameterInstance SmartPioneerBaseServer refinesParamStruct SmartPioneerBaseServerParams {
		ParameterRefinement Robot{
			enable_motors = true
			enable_sonar = false
			maxVel = 1000
			maxVelAcc = 300
			maxVelDecel = 300
			maxRotVel = 300
			maxRotVelAcc = 100
			maxRotVelDecel = 100
			serialport = "/dev/ttyS0"
			robotType = "p3dx"
		}
	}
}

Now SystemP3dxLaserObstacleAvoidRealWorld.systemParam should look like as follow:

Deployment

Step 6.a: Right click on the project → Run Code-Generation. This generates startup scripts and configuration files (used by the components during their initialization). It also generates the data folders where the components find required data.

Verify that there are no errors during the code generation by looking at the Console terminal:

Step 6.b: We now deploy the system by clicking the Deployment Action from the right-click menu of the project:

Step 6.c: You are now prompted for a password. We configured the system to use the login Student. for which the password is student. Just enter the password and the deployment gets completed. Password popup is prompted 2 times and you need to enter password each time.

Step 6.d: Now a message box appears and asks whether you want to start execution. Answer No.

Execution

Step 7.a: Installation of the vncviewer in your PC for accessing the robot remotely:

  sudo apt-get install xtightvncviewer
  

of course, you can also use any other suitable tool

Step 7.b: Start vncviewer using robot IP address as shown.

Step 7.c: Login to the robot using the account student with password student and then navigate to the specified deployment folder. The default folder is /tmp. In there you find a folder with the name of the system project. In this tutorial, we use SystemP3dxLaserObstacleAvoidRealWorld. Now you can start the system as shown below using the indicated shell script.

Now the system is running and you can observe that real robot is moving. And in the vncviewer you can check the terminals to see the output from components.

You can use the same shell script to stop the system (use stop instead of start as argument):

What to do next?

Now you can proceed with the tutorials in lesson lesson_4configure_the_flexible_navigation_stack_for_new_environments

Acknowledgements

tutorials/real-world-deployment/start.txt · Last modified: 2021/04/19 17:57 by Christian Schlegel