{{ name }}
====================

Welcome to your new robot application!

What are the next steps?

## Customize your application

By default, the template does not do anything useful. However, it demonstrates
how to use *intents* to trigger behaviours or react to events.

*Intents* are usually generated by your robot's users. It can happen:
- through automatic perception (eg, someone approaches and seems to interact),
- through verbal interaction (eg, someone tells the robot to go somewhere)
- if available, through interactions with the touchscreen (eg, someone presses
  a button to trigger a behaviour).

Your application template already contains examples of each of these possible
interactions.

## Install on the robot

To install you app on the robot, you need to follow the following steps:

1. deploy your code to the robot using PAL's `deploy` tool.
2. install the webpages (if you are using any)

### Deploy the application controller to the robot

**To deploy the code to the robot, you have to run the following commands from
*inside* your PAL OS Developer Docker image**.

- from within the PAL OS Developer Docker image, go to root of the project
- run `ros2 run pal_deploy deploy --package {{ id }} {{ robot | lower
  }}-XXc` (replace `{{ robot | lower }}-XXc` by your actual robot)

You can now `ssh` onto the robot (`ssh pal@{{ robot | lower }}-XXc`, password
`pal`), and go to your project: `cd ~/deployed_ws/share/{{ id }}`

{% if (robot == "ari") %}

### Install the webpages

To install your webpages onto the robot, check `pages_only_ari/README.md`.

{% endif %}

## Run your application

`ssh` onto the robot (`ssh pal@{{ robot | lower }}-XXc`, password `pal`).

There are several ways to run the application:

1. Automatically launch the app and transition to an active state:

`ros2 launch {{ id }} {{ id }}.launch.py`

2. Manually run your application:

`ros2 run {{ id }} run_app`

3. Automatically start your application at startup:

To make your application run at startup, uncomment the related lines in
`setup.py` and reinstall the package. You can then start, stop or view the logs
of the application as a module. See [Application
management](https://docs.pal-robotics.com/sdk-dev/management/application-management)
for more details. 

### Testing

You can test the application from the terminal by sending some intents:

```
ros2 topic pub /intents hri_actions_msgs/msg/Intent "{intent: '__intent_perform_motion__', data: '{\"object\": \"inspect_surroundings\"}'}"
```

```
ros2 topic pub /intents hri_actions_msgs/msg/Intent "{intent: '__intent_say__', data: '{\"object\": \"hello how are you?\"}'}"
```

```
ros2 topic pub /intents hri_actions_msgs/msg/Intent "{intent: '__intent_engage_with__'}"
```

