splintered-reality / rqt_py_trees Goto Github PK
View Code? Open in Web Editor NEWVisualisation of behaviour trees with an rqt plugin in ROS
License: Other
Visualisation of behaviour trees with an rqt plugin in ROS
License: Other
Nice idea for a feature from @pirobot. Should also remember settings from one run to the next on the chance the user starts the same tree.
Not likely to happen in the ROS1 version, unless someone sends a PR. New work likely to be going into whatever we build for ROS2.
When installing the py_trees suite from the ROS repos and trying to run the tutorials I get:
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/rqt_py_trees/rqt_py_trees", line 10, in <module>
from rqt_py_trees.behaviour_tree import RosBehaviourTree
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_py_trees/__init__.py", line 16, in <module>
from . import behaviour_tree
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_py_trees/behaviour_tree.py", line 55, in <module>
from qt_dotgraph.dot_to_qt import DotToQtGenerator
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_py_trees/qt_dotgraph/__init__.py", line 21, in <module>
from . import dot_to_qt
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_py_trees/qt_dotgraph/dot_to_qt.py", line 23, in <module>
import pygraphviz
ImportError: No module named pygraphviz
Fixed with #11 . Until pushed to the repos the package can be cloned and then the dependency can be resolved by running rosdep (rosdep install --from-paths (path of package or workspace) --ignore-src --rosdistro=$ROS_DISTRO -y)
See #2 for some rants about this package. It's buggy, poorly does the multi-package abstraction and incomplete with respect to dot functionality.
I've imported this internally for the moment, but I'd like this to go back upstream eventually. Just the amount of work we have to do on it would take forever to push upstream and probably require quite some ping pong. Need to consider how to do this cleanly.
Whenever it gets a new message, the gui 'hang's for a second or two...sometimes more if there is a flurry of new messages.
For demo launching purposes, it would be nice to start rqt_py_trees
with an optional argument that specifies the topic name to start subscribing to. For example, either or both of these:
rqt_py_trees --topic /my_node/log/tree
rosrun rqt_py_trees topic:=/my_node/log/tree
Otherwise, even if you make a launch file that automatically launches rqt_py_trees
, users have to manually change the topic drop-down to the right topic.
The behavior could either be to wait for the desired topic to send a message, or if the topic isn't available to assume "none" and open rqt_py_trees
as normal.
This would be useful to have for users who don't need or want to look at the code directly. Also useful for educational purposes to allow people to play around with the tree and see what effects changing things has without having to touch code.
This would be a python parser and a template generator which generates code for trees based on some internal structure. Use the parser to read behaviour definitions in user specified directories and make the behaviours available with names, variables and so on, all of which can be modified in the editor. Would also need to consider decorators. Once the tree is finished, have an export button which generates a python file containing the code to generate the whole tree. An option to specify subtrees would probably be nice, so that separate classes can be generated for distinct parts of the tree, or those which might be repeated.
The trees would be modifiable using the mouse. Dragging a behaviour moves it and all of its children around, and releasing the mouse drops it in as a child of the closest behaviour on the level above. Will need to use the positions of all other behaviours to determine the changed status. Selecting a behaviour gives access to a pop-up window or a sidebar which displays all of the initialisation variables of the behaviour, and allows them to be specified. Should also be able to apply decorators to the behaviour from this window.
Hello!
I am running py-trees on ROS Melodic 0.5.x version. Successfully launched custom tree (it does what I want) but when I run rqt_py_trees there is no tree but only "No behavior data received". The tree topic is set correctly.
How to make it run? Thanks!
Import errors
It's a right mess and needs several days work on getting it into shape so we can actually extend it without fubar'ing it more. My recent efforts to quickly get blackboxes in really mucked it up is a great example - they neither work properly (can't rewind and change the blackbox level) and they stuff up the flow rather considerably.
Right now it dumps into ~/.config/ros.org/rqt_gui.ini
which gets rather borg like and barfs quite often whenever an rqt plugin misbehaves. We can't handle version changes either.
Should be easy enough to divert our own settings into it's own file.
Traceback (most recent call last):
File "/opt/groot/desktop_ws/devel/bin/rqt_py_trees", line 6, in <module>
exec(fh.read())
File "<string>", line 22, in <module>
File "/opt/ros/indigo/lib/python2.7/dist-packages/rqt_gui/main.py", line 59, in main
return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH'])))
File "/opt/ros/indigo/lib/python2.7/dist-packages/qt_gui/main.py", line 197, in main
self.add_arguments(parser, standalone=bool(standalone), plugin_argument_provider=plugin_argument_provider)
File "/opt/ros/indigo/lib/python2.7/dist-packages/qt_gui/main.py", line 147, in add_arguments
plugin_argument_provider(parser)
File "/opt/groot/desktop_ws/src/rqt_py_trees/src/rqt_py_trees/behaviour_tree.py", line 307, in add_arguments
operate_object.add_argument('-d', '--bag-dir', action='store', help='Specify the directory in which to look for bag files. The default is $ROS_HOME/behaviour_trees, if $ROS_HOME is set, or ~/.ros/behaviour_trees otherwise.')
File "/usr/lib/python2.7/argparse.py", line 1297, in add_argument
return self._add_action(action)
File "/usr/lib/python2.7/argparse.py", line 1498, in _add_action
action = super(_ArgumentGroup, self)._add_action(action)
File "/usr/lib/python2.7/argparse.py", line 1311, in _add_action
self._check_conflict(action)
File "/usr/lib/python2.7/argparse.py", line 1449, in _check_conflict
conflict_handler(action, confl_optionals)
File "/usr/lib/python2.7/argparse.py", line 1456, in _handle_conflict_error
raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument -d/--disable-init-threads: conflicting option string(s): -d
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.