SRRC Wiki

Service Robotics Research Center
at Ulm University of Applied Sciences

User Tools

Site Tools


tutorials:flexible-navigation-stack-selenv:start

Differences

This shows you the differences between two versions of the page.


tutorials:flexible-navigation-stack-selenv:start [2022/12/23 11:06] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== System Project - How to Select a New Map ======
 +
 +Create a new system project from an existing one that already uses the flexible navigation stack. Then use the newly created map in our new system project.
 +===== Basic Information =====
 +
 +^ Level                | Beginner                                                                                                                  |
 +^ Role                 | System builder, but also other roles like experienced users                                           |
 +^ Assumptions          | Having completed the tutorial [[tutorials:flexible-navigation-stack-map:start]]                                           |
 +^ System Requirements  | Virtual Machine Image Installed, see [[tutorials:vm-welcome|ready-to-go virtual machine]]                                 |
 +^ You will learn       | - how to use a new map in a system project.                                                                 |
 +^ Options              | - SystemWebotsRobotino3Navigation \\ - SystemWebotsP3dxNavigation \\    (any system using the flexible navigation stack)  |
 +
 +===== Description =====
 +
 +In the tutorial [[tutorials:flexible-navigation-stack-map:start]], we generated a map of the environment. In the tutorial [[tutorials:flexible-navigation-stack-kb:start]], we updated the behavior project for navigation by specifying symbolic names for places in the environment and storing them in a knowledge base.
 +
 +In this tutorial, you learn how to use our newly created map with the flexible navigation stack. We create a new system project from an existing one that already uses the flexible navigation stack. Then we use the newly created map in our new system project.
 +
 +
 +===== Create a New System Project from an Existing Navigation System Project =====
 +
 +Open the //System Builder// view and check that the project you want to copy is in the workspace. In this tutorial, we create a new system project by copying the already existing ''SystemWebotsRobotino3Navigation''.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S01_00_FNS_NewEnvironment_select_perspective.png | }}
 +
 +Select //project// → right click → //Xito Utils// → //Copy and Rename Project//.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S01_01_FNS_NewEnvironment_create_project.png | }}
 +
 +Enter the new system project name, i.e ''SystemWebotsRobotino3NavigationNew'', uncheck //Use default location// and click //Browse// to specify the project location. Navigate to the location ''$SMART_ROOT_ACE/repos/SystemRepository'' and select //open//. Check the project name and location and then select //copy//.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S01_02_FNS_NewEnvironment_project_copy.png?600 | }}
 +
 +Now the new project ''SystemWebotsRobotino3NavigationNew'' is created and you can see it in the workspace. 
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S01_03_FNS_NewEnvironment_project_created.png | }}
 +
 +===== Perform Adjustments =====
 +
 +==== Update the System Parameters ====
 +
 +The system parameters in the file ''<<project name>>.systemParam'' specify the initial configuration of the components. In this tutorial, our system project is named ''SystemWebotsRobotino3NavigationNew'' and thus, the file with the system parameters is named ''SystemWebotsRobotino3NavigationNew.systemParam''
 +
 +In our system project in this tutorial, we use the Webots simulator and we need to tell Webots which world to use. As we will use the map created in tutorial [[tutorials:flexible-navigation-stack-map:start]], we need to use that world here again. Otherwise, obviously, the map would not match the world. Thus, as shown below, we update in the file ''SystemWebotsRobotino3NavigationNew.systemParam'' the parameter ''WorldPath'' to ''$SMART_ROOT_ACE/repos/DataRepository/webots/worlds/RobotinoHome.wbt''.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S02_00_FNS_NewEnvironment_system_params.png | }}
 +
 +Since //SystemWebotsRobotino3NavigationNew// and //SystemWebotsRobotino3Navigation// use the same flexible navigation stack, we don't have to modify the other models in the system project (i.e. Component Architecture, Deployment, Target, etc.).
 +
 +==== Update the Maps ====
 +
 +We use the map generated in [[tutorials:flexible-navigation-stack-map:start]] (i.e. ''laserMap.pgm'', ''laserMap.yaml''). 
 +
 +  * //SmartAmcl// requires this map to estimate the current position of the robot using a laser ranger and odometry information.
 +  * //SmartMapperGridMap// uses this map and updates it via laser range scans.
 +  * //SmartPlannerBreadthFirstSearch// uses the updated map from //SmartMapperGridMap// to find a free path to the goal.
 +
 +Data used by components of a system project is placed in the project folder ''SystemProjectName/smartsoft/src/''. Each component has it own data folder, e.g. //SmartAmcl// uses the data folder ''SmartAmcl_data''.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S03_00_FNS_NewEnvironment_data_folders.png | }}
 +
 +We first delete the old maps which we do not use anymore in this system project:
 +  * ''SmartAmcl_data'': localizaion-map.pgm, localization-map.yaml
 +  * ''SmartMapperGridMap_data'': navigation-map.pgm, navigation-map.yaml
 +You can delete them either via the file explorer or via a terminal with below commands:
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S03_01_FNS_NewEnvironment_remove_old_data.png | }}
 +
 +We now need to copy the maps into the corresponding folders:
 +  * copy ''laserMap.pgm'' into the folder ''SmartAmcl_data'' and rename it to ''localization-map.pgm''
 +  * copy ''laserMap.yaml'' into the folder ''SmartAmcl_data'' and rename it to ''localization-map.yaml''
 +
 +Now open the file ''localization-map.yaml'' and change the name of the image in line 3 from ''laserMap-pgm'' to ''localization-map.pgm''. The file ''localization-map.yaml'' now looks as shown below:
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S03_02_FNS_NewEnvironment_updated_amcl_yaml.png | }}
 +
 +  * copy ''laserMap.pgm'' into the folder ''SmartMapperGridMap_data'' and rename it to ''navigation-map.pgm''
 +  * copy ''laserMap.yaml'' into the folder ''SmartMapperGridMap_data'' and rename it to ''navigation-map.yaml''
 +
 +Now open the file ''navigation-map.yaml'' and change the name of the image in line 3 from ''laserMap-pgm'' to ''navigation-map.pgm''. The file ''navigation-map.yaml'' now looks as shown below:
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S03_03_FNS_NewEnvironment_updated_mapper_yaml.png | }}
 +
 +**Note:** In most scenarios, the same map is used for both, the robot localization (i.e. ''localization-map.pgm'') and the robot path planning (i.e. ''navigation-map.pgm''). However, in some cases we want to block areas in the environment so that the robot does not enter them. In this case, the ''navigation-map.pgm'' (used for path planning) is different from the ''localization-map.pgm'' (used for localization). We modify the ''navigation-map.pgm'' such that grid cells belonging to forbidden areas are changed from //free// to //occupied//.
 +
 +==== Update the CDL-Lookup Files ====
 +
 +The //SmartCdlServer// (motion execution) requires CDL-lookup files to calculate the motion commands to drive the robot towards intermediate waypoints as received from the path planner. CDL-lookup files are generated using the shape, the kinematics and the dynamics of the robot. 
 +
 +Since ''SystemWebotsRobotino3NavigationNew'' and ''SystemWebotsRobotino3Navigation'' use the same robot (a robotino robot), we don't have to update the cdl-lookup files. 
 +
 +**However, this step is required at the moment due to a bug in the copying of the project.**
 +
 +Copying the system project has an effect on the CDL-lookup binary files. So we need to do the following steps:
 +  * delete all files from the folder ''$SMART_ROOT_ACE/repos/SystemRepository/SystemWebotsRobotino3NavigationNew/smartsoft/src/SmartCdlServer_data/data/lookup-files''
 +  * copy all files from folder ''$SMART_ROOT_ACE/repos/SystemRepository/SystemWebotsRobotino3NavigationNew/smartsoft/src/SmartCdlServer_data/data/lookup-files'' to ''$SMART_ROOT_ACE/repos/SystemRepository/SystemWebotsRobotino3NavigationNew/smartsoft/src/SmartCdlServer_data/data/lookup-files''
 +
 +Note that if we want to use another robot such as a Pioneer3DX, Tiago, etc., we must use the corresponding CDL-lookup files and we need to update the names of the CDL-lookup files in the ''SmartCdlServer'' parameters in the corresponding ''*.systemParameters'' file.
 +
 +Now all the changes required in a system project for running the flexible navigation stack in a new environment are done. Now we can deploy and execute the system. The following section describes how to deploy and execute the system. These steps are the same for all the system projects and you have seen them already in the previous tutorials.
 +
 +==== Deploying and Executing the System ====
 +
 +**Step 1:** Right click on //project// → //Run Code-Generation//. This step is required if there is any change in models of the project (i.e. any file inside the model folder). In this tutorial, we modified the system parameters and thus, we need to do this step to generate updated configuration files (i.e *.ini files). You can look at the generated configuration files in the folders ''smartsoft/src-gen/params'' and ''smartsoft/src-gen/combined-ini-files''.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_00_FNS_NewEnvironment_code_generation.png | }}
 +
 +Verify that there are no errors during the code generation by looking at the console terminal: 
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_01_FNS_NewEnvironment_verify_code_generation.png | }}
 +
 +**Step 2:** We now deploy the system by clicking the //Deployment Action// from the right-click menu of the project: 
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_02_FNS_NewEnvironment_deployment.png | }}
 +
 +It depends on your configuration whether you are asked for credentials of the configured login account. Finally, you see the following pop-up window which tells you that the deployment was successful:
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_03_FNS_NewEnvironment_deployment_popup.png | }}
 +
 +**Step 3:** You can now start your system by clicking //Yes//. A terminal window will open and show the scenario control menu. Choose //menu-start// to start the scenario. Further terminals open automatically (one for each component and one additional window for the naming service). Note that they may not be visible initially in case they overlap. Choose //menu-stop// to stop the scenario. 
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_04_FNS_NewEnvironment_scenario_control_window.png | }}
 +
 +**Step 4:** Wait until the webots simulator is up and all the components started and are running. Look for the terminal window which contains the //ComponentTCLSequencer//.
 +
 +{{ tutorials:flexible-navigation-stack-selenv:S05_05_FNS_NewEnvironment_scenario_running.png | }}
 +
 +In the menu, select //5 - Approach location// and enter one of the offered names for locations.
 +
 +Now, the robot navigates to this destination and stops there.
 +
 +===== What to do next? =====
 +
 +Now you can proceed with tutorial //**<<to be added>>**//
 +
 +===== Acknowledgements =====
 +
 +{{ :acknowledgements-seronet.png |}}
 +{{ :acknowledgements-robmosys.png |}}
  
tutorials/flexible-navigation-stack-selenv/start.txt · Last modified: 2022/12/23 11:06 by 127.0.0.1

DokuWiki Appliance - Powered by TurnKey Linux