Skip to content

Commit 86c03ed

Browse files
authored
Add basic usage to readme (#15)
Signed-off-by: Emerson Knapp <[email protected]>
1 parent b6c8f4f commit 86c03ed

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,25 @@ It provides the same benefits of conciseness, declarative style, while allowing
1313

1414
## Usage
1515

16-
TODO
16+
The available actions and substitutions are identical to XML and YAML launchfiles, with one caveat:
17+
18+
> [!NOTE]
19+
> Some launch Actions and their attributes use reserved Python keywords, the known cases are `for` Action and `if` attribute for conditions.
20+
> For all cases, an underscore `_` is added at the end: `for_`, `if_`.
21+
22+
Here is an example launchfile with a few features:
23+
24+
```py
25+
from launch_frontend_py import launch
26+
from launch_frontend_py.actions import arg, executable
27+
28+
29+
def generate_launch_description():
30+
return launch([
31+
arg(name='message', default='hello world'),
32+
arg(name='condition', default='True'),
33+
executable(cmd='echo $(var message)', output='both'),
34+
executable(cmd='echo hello conditional', if_='$(var condition)', output='both'),
35+
executable(cmd='echo hello not-condition', if_='$(not $(var condition))', output='both'),
36+
])
37+
```

0 commit comments

Comments
 (0)