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

fix ci #95

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
5c4b9eb
fix rosmsg to json conversion (melodic)
benmaidel Jun 25, 2019
017ca0f
safely load yaml to get rid of yaml warning
benmaidel Jun 25, 2019
3b53a81
use yaml safe_load
benmaidel Jul 2, 2019
d2637d9
consider state as valid if input_key is same as parameter and paramet…
benmaidel Jul 2, 2019
8d06e11
update changelogs
fmessmer Nov 7, 2019
42e2303
2.2.2
fmessmer Nov 7, 2019
73bfc3f
switch default code indentation to 4 spaces
benmaidel Nov 12, 2019
958d467
Revert "2.2.2"
fmessmer Mar 24, 2020
2b96bf0
Revert "update changelogs"
fmessmer Mar 24, 2020
41733cb
Merge branch 'master' into mojin-devel
benmaidel Mar 24, 2020
d248008
Merge pull request #8 from benmaidel/mojin-devel
fmessmer Mar 25, 2020
ab4a54a
Bump CMake version to avoid CMP0048 warning
fmessmer Nov 28, 2020
21bba37
Replace travis ci by github actions
pschillinger Dec 11, 2020
4669eba
use package format2
fmessmer Jan 4, 2021
6220e30
Merge pull request #9 from fmessmer/test_noetic
fmessmer Jan 8, 2021
222d5e0
Merge branch 'develop' into sync
benmaidel Jan 12, 2021
1d86941
Merge pull request #11 from benmaidel/sync
fmessmer Jan 13, 2021
8b62d57
add nwjs mirror as download alternative
fmessmer Jan 29, 2021
ef457c7
Merge pull request #12 from fmessmer/fix/nwjs_install
fmessmer Jan 29, 2021
213438e
add missing dependencies of libnw.so
fmessmer Feb 2, 2021
473f24d
remove dependency libatspi2.0-dev
fmessmer Feb 3, 2021
ee3efcd
Merge pull request #13 from fmessmer/fix/missing_dependencies_libnw
fmessmer Feb 3, 2021
6035a6e
Add Industrial CI config and for Github Actions
LoyVanBeek Jun 29, 2021
34f8fe9
Fix issues found by catkin_lint
LoyVanBeek Jun 29, 2021
e1b7a8a
Remove outcommented lines in CMakeList for cleaner file
LoyVanBeek Jun 29, 2021
b6d0d97
No need to install any source files so no need to have src in catkin_…
LoyVanBeek Jun 29, 2021
4fda179
Make flexbe.desktop get installed and made executeable by the shortcu…
LoyVanBeek Jun 29, 2021
1e53418
Remove now obsolete flexbe_ci.yaml Github action file
LoyVanBeek Jun 30, 2021
60f4817
Merge pull request #15 from LoyVanBeek/use_industrial_ci
fmessmer Jun 30, 2021
dd0545d
enable directly accessing object attributes with a .
HannesBachter Feb 22, 2023
acd4164
Merge pull request #16 from HannesBachter/feature/get_attributes
fmessmer Mar 21, 2023
e6099d8
sync ci
fmessmer Jul 4, 2023
66224db
Merge pull request #17 from fmessmer/feature/ci_gha
fmessmer Jul 6, 2023
214576a
throw error if concurrent container has outcome 'preempted'
Deleh Jul 14, 2023
eff8d3f
Merge pull request #19 from Deleh/fix/concurrent_container_outcomes_c…
fmessmer Jul 17, 2023
873df62
Fix loading duplicate state without alias
pschillinger Sep 11, 2021
a3e0d59
Use class result for param replacement
pschillinger Sep 11, 2021
587958e
Updates for Melodic and Noetic release
dcconner May 18, 2023
8cf826d
merge PR #74, 76, 77; tweak CI workflow
May 19, 2023
56cf0b2
Merge pull request #18 from fmessmer/feature/sync_flexbe
fmessmer Jul 20, 2023
5daf2f0
use dev version identifier
Deleh Sep 18, 2023
28f4e5f
use custom url for version checks
Deleh Sep 20, 2023
fd03b2f
sync versions in package.json and package.xml
fmessmer Sep 21, 2023
dcee567
add note to sync versions
fmessmer Sep 21, 2023
47f3fef
Merge pull request #21 from Deleh/fix/version_check
fmessmer Sep 21, 2023
c2c31e3
update changelogs
fmessmer Sep 21, 2023
c638eee
2.4.2
fmessmer Sep 21, 2023
55a7f73
remove kinetic job
fmessmer Jan 17, 2024
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
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
pull_request:
schedule:
- cron: "0 0 * * 0" # every Sunday at midnight
workflow_dispatch:

jobs:
industrial_ci:
if: github.event.pull_request.draft == false # only run on non-draft PRs
runs-on: ubuntu-latest
timeout-minutes: 60

env:
ADDITIONAL_DEBS: 'apt-utils dialog'
CATKIN_LINT: pedantic
CMAKE_ARGS: -DCMAKE_BUILD_TYPE=Release
PARALLEL_TESTS: 1
PYLINT_ARGS: '--output-format=parseable --errors-only --disable=method-hidden'
PYLINT_CHECK: true
ROS_REPO: main

strategy:
matrix:
include:
- { ROS_DISTRO: noetic }

steps:
- uses: actions/checkout@v3
with:
lfs: true

- uses: ros-industrial/industrial_ci@master
with:
config: ${{toJSON(matrix)}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nwjs/
.*/**
.vscode/**
33 changes: 20 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
sudo: required
dist: xenial
language: generic
services:
- docker

before_install:
- git clone https://github.com/FlexBE/flexbe_ci.git ~/flexbe_ci
- source ~/flexbe_ci/setup.bash
- ~/flexbe_ci/ci_scripts/before_install.bash

notifications:
email:
on_success: change
on_failure: always
env:
global:
- ADDITIONAL_DEBS='apt-utils dialog'
- CATKIN_LINT=pedantic
- CMAKE_ARGS=-DCMAKE_BUILD_TYPE=Release
- PARALLEL_TESTS=1
- PYLINT_ARGS='--output-format=parseable --errors-only --disable=method-hidden'
- PYLINT_CHECK=true
- ROS_REPO=main
matrix:
- ROS_DISTRO=kinetic
- ROS_DISTRO=noetic
install:
- ~/flexbe_ci/ci_scripts/install.bash

before_script:
- ~/flexbe_ci/ci_scripts/before_script.bash

- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci -b master
script:
- ~/flexbe_ci/ci_scripts/script.bash
- .industrial_ci/travis.sh
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package flexbe_app
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.4.2 (2023-09-21)
------------------

2.4.0 (2023-05-18)
------------------
* Merge develop branch
* Updates for Melodic and Noetic releases on github.com/FlexBE

2.3.0 (2020-11-19)
------------------
Expand Down
38 changes: 8 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0.2)
project(flexbe_app)

find_package(catkin REQUIRED)

## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
#catkin_python_setup()

# specify catkin-specific information
# INCLUDE_DIRS - The exported include paths (i.e. cflags) for the package
# LIBRARIES - The exported libraries from the project
# CATKIN_DEPENDS - Other catkin projects that this project depends on
# DEPENDS - Non-catkin CMake projects that this project depends on
# CFG_EXTRAS - Additional configuration options
catkin_package(
INCLUDE_DIRS src
LIBRARIES ${PROJECT_NAME})

# use add_library() or add_executable() as required
#add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS})

#add_custom_target(nwjs_inst)
#add_custom_command(TARGET nwjs_inst POST_BUILD COMMAND bin/nwjs_install)
catkin_package()

add_custom_command(OUTPUT nwjs
COMMAND bin/nwjs_install
Expand All @@ -36,24 +17,22 @@ if(NOT ${CMAKE_CURRENT_SOURCE_DIR}/nwjs)
safe_execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/nwjs_install)
endif()

#############
## Install ##
#############

INSTALL(PROGRAMS
install(PROGRAMS
bin/nwjs_install
bin/run_app
bin/shortcut
bin/test_report
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
INSTALL(FILES
install(FILES
package.json
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
INSTALL(DIRECTORY
install(DIRECTORY
src
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
INSTALL(DIRECTORY
install(DIRECTORY
nwjs
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
USE_SOURCE_PERMISSIONS
Expand All @@ -63,7 +42,6 @@ install(DIRECTORY
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

# run tests
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest(launch/test_report.test)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017,
Copyright (c) 2017-2023,
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ User interface (editor + runtime control) for the FlexBE behavior engine.

Clone the following repos into your ROS workspace:

git clone https://github.com/team-vigir/flexbe_behavior_engine.git # if not already present
git clone https://github.com/FlexBE/flexbe_behavior_engine.git # if not already present
git clone https://github.com/FlexBE/flexbe_app.git

Build you workspace:
Expand Down Expand Up @@ -49,15 +49,7 @@ Use the following launch file to run both of the above for local behavior execut

## Backwards Compatibility

The FlexBE App in this repository replaces the previous *flexbe_chrome_app*. Please refer to the following announcement for an overview of the most important changes: [Future of the FlexBE Chrome App](https://github.com/pschillinger/flexbe_chrome_app/issues/11)

If you have been using FlexBE already with the old Chrome app, you can convert the content of your repository according to the structure defined below. Besides adding the export statement to your state packages, you can automate this conversion by running the FlexBE App. If no behavior package is detected, it will suggest you to initialize one.

---

Deprecated Chrome App branch: **deprecated/chrome_app**

*Please checkout the above branch on all repos if available for a best-effort support of the deprecated Chrome app. However, please consider to update as soon as possible according to the instructions below to ensure that the system will remain working in the future and to receive all updates.*
The FlexBE App in this repository replaces the previous *flexbe_chrome_app*.

---

Expand All @@ -77,7 +69,7 @@ A package is a state package for FlexBE if its `package.xml` declares the export
...
</package>

It is then expected to provide Python class definitions as described in [Developing Basic States](http://wiki.ros.org/flexbe/Tutorials/Developing%20Basic%20States). Example: [flexbe_states](https://github.com/team-vigir/flexbe_behavior_engine/tree/feature/flexbe_app/flexbe_states). Adding the above export statement is the only change to previous versions.
It is then expected to provide Python class definitions as described in [Developing Basic States](http://wiki.ros.org/flexbe/Tutorials/Developing%20Basic%20States). Example: [flexbe_states](https://github.com/FlexBE/flexbe_behavior_engine/tree/feature/flexbe_app/flexbe_states). Adding the above export statement is the only change to previous versions.

### Behavior packages

Expand Down
20 changes: 18 additions & 2 deletions bin/nwjs_install
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,23 @@ fi

# ready to go
echo "Downloading nwjs..."
curl -s -o $TEMPFILE https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz
set +e
main_uri="https://dl.nwjs.io/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $main_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$main_uri': $status"
echo "Using mirror instead..."
mirror_uri="https://npm.taobao.org/mirrors/nwjs/$VERSION/nwjs-$VERSION-$OS-$ARCH.tar.gz"
curl -sL -o $TEMPFILE $mirror_uri
status=$?
if [ $status -ne 0 ] ; then
echo "Failed to download '$mirror_uri': $status"
exit "$status"
fi
fi
set -e
echo -e "Successfully downloaded nwjs!"

echo "Unpacking..."
tar -xzf $TEMPFILE --strip-components 1
Expand All @@ -48,4 +64,4 @@ if [ -f nwjs_old/nw ]; then
rm -rf nwjs_old
fi

echo -e "Successfully downloaded nwjs!"
echo -e "Successfully installed nwjs!"
2 changes: 2 additions & 0 deletions bin/shortcut
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ if [ "$1" == "create" ] ; then
cd $(rospack find flexbe_app)
if [[ -z $2 ]] ; then
cp flexbe.desktop ~/.local/share/applications
chmod +x ~/.local/share/applications/flexbe.desktop
else
content=$(cat flexbe.desktop)
echo "${content/rosrun/$2; rosrun}" > ~/.local/share/applications/flexbe.desktop
chmod +x ~/.local/share/applications/flexbe.desktop
fi
if [[ ! -d ~/.local/share/icons ]] ; then
mkdir -p ~/.local/share/icons
Expand Down
Empty file modified flexbe.desktop
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FlexBE App",
"version": "2.3.0",
"version": "2.4.2",
"main": "src/main.js",
"window": {
"icon": "src/img/icon-128.png",
Expand Down
33 changes: 16 additions & 17 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<package>
<package format="2">
<name>flexbe_app</name>
<version>2.3.0</version>
<version>2.4.2</version>
<!-- NOTE: also sync the version in package.json when updating the version -->
<description>
flexbe_app provides a user interface (editor + runtime control) for the FlexBE behavior engine.
</description>
Expand All @@ -13,22 +14,20 @@
<buildtool_depend>catkin</buildtool_depend>

<build_depend>curl</build_depend>
<build_depend>rostest</build_depend>

<run_depend>libnss3-dev</run_depend>

<run_depend>rospy</run_depend>
<run_depend>genpy</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>rospack</run_depend>

<run_depend>flexbe_onboard</run_depend>
<run_depend>flexbe_mirror</run_depend>
<run_depend>flexbe_widget</run_depend>

<run_depend>std_msgs</run_depend>
<run_depend>flexbe_msgs</run_depend>
<exec_depend>actionlib</exec_depend>
<exec_depend>flexbe_mirror</exec_depend>
<exec_depend>flexbe_msgs</exec_depend>
<exec_depend>flexbe_onboard</exec_depend>
<exec_depend>flexbe_widget</exec_depend>
<exec_depend>genpy</exec_depend>
<exec_depend>gtk3</exec_depend> <!-- needed by libnw.so -->
<exec_depend>libnss3-dev</exec_depend>
<exec_depend>rospack</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>rospy_message_converter</exec_depend>
<exec_depend>std_msgs</exec_depend>

<test_depend>rosunit</test_depend>
<test_depend>rostest</test_depend>

</package>
35 changes: 26 additions & 9 deletions src/_helper/checking.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Checking = new (function() {
var that = this;

var python_varname_pattern = /^[a-z_][a-z0-9_]*$/i;
var python_reserved_list = ["and", "assert", "break", "class", "continue", "def", "del", "elif",
"else", "except", "exec", "finally", "for", "from", "global", "if",
"import", "in", "is", "lambda", "not", "or", "pass", "print",
var python_reserved_list = ["and", "assert", "break", "class", "continue", "def", "del", "elif",
"else", "except", "exec", "finally", "for", "from", "global", "if",
"import", "in", "is", "lambda", "not", "or", "pass", "print",
"raise", "return", "try", "while", "yield"];

this.checkBehavior = function() {
Expand Down Expand Up @@ -147,6 +147,10 @@ Checking = new (function() {
return "state machine " + statemachine.getStatePath() + " has no initial state";
}

if (statemachine.isConcurrent() && statemachine.getOutcomes().contains("preempted")) {
return "state machine " + statemachine.getStatePath() + " has outcome 'preempted' which is not permitted for concurrency statemachines";
}

for (var i = 0; i < states.length; i++) {
var error_string = undefined;
if (states[i] instanceof Statemachine) {
Expand Down Expand Up @@ -213,7 +217,11 @@ Checking = new (function() {
for (var i = 0; i < imap.length; i++) {
if (imap[i] == "") return "input key " + state.getInputKeys()[i] + " of state " + state.getStatePath() + " has empty value";
if (state instanceof BehaviorState && imap[i] == undefined) continue;
if (!imap[i].match(python_varname_pattern)) return "input key " + state.getInputKeys()[i] + " of state " + state.getStatePath() + " has invalid value: " + imap[i];
// when there is a "." in the key, assume we want to read the object's attribute, so check the individual fields
var field = imap[i].split(".")
for (var j = 0; j < field.length; j++) {
if (!field[j].match(python_varname_pattern)) return "input key " + state.getInputKeys()[i] + " of state " + state.getStatePath() + " has invalid value: " + field[j];
}
}
}

Expand All @@ -235,9 +243,18 @@ Checking = new (function() {
if (state.getContainer().getStateName() == "") {
available_userdata = available_userdata.concat(Behavior.getDefaultUserdata().map(function(el) { return el.key; }));
}
if (!available_userdata.contains(sm_dataflow[i].getOutcome())) {
if (!UI.Statemachine.isDataflow()) UI.Statemachine.toggleDataflow();
return "input key " + sm_dataflow[i].getOutcome() + " of state " + state.getStatePath() + " could be undefined";
// when there is a "." in the key, assume we want to read the object's attribute, so check only the object itself
var outcome = sm_dataflow[i].getOutcome().split(".")[0];
if (!available_userdata.contains(outcome)) {
var idx = state.getParameters().indexOf(sm_dataflow[i].getOutcome());
if (idx >= 0 && state.getParameterValues()[idx] != "None") {
T.logWarn("input key " + sm_dataflow[i].getOutcome() + " of state " + state.getStatePath() + " is overwritten by parameter with same name");
continue;
}
else {
if (!UI.Statemachine.isDataflow()) UI.Statemachine.toggleDataflow();
return "input key " + outcome + " of state " + state.getStatePath() + " could be undefined";
}
}
}

Expand Down Expand Up @@ -277,7 +294,7 @@ Checking = new (function() {

var close_stack = [];
var dot_last = false;

for (var i = 0; i < expr.length; i++) {
var c = expr[i];
if (dot_last && !c.match(/[a-z_0-9]/i)) return false;
Expand Down Expand Up @@ -312,4 +329,4 @@ Checking = new (function() {
return expr.match(python_varname_pattern) && !python_reserved_list.contains(expr);
}

}) ();
}) ();
6 changes: 3 additions & 3 deletions src/io/io_codegenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ IO.CodeGenerator = new (function() {
}
code += ws+ws+"# " + pos.join(", ") + "\n";
if (sm.isConcurrent()) {
code += ws+ws+ sm_name + " = ConcurrencyContainer(outcomes=['" + sm.getOutcomes().join("', '") + "']";
code += ws+ws+ sm_name + " = ConcurrencyContainer(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
} else if (sm.isPriority()) {
code += ws+ws+ sm_name + " = PriorityContainer(outcomes=['" + sm.getOutcomes().join("', '") + "']";
code += ws+ws+ sm_name + " = PriorityContainer(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
} else {
code += ws+ws+ sm_name + " = OperatableStateMachine(outcomes=['" + sm.getOutcomes().join("', '") + "']";
code += ws+ws+ sm_name + " = OperatableStateMachine(outcomes=[" + sm.getOutcomes().map(x => "'" + x + "'").join(", ") + "]";
}
if (sm.getInputKeys().length > 0) {
code += ", input_keys=['" + sm.getInputKeys().join("', '") + "']";
Expand Down
Loading