Skip to content

add additional py-trees composites #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ def visit_do_member(self, node: DoMember):
behavior = py_trees.composites.Parallel(name=name, policy=py_trees.common.ParallelPolicy.SuccessOnAll())
elif composition_operator == "one_of":
behavior = py_trees.composites.Parallel(name=name, policy=py_trees.common.ParallelPolicy.SuccessOnOne())
# support for composites not available in osc2
elif composition_operator == "selector":
behavior = py_trees.composites.Selector(name=name, memory=True)
elif composition_operator == "selector_no_memory":
behavior = py_trees.composites.Selector(name=name, memory=False)
elif composition_operator == "serial_no_memory":
behavior = py_trees.composites.Sequence(name=name, memory=False)
else:
raise NotImplementedError(f"scenario operator {composition_operator} not yet supported.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ composition : compositionOperator (OPEN_PAREN argumentList? CLOSE_PAREN)?':' NEW
doMember+ DEDENT (behaviorWithDeclaration)?;

compositionOperator
: 'serial' | 'one_of' | 'parallel';
: 'serial' | 'one_of' | 'parallel' | 'serial_no_memory' | 'selector' | 'selector_no_memory';

behaviorInvocation
: (actorExpression '.')? behaviorName OPEN_PAREN (argumentList)? CLOSE_PAREN (behaviorWithDeclaration | NEWLINE);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,26 @@ T__84=85
T__85=86
T__86=87
T__87=88
NEWLINE=89
OPEN_BRACK=90
CLOSE_BRACK=91
OPEN_PAREN=92
CLOSE_PAREN=93
SKIP_=94
BLOCK_COMMENT=95
LINE_COMMENT=96
StringLiteral=97
FloatLiteral=98
UintLiteral=99
HexUintLiteral=100
IntLiteral=101
BoolLiteral=102
Identifier=103
INDENT=104
DEDENT=105
T__88=89
T__89=90
T__90=91
NEWLINE=92
OPEN_BRACK=93
CLOSE_BRACK=94
OPEN_PAREN=95
CLOSE_PAREN=96
SKIP_=97
BLOCK_COMMENT=98
LINE_COMMENT=99
StringLiteral=100
FloatLiteral=101
UintLiteral=102
HexUintLiteral=103
IntLiteral=104
BoolLiteral=105
Identifier=106
INDENT=107
DEDENT=108
'import'=1
'.'=2
'type'=3
Expand Down Expand Up @@ -160,38 +163,41 @@ DEDENT=105
'serial'=55
'one_of'=56
'parallel'=57
'wait'=58
'emit'=59
'call'=60
'until'=61
'def'=62
'->'=63
'expression'=64
'undefined'=65
'external'=66
'only'=67
'cover'=68
'record'=69
'range'=70
'?'=71
'=>'=72
'or'=73
'and'=74
'not'=75
'!='=76
'<'=77
'<='=78
'>'=79
'>='=80
'in'=81
'+'=82
'-'=83
'*'=84
'/'=85
'%'=86
'it'=87
'..'=88
'['=90
']'=91
'('=92
')'=93
'serial_no_memory'=58
'selector'=59
'selector_no_memory'=60
'wait'=61
'emit'=62
'call'=63
'until'=64
'def'=65
'->'=66
'expression'=67
'undefined'=68
'external'=69
'only'=70
'cover'=71
'record'=72
'range'=73
'?'=74
'=>'=75
'or'=76
'and'=77
'not'=78
'!='=79
'<'=80
'<='=81
'>'=82
'>='=83
'in'=84
'+'=85
'-'=86
'*'=87
'/'=88
'%'=89
'it'=90
'..'=91
'['=93
']'=94
'('=95
')'=96

Large diffs are not rendered by default.

824 changes: 424 additions & 400 deletions scenario_execution/scenario_execution/osc2_parsing/OpenSCENARIO2Lexer.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,24 @@ T__84=85
T__85=86
T__86=87
T__87=88
NEWLINE=89
OPEN_BRACK=90
CLOSE_BRACK=91
OPEN_PAREN=92
CLOSE_PAREN=93
SKIP_=94
BLOCK_COMMENT=95
LINE_COMMENT=96
StringLiteral=97
FloatLiteral=98
UintLiteral=99
HexUintLiteral=100
IntLiteral=101
BoolLiteral=102
Identifier=103
T__88=89
T__89=90
T__90=91
NEWLINE=92
OPEN_BRACK=93
CLOSE_BRACK=94
OPEN_PAREN=95
CLOSE_PAREN=96
SKIP_=97
BLOCK_COMMENT=98
LINE_COMMENT=99
StringLiteral=100
FloatLiteral=101
UintLiteral=102
HexUintLiteral=103
IntLiteral=104
BoolLiteral=105
Identifier=106
'import'=1
'.'=2
'type'=3
Expand Down Expand Up @@ -158,38 +161,41 @@ Identifier=103
'serial'=55
'one_of'=56
'parallel'=57
'wait'=58
'emit'=59
'call'=60
'until'=61
'def'=62
'->'=63
'expression'=64
'undefined'=65
'external'=66
'only'=67
'cover'=68
'record'=69
'range'=70
'?'=71
'=>'=72
'or'=73
'and'=74
'not'=75
'!='=76
'<'=77
'<='=78
'>'=79
'>='=80
'in'=81
'+'=82
'-'=83
'*'=84
'/'=85
'%'=86
'it'=87
'..'=88
'['=90
']'=91
'('=92
')'=93
'serial_no_memory'=58
'selector'=59
'selector_no_memory'=60
'wait'=61
'emit'=62
'call'=63
'until'=64
'def'=65
'->'=66
'expression'=67
'undefined'=68
'external'=69
'only'=70
'cover'=71
'record'=72
'range'=73
'?'=74
'=>'=75
'or'=76
'and'=77
'not'=78
'!='=79
'<'=80
'<='=81
'>'=82
'>='=83
'in'=84
'+'=85
'-'=86
'*'=87
'/'=88
'%'=89
'it'=90
'..'=91
'['=93
']'=94
'('=95
')'=96
Loading
Loading