flexbe / flexbe_behavior_engine Goto Github PK
View Code? Open in Web Editor NEWContains the behavior engine FlexBE.
License: Other
Contains the behavior engine FlexBE.
License: Other
When creating a simple state that calls the list_controllers service (and others) in Humble, I am getting a TypeError exception "Invalid request type ListControllers_Request (vs. ListControllers) for topic /controller_manager/list_controllers"
. Here is the example state code:
#!/usr/bin/env python
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyServiceCaller
from controller_manager_msgs.srv import ListControllers
class CheckControllerLoaded(EventState):
'''
Checks if a given controller is loaded.
-- controller_name str name of controller to check.
<= true Controller is currently loaded.
<= false Controller is not loaded.
'''
def __init__(self, controller_name):
super(CheckControllerLoaded, self).__init__(
outcomes=['true', 'false'])
ProxyServiceCaller._initialize(CheckControllerLoaded._node)
self._controller_name = controller_name
self._srv_topic = '/controller_manager/list_controllers'
self._srv_result = None
self._error = None
def on_enter(self, userdata):
# Try to call service to list controllers
self._srv = ProxyServiceCaller(
{self._srv_topic: ListControllers}, wait_duration=5.0)
self._error = False
try:
request = ListControllers.Request()
self._srv_result = self._srv.call(self._srv_topic, request)
except Exception as e:
Logger.logerr(f"Exception {str(e)}")
self._error = True
def execute(self, userdata):
if (self._error) or (self._srv_result is None):
return 'false'
elif any(controller.name == self._controller_name for controller in self._srv_result.controller):
return 'true'
else:
return 'false'
def on_exit(self, userdata):
pass
I was able to get it to work with these modifications universal-field-robots/flexbe_behavior_engine@b3228b2. I would have made a PR for it however I don't think this solution is in line with the intent of recent changes made in proxy_service_caller.py @ 345e65c
According to the help of the FlexibleCalculationState state, it requires a lambda function with a list argument (e.g., lambda x: x[0]^2 + x[1]^2
) but that gives following error message:
python <lambda>() got an unexpected keyword argument
What works though is a lambda function with multiple arguments (e.g., lambda x1,x2: x1^2 + x2^2
). However, the behavior cannot be saved because the checking function says:
Unable to save behavior: parameter calculation of state [...] has invalid value
My current workaround is to put any acceptable value in the calculation parameter field and put the correct, desired lambda function in the source code later. But this is quite tedious because it is always overwritten when the behavior is changed with the GUI.
Unable to connect to ROS master in galactic. What could be the reason
Currently SubscriberState do not have a parameter for specifying QOS profile and use QOS_DEFAULT
in underline subscriber. This prevents it from subscribing to topics with publishers using QoSReliabilityPolicy.BEST_EFFORT
If this is a welcome enhancement happy to open a PR with suggested enhancement.
python-six dependency introduced in team-vigir/flexbe_behavior_engine#102
Is causing issues for Humble release on RHEL.
Repeating question posted there for @pschillinger @fmessmer
What does six.moves.queue
have over standard queue
module?
I'd like to go back to queue
to avoid issue on ROS 2 release as RHEL does not have python-six.
Or is there some reason for python-six
and I should:
Implement team-vigir/flexbe_behavior_engine#161 here in both ROS 1 and ROS 2 versions
Time delay loop available at https://github.com/FlexBE/flexbe_behavior_engine/blob/iron/flexbe_widget/flexbe_widget/behavior_launcher.py#L266 is not enough to give time to _status_callback
to get called. So trying to launch behaviors with following command fails. (With ros2 launch flexbe_onboard behavior_onboard.launch.py
already called in a seperate terminal)
rosrun flexbe_widget be_launcher -b 'Example Behavior'
[INFO] [1716011288.849518090] [flexbe_widget]: 1 behaviors available, ready for start request.
Set up behavior_launcher with 'Example Behavior' ...
Add callback request for 'Example Behavior' ...
Run initial request of behavior_launcher spinner ...
[ERROR] [1716011288.974051574] [flexbe_widget]: Behavior engine is not ready - cannot process start request!
[INFO] [1716011288.974993184] [flexbe_widget]: Initial behavior launcher request is sent!
Start behavior_launcher spinner ...
[INFO] [1716011297.819500334] [flexbe_widget]: BE status code=20 received - READY for new behavior!
Increasing time delay to 0.02 or more (So total delay is 2s or more for loop of 100) seems to resolve the issue. (Or best is to wait till _ready_event.is_set()
or a max time out of 5sec.)
[INFO] [1716012112.849948804] [flexbe_widget]: 1 behaviors available, ready for start request.
Set up behavior_launcher with 'Example Behavior' ...
[INFO] [1716012113.442451071] [flexbe_widget]: BE status code=20 received - READY for new behavior!
Add callback request for 'Example Behavior' ...
Run initial request of behavior_launcher spinner ...
[INFO] [1716012114.903119699] [flexbe_widget]: Got message from request behavior for Example Behavior
[INFO] [1716012114.903953843] [flexbe_widget]: Processing request using behavior 'Example Behavior' from package='example_flexbe_behaviors' with key=1205735444 ...
[INFO] [1716012114.905562292] [flexbe_widget]: Check for behavior change ...
[INFO] [1716012114.906543963] [flexbe_widget]: No changes to behavior version - restart
[INFO] [1716012114.907227931] [flexbe_widget]: Initial behavior launcher request is sent!
Start behavior_launcher spinner ...
``
Hello,
I am using ros2-devel branch for Galactic. The command ros2 launch flexbe_onboard behavior_onboard.launch.py use_sim_time:=False
raises the error below:
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [start_behavior-1]: process started with pid [1000498]
[start_behavior-1] Traceback (most recent call last):
[start_behavior-1] File "/home/zeid/ariac_eval_ws/install/flexbe_onboard/lib/flexbe_onboard/start_behavior", line 33, in <module>
[start_behavior-1] sys.exit(load_entry_point('flexbe-onboard==2.3.2', 'console_scripts', 'start_behavior')())
[start_behavior-1] File "/home/zeid/ariac_eval_ws/install/flexbe_onboard/lib/python3.8/site-packages/flexbe_onboard/start_behavior.py", line 43, in main
[start_behavior-1] signal_handler_options=rclpy.signals.SignalHandlerOptions.NO) # We will handle shutdown
[start_behavior-1] AttributeError: module 'rclpy.signals' has no attribute 'SignalHandlerOptions'
This is due to signal_handler_options
not being recognized in the following snippet.
rclpy.init(args=args, signal_handler_options=rclpy.signals.SignalHandlerOptions.NO)
Look into fmessmer/flexbe_behavior_engine@528dc08
The InputState
state:
BehaviorInput
:from flexbe_msgs.action import BehaviorInput
. And other usages of BehaviorInputAction
should be replaced with BehaviorInput
.This should be changed as self._msg_type = msg_type
Hi,
I am investigating a build failure that we are seeing in building flexbe_mirror when building ROS 2 for OpenEmbedded / Yocto Project: ros/meta-ros#1077
I used the official ROS2 container images to investigate how the flexbe_mirror and mirror_state console scripts behave normally. When I tried to run the scripts directly it seems like the entry point may not be set properly:
/opt/ros/humble/lib/flexbe_mirror/flexbe_mirror
Traceback (most recent call last):
File "/opt/ros/humble/lib/flexbe_mirror/flexbe_mirror", line 33, in <module>
sys.exit(load_entry_point('flexbe-mirror==2.3.3', 'console_scripts', 'flexbe_mirror')())
TypeError: 'module' object is not callable
I could be mistaken, but I believe that [lines 25 and 26 of the setup.py for flexbe_mirror and mirror_state may be unnecessary as "behavior_mirror_sm" seems to use the FlexbeMirror and MirrorState classes and the other scripts do not have a main() entry point.
Cheers,
Rob
The iron, rolling, and ros2-devel branches have the concurrency container and state id changes as version 3.0.0
For consistency you need version 4.0+ of the UI (flexbe_app and soon the flexbe_webui) and 3.0+ of the flexbe_behavior_engine
See discussion in FlexBE/flexbe_app#88 for more details
I am able to set up, issue goals through, and get a result from an action client via the ActionClientProxy, but when I attempt to get the goal status I see 'ActionClient' object has no attribute 'status'
.
I can instead capture the result of the action through get_result()
and do some error checking on that, but is there a way to check the goal status in an action-agnostic sense?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.