Skip to content

Commit

Permalink
Merge branch 'devel' into release/1.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Oct 9, 2019
2 parents abc265e + 6f4fa4d commit 90dd70b
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Forthcoming
-----------
* ...

1.2.1 (2019-10-08)
------------------
* [trees] bugfix KeyError on publication of missing keys, `#118 <https://github.com/splintered-reality/py_trees_ros/pull/118>`_
* [utilities] a ros myargv stipper, a'la ROS1 style, until something is available upstream

1.2.0 (2019-10-02)
------------------
* [blackboards] sweeping changes to accomodate the new blackboards with tracking, `#109 <https://github.com/splintered-reality/py_trees_ros/pull/109>`_
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# The short X.Y version.
version = "1.2"
# The full version, including alpha/beta/rc tags.
release = "1.2.0"
release = "1.2.1"

##############################################################################
# Regular Sphinx Configuration
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>py_trees_ros</name>
<version>1.2.0</version>
<version>1.2.1</version>
<description>
ROS2 extensions and behaviours for py_trees.
</description>
Expand Down
7 changes: 6 additions & 1 deletion py_trees_ros/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,17 @@ def _publish_serialised_tree(self):
client_ids=self.snapshot_visitor.visited.keys()
)
for key in visited_keys:
try:
value = str(py_trees.blackboard.Blackboard.get(key))
except KeyError:
value = "-"
tree_message.blackboard_on_visited_path.append(
diagnostic_msgs.KeyValue(
key=key,
value=str(py_trees.blackboard.Blackboard.get(key))
value=value
)
)

if py_trees.blackboard.Blackboard.activity_stream is not None:
tree_message.blackboard_activity_stream = py_trees.display.unicode_blackboard_activity_stream()
# other
Expand Down
32 changes: 30 additions & 2 deletions py_trees_ros/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

import os
import pathlib
import re
import sys

import py_trees_ros_interfaces.msg as py_trees_msgs
import py_trees_ros_interfaces.srv as py_trees_srvs
import py_trees_ros_interfaces.msg as py_trees_msgs # noqa
import py_trees_ros_interfaces.srv as py_trees_srvs # noqa
import rclpy
import rclpy.node
import rclpy.qos
Expand Down Expand Up @@ -209,6 +211,32 @@ def create_anonymous_node_name(node_name="node") -> str:
"""
return node_name + "_" + str(time.monotonic()).replace('.', '')


REMAP_PATTERN = re.compile('^([\~\/A-Za-z]|_|__)[\w\/]*' + ":=" + '.*')


def myargv(argv: typing.List[str]=None):
"""
Need something like this upstreamed in rclpy. The original ROS1 versions
thereof can be found at:
- https://github.com/ros/ros_comm/blob/melodic-devel/clients/rospy/src/rospy/client.py#L77
- https://github.com/ros/ros_comm/blob/melodic-devel/tools/rosgraph/src/rosgraph/names.py#L246
Args:
argv:
"""
if argv is None:
argv = sys.argv

def is_legal_remap(arg):
if arg is None:
return False
m = REMAP_PATTERN.match(arg)
return m is not None and m.group(0) == arg

return [a for a in argv if not is_legal_remap(a)]


##############################################################################
# Convenience Classes
##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion py_trees_ros/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# Version
##############################################################################

__version__ = '1.2.0'
__version__ = '1.2.1'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name=package_name,
version='1.2.0', # also package.xml, doc/conf.py, py_trees_ros/version.py
version='1.2.1', # also package.xml, doc/conf.py, py_trees_ros/version.py
packages=find_packages(
exclude=['doc*', 'tests*', 'graveyard*', 'scripts*']
),
Expand Down

0 comments on commit 90dd70b

Please sign in to comment.