URCap Contribution Generator

The URCap Contribution Generator can be used to generate a new URCap contribution project.

Creating a new URCap Contribution

To create a new URCap Contribution run the follow script:

./newurcap.sh

A prompt will appear and query for the required information to build the new contribution.

The information required is:

  • Include a Web Contribution (frontend) Select ‘Y’ to include a Web frontend Contribution

  • Include a Docker Container Contribution (backend) Select ‘Y’ to include an empty Docker backend Contribution

  • ROS2 Docker Support If ‘Y’ was answered to Include a Docker Container Contribution (backend), then choose if this Docker Contribution should be configured for ROS2 Support.

  • Name of Vendor Name of the Company creating the contribution, like: My Company Will be written into the ‘manifest.yaml’ file

  • Id of Vendor Id of company, like: com.my-company Will be written into the ‘manifest.yaml’ file and used as part of the path to the resource files

  • Name of URCap Contribution UR Plus contribution name, like: My gripper Will be written into the ‘manifest.yaml’ file

  • Id of URCap Contribution Id of UR Plus contribution, like: mygripper Used for creating the folder containing the sample. Will be written into the ‘manifest.yaml’ file and used as part of the path to the resource files

  • Contribution type Select ‘Angular’ or ‘JavaScript’. The samples included in the SDK are written in Angular.

  • Include Program Node Select ‘Y’ to include a program node in the contribution

  • Program node name If ‘Y’ was answered to include a program node then enter its name, like: my-prg Will be written into the ‘contribution.json’ and used in the ‘app.module.ts’ file in Angular

  • Include Application Node Select ‘Y’ to include an application node in the contribution

  • Application node name If ‘Y’ was answered to include an application node then enter its name, like: my-app Will be written into the ‘contribution.json’ and used in the ‘app.module.ts’ file in Angular

A folder will be created with the same name as the entered Id of the new URCap Contribution and the selected template files will be copied into this folder.

For further details about ‘manifest.yaml’ and ‘contribution.json’ see How to configure, package and install a contribution.

Example of a folder structure if an Angular ‘mygripper’ sample is created. Only the important files are listed:

   mygripper/
   ├── manifest.yaml
   ├── package.json
   ├── npm/
   └── src/
       ├── contribution.json
       ├── environments/
       ├── app/
       │   ├── app.module.ts
       │   └── components/
       │       ├── my-app/
       │       │   ├── my-app.behavior.worker.ts
       │       │   ├── my-app.component.html
       │       │   ├── my-app.component.scss
       │       │   ├── my-app.component.ts
       │       │   └── my-app.node.ts
       │       └── my-prg/
       │           ├── my-prg.behavior.worker.ts
       │           ├── my-prg.component.html
       │           ├── my-prg.component.scss
       │           ├── my-prg.component.ts
       │           └── my-prg.node.ts
       └── assets/
           ├── i18n/
           └── icons/

Example of a folder structure if the ‘mygripper’ contribution contains a Docker backend and a JavaScript frontend. Only the important files are listed:

   mygripper/
   ├── manifest.yaml
   ├── mygripper-backend/
   │   ├── Dockerfile
   │   └── package.json
   ├── mygripper-frontend/
   │   ├── npm/
   │   ├── package.json
   │   ├── src/
   │   │   ├── application/
   │   │   │   ├── my-app.behavior.worker.js
   │   │   │   └── my-app.component.js
   │   │   ├── assets/
   │   │   │   ├── i18n/
   │   │   │   └── icons/
   │   │   ├── contribution.json
   │   │   └── program/
   │   │       ├── my-prg.behavior.worker.js
   │   │       └── my-prg.component.js
   │   └── webpack.config.js
   └── package.json

Note that backend and frontend contributions are located in their own sub-folders.

Modify the new URCap Contribution

Change directory into the newly created folder. Modify the selected nodes and/or add new nodes. See How to create a Frontend Contribution.

Building the new URCap Contribution

Once the new contribution is done, it needs to be built. To build it, change directory into the newly created folder (where the package.json file is), and run the following commands:

npm install npm run build

The first command will download and install the required npm packages, this command is only required the first time or when package dependencies have changed in the ‘package.json’ file. The second command will build the new contribution, package it and place the final URCapX file in the target folder.

Testing URCap contributions

Please consult the installation guide for the PolyScope X simulator for instruction on how to install and run the simulator.

Only relevant for development environments running on ARM64

If the URCap has a container contribution, the container image produced by npm run build, will be an AMD64 image.

See section cpu-architecture for more about container compatibility here.