Skip to content

Commit

Permalink
Merge pull request #86 from FlexBE/noetic
Browse files Browse the repository at this point in the history
Noetic 2.4.1 release
  • Loading branch information
dcconner authored Apr 29, 2024
2 parents 2ef95e2 + 0cc05c4 commit be3a835
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 68 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/flexbe_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This is a basic workflow to help you get started with Actions
name: FlexBE CI
# Controls when the action will run.
on: [push, pull_request, workflow_dispatch]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
strategy:
matrix:
ros: [noetic]
include:
- os: ubuntu-20.04
ros: noetic
python: python3

runs-on: ${{ matrix.os }}
env:
ROS_DISTRO: ${{ matrix.ros }}
PYTHON: ${{ matrix.python }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Prepare CI
run: |
git clone https://github.com/FlexBE/flexbe_ci.git ~/flexbe_ci
source ~/flexbe_ci/setup.bash $ROS_DISTRO
- name: Install ROS
run: ~/flexbe_ci/ci_scripts/install_ros.bash
- name: Setup Workspace
run: ~/flexbe_ci/ci_scripts/setup_workspace.bash
- name: Clone FlexBE Repos
run: ~/flexbe_ci/ci_scripts/run_rosinstall.bash
- name: Test Create Repo
run: ~/flexbe_ci/ci_scripts/test_create_repo.bash
- name: Test Devel Workspace
run: ~/flexbe_ci/ci_scripts/run_devel_tests.bash
- name: Test Install Workspace
run: ~/flexbe_ci/ci_scripts/run_install_tests.bash
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
nwjs/
.*/**
.vscode/**
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package flexbe_app
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.4.1 (2023-05-22)
------------------
* merge PR `#74 <https://github.com/FlexBE/flexbe_app/issues/74>`_, 76, 77; tweak CI workflow
* Merge pull request `#60 <https://github.com/FlexBE/flexbe_app/issues/60>`_ from fmessmer/fix/catkin_lint
some catkin_lint fixes
* some catkin_lint fixes
* Contributors: David Conner, dcconner, fmessmer

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
30 changes: 8 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.0)
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})
catkin_package()

#add_custom_target(nwjs_inst)
#add_custom_command(TARGET nwjs_inst POST_BUILD COMMAND bin/nwjs_install)
Expand All @@ -40,20 +24,22 @@ 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 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
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

User interface (editor + runtime control) for the FlexBE behavior engine.

![FlexBE CI](https://github.com/FlexBE/flexbe_app/workflows/FlexBE%20CI/badge.svg?branch=noetic)

## Installation

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 +51,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 +71,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
11 changes: 7 additions & 4 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<package>
<name>flexbe_app</name>
<version>2.3.0</version>
<version>2.4.1</version>
<description>
flexbe_app provides a user interface (editor + runtime control) for the FlexBE behavior engine.
</description>
<maintainer email="schillin@kth.se">Philipp Schillinger</maintainer>
<author>Philipp Schillinger</author>
<maintainer email="philsplus@gmail.com">Philipp Schillinger</maintainer>
<maintainer email="robotics@cnu.edu">David Conner</maintainer>
<license>BSD</license>

<url>http://ros.org/wiki/flexbe_app</url>
<author>Philipp Schillinger</author>

<buildtool_depend>catkin</buildtool_depend>

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

<run_depend>libasound2-dev</run_depend>
<run_depend>libnss3-dev</run_depend>
<run_depend>libxss1</run_depend>

<run_depend>rospy</run_depend>
<run_depend>genpy</run_depend>
Expand All @@ -30,5 +32,6 @@
<run_depend>flexbe_msgs</run_depend>

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

</package>
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
16 changes: 9 additions & 7 deletions src/io/io_codeparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ IO.CodeParser = new (function() {
}


var parseCreateSection = function(code, only_interface) {
var parseCreateSection = function(code, only_interface, state_type_imports) {
// get root sm var name
var root_sm_name_result = code.match(return_sm_pattern);
if (root_sm_name_result == null) throw "could not identify root state machine";
Expand Down Expand Up @@ -344,7 +344,7 @@ IO.CodeParser = new (function() {
var idx = i * 2 + 1;
sm_states.push({
sm_name: sm_parts[idx],
sm_states: parseStates(sm_parts[idx+1])
sm_states: parseStates(sm_parts[idx+1], state_type_imports)
});
}

Expand Down Expand Up @@ -434,14 +434,14 @@ IO.CodeParser = new (function() {
}


var parseStates = function(code) {
var parseStates = function(code, state_type_imports) {
var code_splitted = code.split(state_begin_pattern);
if (code_splitted.length == 1) throw "a container does not contain any states"

var state_list = [];

for (var i=4; i<code_splitted.length; i+=4) {
var state_param_result = parseStateParams(helper_splitOnTopCommas(code_splitted[i]));
var state_param_result = parseStateParams(helper_splitOnTopCommas(code_splitted[i]), state_type_imports);
if (code_splitted[i-3] != undefined)
state_param_result.state_pos_x = parseInt(code_splitted[i-3]);
if (code_splitted[i-2] != undefined)
Expand All @@ -460,7 +460,7 @@ IO.CodeParser = new (function() {
return state_list;
}

var parseStateParams = function(params) {
var parseStateParams = function(params, state_type_imports) {
// get name
var state_name = helper_removeQuotes(params[0]);
var state_class = "";
Expand All @@ -474,7 +474,9 @@ IO.CodeParser = new (function() {
var class_result = params[1].match(state_class_pattern);
if (class_result != null) {
state_class = class_result[1];
var params_split = helper_splitOnTopCommas(params[1].replace(state_class, ""));
if (!state_class.includes("__") && state_type_imports != undefined && state_type_imports[state_class] != undefined)
state_class = state_type_imports[state_class] + "__" + state_class;
var params_split = helper_splitOnTopCommas(params[1].replace(class_result[1], ""));
params_split.forEach(function(element, i) {
var keyvalue = helper_splitKeyValue(element, "=");
if (keyvalue != undefined && !element.startsWith("lambda")) {
Expand Down Expand Up @@ -626,7 +628,7 @@ IO.CodeParser = new (function() {
var init_result = parseInitSection(code_init);

// parse create section
var create_result = parseCreateSection(code_create, false);
var create_result = parseCreateSection(code_create, false, top_result.state_type_imports);

// parse additional functions

Expand Down
6 changes: 4 additions & 2 deletions src/ros/ros.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ rospy.spin()

that.getPackagePythonPath = function(package_name, callback) {
var python_path = undefined;
var temp_package_path = undefined;
that.getPackageList((package_cache) => {
for (var i=0; i<package_cache.length; i++) {
if (package_cache[i]['name'] == package_name) {
python_path = package_cache[i]['python_path'];
temp_package_path = package_cache[i]['path'];
break;
}
}
Expand All @@ -105,7 +107,7 @@ rospy.spin()
callback(python_path);
});
} else {
var proc = spawn(python, ['-c', `import importlib; print(importlib.import_module('` + package_name + `').__path__[-1])`]);
var proc = spawn(python, ['-c', `import importlib; temp = importlib.import_module('` + package_name + `').__path__; path_index = next((i for i, x in enumerate(temp) if ('`+ temp_package_path +`' in x)), -1); print(temp[path_index])`]);
var path_data = '';
proc.stdout.on('data', data => {
path_data += data;
Expand Down Expand Up @@ -143,4 +145,4 @@ rospy.spin()
// });
// }

}) ();
}) ();

0 comments on commit be3a835

Please sign in to comment.