Skip to content
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

Add Fault Injection from Behavior Tree Specification #23

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 1 addition & 1 deletion scenarios/gs_straight_road_cutin_scenario.osm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<tag k='agentspeed' v='7' />
</node>
<node id='-24' action='modify' visible='true' lat='49.00728001001' lon='8.45719531171'>
<tag k='btree' v='lanechange_scenario_tree' />
<tag k='btree' v='lane_change_scenario_tree' />
<tag k='gs' v='vehicle' />
<tag k='name' v='lane_change_vehicle' />
<tag k='orientation' v='325' />
Expand Down
4 changes: 2 additions & 2 deletions scenarios/trees/drive_tree.btree
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ behaviortree drive_tree:
condition goal ( reached_goal() )
maneuver stop_reached_goal ( MStopConfig() )
->
condition c_busy_lane( lane_occupied() )
condition c_busy_lane( lane_occupied(), error=0.0 )
maneuver m_follow_leading_v ( MFollowConfig() )
maneuver keep_velocity ( MVelKeepConfig(vel=MP(16.0,10,6)) )
maneuver keep_velocity ( MVelKeepConfig(vel=MP(16.0,10,6) ))
2 changes: 1 addition & 1 deletion scenarios/trees/lane_change_scenario_tree.btree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
behaviortree LaneChange:
?
->
condition lc( sim_time (repeat=False, tmin=3, tmax=10))
condition lc( sim_time (repeat=False, tmin=3, tmax=10), delay=0.1)
subtree lane_change_tree()
subtree drive_tree()
2 changes: 1 addition & 1 deletion sv/SVPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def run_planner_process(self, traffic_state_sharr, mplan_sharr, debug_shdata):

#log.info('Plan {} at time {} and FRENET STATE:'.format(self.vid, state_time))
#log.info((planner_state.vehicle_state.get_S(), planner_state.vehicle_state.get_D()))

#Maneuver Tick
if mconfig and planner_state.lane_config:
#replan maneuver
Expand Down
32 changes: 25 additions & 7 deletions sv/btree/BTreeLeaves.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,56 @@

from py_trees import *
import random
import time
from sv.ManeuverStatus import *
from sv.btree.BehaviorModels import *
from sv.ManeuverConfig import *
import sv.ManeuverUtils

#alternative:
class BCondition(behaviour.Behaviour):
def __init__(self, bmodel, name, condition, repeat=True, **kwargs):
def __init__(self, bmodel, name, condition, repeat=True, error=0, delay=0, **kwargs):
super(BCondition, self).__init__(name)
self.name = name
self.condition = condition
self.bmodel = bmodel
self.kwargs = kwargs
self.repeat = repeat
self.error = float(error)
self.delay = delay
self.trigger_time = True
self.triggered = False
self.tic = 0
self.toc = 0

def update(self):
self.logger.debug(" %s [BCondition::update()]" % self.name)
status = common.Status.FAILURE

#print("BCondition {} {}".format(self.name,self.kwargs))
if self.trigger_time:
self.tic = time.perf_counter()
self.trigger_time = False

self.toc = time.perf_counter()
elapsed_time = self.toc-self.tic

try:
if self.repeat or not self.triggered:
if self.bmodel.test_condition(self.condition, self.kwargs):
#print("SUCCESS")
status = common.Status.SUCCESS
self.triggered = True
p = random.random() > self.error
if elapsed_time >= self.delay:
self.trigger_time = True
# negate xor: invert result from test_condition
if not (p ^ self.bmodel.test_condition(self.condition, self.kwargs)):
status = common.Status.SUCCESS
self.triggered = True
else:
status = common.Status.RUNNING


except KeyError as e:
raise RuntimeError("Missing condition '" + self.name + "'.")

return status
return status


class ManeuverAction(behaviour.Behaviour):
Expand Down
10 changes: 7 additions & 3 deletions sv/btree/BTreeParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,15 @@ def exitManeuver(self, ctx):
self.exec_stack.append(s)
self.nodes += name + ","

# e.g. endpoint = BCondition(self.bmodel,"endpoint", "lane_occupied", args)
def exitCondition(self, ctx):
name = ctx.name().getText()
# e.g. endpoint = BCondition(self.bmodel,"endpoint", "lane_occupied", error=0.2, delay=0.8, args)
def exitCondition(self, ctx):
name = ctx.name().getText()
cconfig_name = ctx.cconfig().name().getText()
s = name + " = " + "BCondition(parser.bmodel," + "\"" + name + "\"" + "," + "\"" + cconfig_name + "\""
if ctx.error() != None:
s += ", " + ctx.error().getText()
if ctx.delay() != None:
s += ", " + ctx.delay().getText()
cconfig_params = ""
if hasattr(ctx.cconfig().params(), '__iter__'):
for param in ctx.cconfig().params(): cconfig_params += "," + param.getText()
Expand Down
4 changes: 3 additions & 1 deletion sv/btree/parser/BTreeDSL.g4
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ node : leafNode | nodeComposition;
nodeComposition : OPERATOR INDENT node+ DEDENT;
leafNode : (maneuver | condition | subtree) NL;

condition : 'condition' name '(' cconfig ')';
condition : 'condition' name '(' cconfig (',' error)? (',' delay)? ')';
maneuver : 'maneuver' name '(' mconfig ')';
subtree : 'subtree' name '(' (midconf (',' midconf)*)? ')';
midconf : mid '=' mconfig;

error : 'error' '=' FLOAT;
delay : 'delay' '=' FLOAT;

mconfig : name '(' params* ')';
cconfig : name '(' params* ')';
Expand Down
10 changes: 8 additions & 2 deletions sv/btree/parser/BTreeDSL.interp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ null
':'
'condition'
'('
','
')'
'maneuver'
'subtree'
','
'error'
'delay'
null
null
'='
Expand All @@ -28,6 +30,8 @@ null
null
null
null
null
null
OPERATOR
BOP
ATT
Expand All @@ -48,6 +52,8 @@ condition
maneuver
subtree
midconf
error
delay
mconfig
cconfig
mid
Expand All @@ -60,4 +66,4 @@ name


atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 19, 185, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 45, 10, 2, 3, 2, 5, 2, 48, 10, 2, 6, 2, 50, 10, 2, 13, 2, 14, 2, 51, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 5, 4, 60, 10, 4, 3, 5, 3, 5, 3, 5, 6, 5, 65, 10, 5, 13, 5, 14, 5, 66, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 5, 6, 74, 10, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 96, 10, 9, 12, 9, 14, 9, 99, 11, 9, 5, 9, 101, 10, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 7, 11, 112, 10, 11, 12, 11, 14, 11, 115, 11, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 7, 12, 122, 10, 12, 12, 12, 14, 12, 125, 11, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 7, 14, 134, 10, 14, 12, 14, 14, 14, 137, 11, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 147, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 7, 17, 154, 10, 17, 12, 17, 14, 17, 157, 11, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 7, 18, 165, 10, 18, 12, 18, 14, 18, 168, 11, 18, 3, 18, 3, 18, 3, 19, 7, 19, 173, 10, 19, 12, 19, 14, 19, 176, 11, 19, 3, 19, 3, 19, 7, 19, 180, 10, 19, 12, 19, 14, 19, 183, 11, 19, 3, 19, 2, 2, 20, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 2, 3, 3, 2, 12, 13, 2, 185, 2, 49, 3, 2, 2, 2, 4, 55, 3, 2, 2, 2, 6, 59, 3, 2, 2, 2, 8, 61, 3, 2, 2, 2, 10, 73, 3, 2, 2, 2, 12, 77, 3, 2, 2, 2, 14, 83, 3, 2, 2, 2, 16, 89, 3, 2, 2, 2, 18, 104, 3, 2, 2, 2, 20, 108, 3, 2, 2, 2, 22, 118, 3, 2, 2, 2, 24, 128, 3, 2, 2, 2, 26, 130, 3, 2, 2, 2, 28, 138, 3, 2, 2, 2, 30, 146, 3, 2, 2, 2, 32, 148, 3, 2, 2, 2, 34, 160, 3, 2, 2, 2, 36, 174, 3, 2, 2, 2, 38, 39, 7, 3, 2, 2, 39, 40, 5, 36, 19, 2, 40, 41, 7, 4, 2, 2, 41, 42, 7, 18, 2, 2, 42, 44, 5, 4, 3, 2, 43, 45, 7, 17, 2, 2, 44, 43, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 47, 3, 2, 2, 2, 46, 48, 7, 19, 2, 2, 47, 46, 3, 2, 2, 2, 47, 48, 3, 2, 2, 2, 48, 50, 3, 2, 2, 2, 49, 38, 3, 2, 2, 2, 50, 51, 3, 2, 2, 2, 51, 49, 3, 2, 2, 2, 51, 52, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 54, 7, 2, 2, 3, 54, 3, 3, 2, 2, 2, 55, 56, 5, 6, 4, 2, 56, 5, 3, 2, 2, 2, 57, 60, 5, 10, 6, 2, 58, 60, 5, 8, 5, 2, 59, 57, 3, 2, 2, 2, 59, 58, 3, 2, 2, 2, 60, 7, 3, 2, 2, 2, 61, 62, 7, 11, 2, 2, 62, 64, 7, 18, 2, 2, 63, 65, 5, 6, 4, 2, 64, 63, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 66, 67, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 69, 7, 19, 2, 2, 69, 9, 3, 2, 2, 2, 70, 74, 5, 14, 8, 2, 71, 74, 5, 12, 7, 2, 72, 74, 5, 16, 9, 2, 73, 70, 3, 2, 2, 2, 73, 71, 3, 2, 2, 2, 73, 72, 3, 2, 2, 2, 74, 75, 3, 2, 2, 2, 75, 76, 7, 17, 2, 2, 76, 11, 3, 2, 2, 2, 77, 78, 7, 5, 2, 2, 78, 79, 5, 36, 19, 2, 79, 80, 7, 6, 2, 2, 80, 81, 5, 22, 12, 2, 81, 82, 7, 7, 2, 2, 82, 13, 3, 2, 2, 2, 83, 84, 7, 8, 2, 2, 84, 85, 5, 36, 19, 2, 85, 86, 7, 6, 2, 2, 86, 87, 5, 20, 11, 2, 87, 88, 7, 7, 2, 2, 88, 15, 3, 2, 2, 2, 89, 90, 7, 9, 2, 2, 90, 91, 5, 36, 19, 2, 91, 100, 7, 6, 2, 2, 92, 97, 5, 18, 10, 2, 93, 94, 7, 10, 2, 2, 94, 96, 5, 18, 10, 2, 95, 93, 3, 2, 2, 2, 96, 99, 3, 2, 2, 2, 97, 95, 3, 2, 2, 2, 97, 98, 3, 2, 2, 2, 98, 101, 3, 2, 2, 2, 99, 97, 3, 2, 2, 2, 100, 92, 3, 2, 2, 2, 100, 101, 3, 2, 2, 2, 101, 102, 3, 2, 2, 2, 102, 103, 7, 7, 2, 2, 103, 17, 3, 2, 2, 2, 104, 105, 5, 24, 13, 2, 105, 106, 7, 13, 2, 2, 106, 107, 5, 20, 11, 2, 107, 19, 3, 2, 2, 2, 108, 109, 5, 36, 19, 2, 109, 113, 7, 6, 2, 2, 110, 112, 5, 26, 14, 2, 111, 110, 3, 2, 2, 2, 112, 115, 3, 2, 2, 2, 113, 111, 3, 2, 2, 2, 113, 114, 3, 2, 2, 2, 114, 116, 3, 2, 2, 2, 115, 113, 3, 2, 2, 2, 116, 117, 7, 7, 2, 2, 117, 21, 3, 2, 2, 2, 118, 119, 5, 36, 19, 2, 119, 123, 7, 6, 2, 2, 120, 122, 5, 26, 14, 2, 121, 120, 3, 2, 2, 2, 122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 126, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 127, 7, 7, 2, 2, 127, 23, 3, 2, 2, 2, 128, 129, 5, 36, 19, 2, 129, 25, 3, 2, 2, 2, 130, 135, 5, 28, 15, 2, 131, 132, 7, 10, 2, 2, 132, 134, 5, 28, 15, 2, 133, 131, 3, 2, 2, 2, 134, 137, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 27, 3, 2, 2, 2, 137, 135, 3, 2, 2, 2, 138, 139, 5, 36, 19, 2, 139, 140, 9, 2, 2, 2, 140, 141, 5, 30, 16, 2, 141, 29, 3, 2, 2, 2, 142, 147, 7, 14, 2, 2, 143, 147, 5, 36, 19, 2, 144, 147, 5, 32, 17, 2, 145, 147, 5, 34, 18, 2, 146, 142, 3, 2, 2, 2, 146, 143, 3, 2, 2, 2, 146, 144, 3, 2, 2, 2, 146, 145, 3, 2, 2, 2, 147, 31, 3, 2, 2, 2, 148, 149, 5, 36, 19, 2, 149, 150, 7, 6, 2, 2, 150, 155, 7, 14, 2, 2, 151, 152, 7, 10, 2, 2, 152, 154, 7, 14, 2, 2, 153, 151, 3, 2, 2, 2, 154, 157, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 155, 156, 3, 2, 2, 2, 156, 158, 3, 2, 2, 2, 157, 155, 3, 2, 2, 2, 158, 159, 7, 7, 2, 2, 159, 33, 3, 2, 2, 2, 160, 161, 7, 6, 2, 2, 161, 166, 7, 14, 2, 2, 162, 163, 7, 10, 2, 2, 163, 165, 7, 14, 2, 2, 164, 162, 3, 2, 2, 2, 165, 168, 3, 2, 2, 2, 166, 164, 3, 2, 2, 2, 166, 167, 3, 2, 2, 2, 167, 169, 3, 2, 2, 2, 168, 166, 3, 2, 2, 2, 169, 170, 7, 7, 2, 2, 170, 35, 3, 2, 2, 2, 171, 173, 7, 16, 2, 2, 172, 171, 3, 2, 2, 2, 173, 176, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 177, 3, 2, 2, 2, 176, 174, 3, 2, 2, 2, 177, 181, 7, 15, 2, 2, 178, 180, 7, 16, 2, 2, 179, 178, 3, 2, 2, 2, 180, 183, 3, 2, 2, 2, 181, 179, 3, 2, 2, 2, 181, 182, 3, 2, 2, 2, 182, 37, 3, 2, 2, 2, 183, 181, 3, 2, 2, 2, 18, 44, 47, 51, 59, 66, 73, 97, 100, 113, 123, 135, 146, 155, 166, 174, 181]
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 21, 191, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 47, 10, 2, 3, 2, 5, 2, 50, 10, 2, 6, 2, 52, 10, 2, 13, 2, 14, 2, 53, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 5, 4, 62, 10, 4, 3, 5, 3, 5, 3, 5, 6, 5, 67, 10, 5, 13, 5, 14, 5, 68, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 5, 6, 76, 10, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 5, 7, 86, 10, 7, 3, 7, 3, 7, 5, 7, 90, 10, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 106, 10, 9, 12, 9, 14, 9, 109, 11, 9, 5, 9, 111, 10, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 7, 13, 130, 10, 13, 12, 13, 14, 13, 133, 11, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 7, 14, 140, 10, 14, 12, 14, 14, 14, 143, 11, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 16, 7, 16, 152, 10, 16, 12, 16, 14, 16, 155, 11, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 5, 18, 164, 10, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 7, 19, 171, 10, 19, 12, 19, 14, 19, 174, 11, 19, 3, 19, 3, 19, 3, 20, 7, 20, 179, 10, 20, 12, 20, 14, 20, 182, 11, 20, 3, 20, 3, 20, 7, 20, 186, 10, 20, 12, 20, 14, 20, 189, 11, 20, 3, 20, 2, 2, 21, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 2, 3, 3, 2, 14, 15, 2, 190, 2, 51, 3, 2, 2, 2, 4, 57, 3, 2, 2, 2, 6, 61, 3, 2, 2, 2, 8, 63, 3, 2, 2, 2, 10, 75, 3, 2, 2, 2, 12, 79, 3, 2, 2, 2, 14, 93, 3, 2, 2, 2, 16, 99, 3, 2, 2, 2, 18, 114, 3, 2, 2, 2, 20, 118, 3, 2, 2, 2, 22, 122, 3, 2, 2, 2, 24, 126, 3, 2, 2, 2, 26, 136, 3, 2, 2, 2, 28, 146, 3, 2, 2, 2, 30, 148, 3, 2, 2, 2, 32, 156, 3, 2, 2, 2, 34, 163, 3, 2, 2, 2, 36, 165, 3, 2, 2, 2, 38, 180, 3, 2, 2, 2, 40, 41, 7, 3, 2, 2, 41, 42, 5, 38, 20, 2, 42, 43, 7, 4, 2, 2, 43, 44, 7, 20, 2, 2, 44, 46, 5, 4, 3, 2, 45, 47, 7, 19, 2, 2, 46, 45, 3, 2, 2, 2, 46, 47, 3, 2, 2, 2, 47, 49, 3, 2, 2, 2, 48, 50, 7, 21, 2, 2, 49, 48, 3, 2, 2, 2, 49, 50, 3, 2, 2, 2, 50, 52, 3, 2, 2, 2, 51, 40, 3, 2, 2, 2, 52, 53, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 55, 3, 2, 2, 2, 55, 56, 7, 2, 2, 3, 56, 3, 3, 2, 2, 2, 57, 58, 5, 6, 4, 2, 58, 5, 3, 2, 2, 2, 59, 62, 5, 10, 6, 2, 60, 62, 5, 8, 5, 2, 61, 59, 3, 2, 2, 2, 61, 60, 3, 2, 2, 2, 62, 7, 3, 2, 2, 2, 63, 64, 7, 13, 2, 2, 64, 66, 7, 20, 2, 2, 65, 67, 5, 6, 4, 2, 66, 65, 3, 2, 2, 2, 67, 68, 3, 2, 2, 2, 68, 66, 3, 2, 2, 2, 68, 69, 3, 2, 2, 2, 69, 70, 3, 2, 2, 2, 70, 71, 7, 21, 2, 2, 71, 9, 3, 2, 2, 2, 72, 76, 5, 14, 8, 2, 73, 76, 5, 12, 7, 2, 74, 76, 5, 16, 9, 2, 75, 72, 3, 2, 2, 2, 75, 73, 3, 2, 2, 2, 75, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 78, 7, 19, 2, 2, 78, 11, 3, 2, 2, 2, 79, 80, 7, 5, 2, 2, 80, 81, 5, 38, 20, 2, 81, 82, 7, 6, 2, 2, 82, 85, 5, 26, 14, 2, 83, 84, 7, 7, 2, 2, 84, 86, 5, 20, 11, 2, 85, 83, 3, 2, 2, 2, 85, 86, 3, 2, 2, 2, 86, 89, 3, 2, 2, 2, 87, 88, 7, 7, 2, 2, 88, 90, 5, 22, 12, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 92, 7, 8, 2, 2, 92, 13, 3, 2, 2, 2, 93, 94, 7, 9, 2, 2, 94, 95, 5, 38, 20, 2, 95, 96, 7, 6, 2, 2, 96, 97, 5, 24, 13, 2, 97, 98, 7, 8, 2, 2, 98, 15, 3, 2, 2, 2, 99, 100, 7, 10, 2, 2, 100, 101, 5, 38, 20, 2, 101, 110, 7, 6, 2, 2, 102, 107, 5, 18, 10, 2, 103, 104, 7, 7, 2, 2, 104, 106, 5, 18, 10, 2, 105, 103, 3, 2, 2, 2, 106, 109, 3, 2, 2, 2, 107, 105, 3, 2, 2, 2, 107, 108, 3, 2, 2, 2, 108, 111, 3, 2, 2, 2, 109, 107, 3, 2, 2, 2, 110, 102, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 112, 3, 2, 2, 2, 112, 113, 7, 8, 2, 2, 113, 17, 3, 2, 2, 2, 114, 115, 5, 28, 15, 2, 115, 116, 7, 15, 2, 2, 116, 117, 5, 24, 13, 2, 117, 19, 3, 2, 2, 2, 118, 119, 7, 11, 2, 2, 119, 120, 7, 15, 2, 2, 120, 121, 7, 16, 2, 2, 121, 21, 3, 2, 2, 2, 122, 123, 7, 12, 2, 2, 123, 124, 7, 15, 2, 2, 124, 125, 7, 16, 2, 2, 125, 23, 3, 2, 2, 2, 126, 127, 5, 38, 20, 2, 127, 131, 7, 6, 2, 2, 128, 130, 5, 30, 16, 2, 129, 128, 3, 2, 2, 2, 130, 133, 3, 2, 2, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 134, 3, 2, 2, 2, 133, 131, 3, 2, 2, 2, 134, 135, 7, 8, 2, 2, 135, 25, 3, 2, 2, 2, 136, 137, 5, 38, 20, 2, 137, 141, 7, 6, 2, 2, 138, 140, 5, 30, 16, 2, 139, 138, 3, 2, 2, 2, 140, 143, 3, 2, 2, 2, 141, 139, 3, 2, 2, 2, 141, 142, 3, 2, 2, 2, 142, 144, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 144, 145, 7, 8, 2, 2, 145, 27, 3, 2, 2, 2, 146, 147, 5, 38, 20, 2, 147, 29, 3, 2, 2, 2, 148, 153, 5, 32, 17, 2, 149, 150, 7, 7, 2, 2, 150, 152, 5, 32, 17, 2, 151, 149, 3, 2, 2, 2, 152, 155, 3, 2, 2, 2, 153, 151, 3, 2, 2, 2, 153, 154, 3, 2, 2, 2, 154, 31, 3, 2, 2, 2, 155, 153, 3, 2, 2, 2, 156, 157, 5, 38, 20, 2, 157, 158, 9, 2, 2, 2, 158, 159, 5, 34, 18, 2, 159, 33, 3, 2, 2, 2, 160, 164, 7, 16, 2, 2, 161, 164, 5, 38, 20, 2, 162, 164, 5, 36, 19, 2, 163, 160, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 163, 162, 3, 2, 2, 2, 164, 35, 3, 2, 2, 2, 165, 166, 5, 38, 20, 2, 166, 167, 7, 6, 2, 2, 167, 172, 7, 16, 2, 2, 168, 169, 7, 7, 2, 2, 169, 171, 7, 16, 2, 2, 170, 168, 3, 2, 2, 2, 171, 174, 3, 2, 2, 2, 172, 170, 3, 2, 2, 2, 172, 173, 3, 2, 2, 2, 173, 175, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 175, 176, 7, 8, 2, 2, 176, 37, 3, 2, 2, 2, 177, 179, 7, 18, 2, 2, 178, 177, 3, 2, 2, 2, 179, 182, 3, 2, 2, 2, 180, 178, 3, 2, 2, 2, 180, 181, 3, 2, 2, 2, 181, 183, 3, 2, 2, 2, 182, 180, 3, 2, 2, 2, 183, 187, 7, 17, 2, 2, 184, 186, 7, 18, 2, 2, 185, 184, 3, 2, 2, 2, 186, 189, 3, 2, 2, 2, 187, 185, 3, 2, 2, 2, 187, 188, 3, 2, 2, 2, 188, 39, 3, 2, 2, 2, 189, 187, 3, 2, 2, 2, 19, 46, 49, 53, 61, 68, 75, 85, 89, 107, 110, 131, 141, 153, 163, 172, 180, 187]
32 changes: 18 additions & 14 deletions sv/btree/parser/BTreeDSL.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@ T__4=5
T__5=6
T__6=7
T__7=8
OPERATOR=9
BOP=10
ATT=11
FLOAT=12
WORD=13
WS=14
NL=15
INDENT=16
DEDENT=17
T__8=9
T__9=10
OPERATOR=11
BOP=12
ATT=13
FLOAT=14
WORD=15
WS=16
NL=17
INDENT=18
DEDENT=19
'behaviortree'=1
':'=2
'condition'=3
'('=4
')'=5
'maneuver'=6
'subtree'=7
','=8
'='=11
','=5
')'=6
'maneuver'=7
'subtree'=8
'error'=9
'delay'=10
'='=13
Loading