diff --git a/.gitignore b/.gitignore index 2c0b2c2..2981c36 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ nwjs/ +.*/** diff --git a/launch/flexbe_full.launch b/launch/flexbe_full.launch index e3c8a0f..ba897dc 100644 --- a/launch/flexbe_full.launch +++ b/launch/flexbe_full.launch @@ -2,8 +2,11 @@ + + + diff --git a/launch/flexbe_ocs.launch b/launch/flexbe_ocs.launch index 849f3f0..dc6cc9c 100644 --- a/launch/flexbe_ocs.launch +++ b/launch/flexbe_ocs.launch @@ -7,9 +7,11 @@ + + - + diff --git a/src/_helper/checking.js b/src/_helper/checking.js index f9531cc..b16b091 100644 --- a/src/_helper/checking.js +++ b/src/_helper/checking.js @@ -20,6 +20,22 @@ Checking = new (function() { return error; } + try { + // this needs to work when starting a behavior + Behavior.createStructureInfo(); + } catch (error) { + var container_path = error.path.replace("/"+error.path.split("/").pop(), ""); + var container = Behavior.getStatemachine().getStateByPath(container_path); + if (container instanceof BehaviorState) { + error.error += "
Note: Since this error is inside a contained behavior, please open this behavior directly and fix it there."; + error.error += "
Affected behavior: " + container.getBehaviorName(); + container = container.getBehaviorStatemachine(); + } + UI.Statemachine.setDisplayedSM(container); + UI.Menu.toStatemachineClicked(); + return error.error; + } + return undefined; } diff --git a/src/_model/behavior.js b/src/_model/behavior.js index df71c7f..ab1dd4b 100644 --- a/src/_model/behavior.js +++ b/src/_model/behavior.js @@ -341,6 +341,7 @@ Behavior = new (function() { var result = []; createStateStructure(root_sm, result); + return result; } @@ -349,31 +350,35 @@ Behavior = new (function() { result.path = s.getStatePath(); result.outcomes = s.getOutcomes(); result.transitions = []; - if (s.getContainer() != undefined) { - result.autonomy = s.getAutonomy(); - var transitions = s.getContainer().getTransitions(); - for (var i=0; i { + for (var j=0; j (Behavior)
"; + doc += WS.Behaviorlib.getByName(state.getBehaviorName()).getBehaviorDesc() + "
"; } else if (WS.Statelib.getFromLib(state_type) != undefined) { doc += "" + state_type + "
"; doc += WS.Statelib.getFromLib(state_type).getStateDesc() + "
"; @@ -224,6 +236,11 @@ UI.RuntimeControl = new (function() { doc += " (" + resolved + ")"; } } + doc += "

"; + doc += "Outcomes:
"; + WS.Statelib.getFromLib(state_type).getOutcomeDesc().forEach(outcome => { + doc += "
" + outcome.name + ": " + outcome.desc + "
"; + }); } document.getElementById("runtime_documentation_text").innerHTML = doc; @@ -501,7 +518,7 @@ UI.RuntimeControl = new (function() { }); var selection_box = document.getElementById("selection_rc_autonomy"); var autonomy_value = parseInt(selection_box.options[selection_box.selectedIndex].value); - RC.PubSub.sendBehaviorStart(param_keys, param_vals, autonomy_value); + RC.PubSub.sendBehaviorStart(param_keys, param_vals, autonomy_value); }); } diff --git a/src/window.html b/src/window.html index ab34006..1d91d67 100644 --- a/src/window.html +++ b/src/window.html @@ -369,12 +369,12 @@

No connection!

  • Make sure the onboard behavior engine is running in the current ROS environment. You can start it with the following command:
    - +

  • Make sure that operator control software is running for starting a behavior and monitoring its execution. You can start it with the following command:
    - +

  • diff --git a/src/ws/ws_statelib.js b/src/ws/ws_statelib.js index fdb02eb..af79b57 100644 --- a/src/ws/ws_statelib.js +++ b/src/ws/ws_statelib.js @@ -16,9 +16,9 @@ WS.Statelib = new (function() { } } - this.getClassFromLib = function(state_class) { + this.getClassFromLib = function(state_class, filter_function) { for (var i=0; i