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

0.8.1 #289

Merged
merged 57 commits into from
Aug 30, 2017
Merged

0.8.1 #289

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
b30db62
Added new parameters for topic and service security.
Oct 7, 2016
1e3c187
Two minor fixes.
Oct 13, 2016
df67557
Fixed time object field definitions to match documentation.
Oct 27, 2016
cbbc7c1
As per the suggestions of @T045T, fixed several typos, improved loggi…
Oct 27, 2016
e6281f2
Merge branch 'develop' of https://github.com/MasterEric/rosbridge_sui…
Oct 27, 2016
4417d44
Merge pull request #242 from MasterEric/timefix
T045T Nov 7, 2016
630e566
Added services_glob to CallServices, added globs to rosbridge_tcp and…
Nov 10, 2016
eb9aea1
Merge https://github.com/RobotWebTools/rosbridge_suite into develop
Nov 10, 2016
1d38d05
Merge pull request #238 from MasterEric/develop
T045T Nov 14, 2016
e36d8a2
add missing imports and correct default values for glob parameters
T045T Nov 15, 2016
1112937
correct default values for security globs
T045T Nov 15, 2016
bfe5e12
add missing import
T045T Nov 15, 2016
51873a1
adjust log level for security globs
T045T Nov 15, 2016
8f3bb08
new service: get actionlib servers
marcoarruda Dec 9, 2016
d87322f
no rospy needed, just for debug logging
marcoarruda Dec 9, 2016
0d90245
Merge pull request #245 from marcoarruda/develop
jihoonl Dec 12, 2016
23fc3b0
Delay unregister to mitigate !138
Jan 12, 2017
4773f5b
Fix: Set default to publish all topics
plieningerweb Jan 13, 2017
aa464bc
Merge pull request #248 from plieningerweb/patch-1
jihoonl Jan 16, 2017
9aacefc
Added default topics to all launch files, and fixed bug where it woul…
TheClearpathDash Jan 17, 2017
2870dc1
Added bug fix in rosapi
TheClearpathDash Jan 17, 2017
c71857e
Fixed the launch files for the tcp and udp service. Without these mod…
Sanic Jan 22, 2017
d591734
Merge pull request #252 from TheDash/develop
jihoonl Jan 24, 2017
d5dbca6
Merge pull request #254 from Sanic/fix-launch-scripts
jihoonl Jan 24, 2017
cc00ee8
update changelog
Jan 25, 2017
4c43766
0.7.17
Jan 25, 2017
a0c63c8
Implemented a bson_only_mode flag for the TCP version of rosbridge; T…
Sanic Jan 28, 2017
193d664
minor change in variable usage
Sanic Jan 28, 2017
dbb8eed
Move UNREGISTER_TIMEOUT to member class so it's accessible from outside
Feb 6, 2017
8bf0326
Fix missing tests due to delayed unregistration
Feb 6, 2017
1efd58c
Fix test advertise errors after delayed unregister changes
Feb 6, 2017
be0b437
Reduce timeout for tests
Feb 6, 2017
47e09e8
Change class constant to module constant
Feb 8, 2017
a7a2e1a
Merge pull request #247 from v-lopez/develop
T045T Feb 8, 2017
632363d
Merge pull request #257 from Sanic/bson-only-mode
jihoonl Mar 9, 2017
ee06b12
Update protocol.py
ablakey Mar 14, 2017
a91e89a
Merge pull request #272 from ablakey/patch-1
jihoonl Mar 14, 2017
07a3236
Set default for bson_only_mode in websocket handler and launch file.
Mar 14, 2017
f0844e2
Merge pull request #273 from Sanic/set_bson_only_flags
jihoonl Mar 15, 2017
d82823d
Create README.md
sevenbitbyte Apr 6, 2017
5440ffd
Update README.md
sevenbitbyte Apr 6, 2017
4a7f2d3
don't try to set TCP nodelay option for UDP
Apr 6, 2017
9729a2f
Merge pull request #277 from T045T/remove_nodelay_for_udp
jihoonl Apr 6, 2017
81f5dcd
Merge pull request #276 from sevenbitbyte/DOCUMENT_GLOB
jihoonl Apr 10, 2017
b9a185f
expose binary_encoder rosparam that was hidden in deep depth
Jun 28, 2017
5d13838
correct the possible argument
Jun 28, 2017
2eb379d
address review comment. more explicitly describe valid args
Jun 29, 2017
6daa129
Cleaning up travis configuration (#283)
jihoonl Jul 3, 2017
2412fa2
Merge pull request #281 from RobotWebTools/expose_b64
adolfo-rt Jul 3, 2017
db74eca
fix delete_param in rosapi (#284)
jihoonl Jul 5, 2017
f8d8a4d
added topic and service names to warnings in order to improve immedia…
pushittodc Aug 30, 2017
b8c85ac
Fixing errors in test. (#287)
jihoonl Aug 30, 2017
ca2e22e
update changelog
Aug 30, 2017
d102eb6
0.8.0
Aug 30, 2017
a64d08d
remove ujson from dependency to build in trusty (#290)
jihoonl Aug 30, 2017
ff8c47a
update changelog
Aug 30, 2017
d839593
0.8.1
Aug 30, 2017
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
49 changes: 24 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
language:
- cpp
- python
# This config file for Travis CI utilizes ros-industrial/industrial_ci package.
# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst

dist: xenial
services:
- docker
language: generic
python:
- "2.7"
compiler:
- gcc

notifications:
email:
on_success: always
on_failure: always

env:
matrix:
- ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu USE_DEB=true
- ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0

matrix:
allow_failures:
- env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0

branches:
only:
- master
- develop

install:
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get install python-catkin-pkg python-rosdep ros-hydro-catkin -qq
- sudo rosdep init
- rosdep update
- mkdir -p /tmp/ws/src
- ln -s `pwd` /tmp/ws/src/package
- cd /tmp/ws
- rosdep install --from-paths src --ignore-src --rosdistro hydro -y
- sudo pip install ujson
before_script:
- source /opt/ros/hydro/setup.bash
- catkin_make
- catkin_make install
- sudo apt-get install ros-hydro-rostest
- source devel/setup.bash
- export ROS_MASTER_URI=http://localhost:11311
- export ROS_HOSTNAME=localhost
- git clone https://github.com/ros-industrial/industrial_ci.git .ci_config

script:
- rostest rosbridge_library test_all.test
- sudo pip uninstall ujson -y -q
- rostest rosbridge_library test_all.test
- source .ci_config/travis.sh
33 changes: 33 additions & 0 deletions rosapi/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@
Changelog for package rosapi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.8.1 (2017-08-30)
------------------

0.8.0 (2017-08-30)
------------------
* fix delete_param in rosapi (`#284 <https://github.com/RobotWebTools/rosbridge_suite/issues/284>`_)
* Merge pull request `#276 <https://github.com/RobotWebTools/rosbridge_suite/issues/276>`_ from sevenbitbyte/DOCUMENT_GLOB
Document glob
* Update README.md
Formatting and examples
* Create README.md
* Contributors: 7bit, Jihoon Lee

0.7.17 (2017-01-25)
-------------------
* Added bug fix in rosapi
* no rospy needed, just for debug logging
* new service: get actionlib servers
* adjust log level for security globs
Normal operation (i.e. no globs or successful verification of requests) is now silent, with illegal requests producing a warning.
* correct default values for security globs
also accept empty list as the default "do not check globs" value in addition to None.
Finally, append rosapi service glob after processing command line input so it's not overwritten
* Added services_glob to CallServices, added globs to rosbridge_tcp and rosbridge_udp, and other miscellanous fixes.
* As per the suggestions of @T045T, fixed several typos, improved logging, and made some style fixes.
* Fixed time object field definitions to match documentation.
* Two minor fixes.
* Added new parameters for topic and service security.
Added 3 new parameters to rosapi and rosbridge_server which filter the
topics, services, and parameters broadcast by the server to match an
array of glob strings.
* Contributors: Devon Ash, Eric, Marco Arruda, Nils Berg

0.7.16 (2016-08-15)
-------------------
* new srv: topics types and details
Expand Down
1 change: 1 addition & 0 deletions rosapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_message_files(
add_service_files(
FILES
DeleteParam.srv
GetActionServers.srv
GetParam.srv
GetParamNames.srv
GetTime.srv
Expand Down
29 changes: 29 additions & 0 deletions rosapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
rosapi
===============

#### Parameters

* `~topics_glob` (string, default '')
* `~services_glob` (string, default '')
* `~params_glob` (string, default '')

```Note: By default the rosapi calls for details about topics, services, and parameters will return nothing. You must specify a list of allowed resources.```
Each of the glob parameters may contain an array of one or more match patterns. Resources that match any of the specified patterns will be returned by calls to the rosapi services.

An example launch file which enables all information to be returned.

```
<node name="rosapi" pkg="rosapi" type="rosapi_node">
<param name="topics_glob" value="[*]" />
<param name="services_glob" value="[*]" />
<param name="params_glob" value="[*]" />
</node>
```


This example launch file enables only rosout and certain camera topics
```
<node name="rosapi" pkg="rosapi" type="rosapi_node">
<param name="topics_glob" value="[/rosout, /camera/rgb/*]" />
</node>
```
2 changes: 1 addition & 1 deletion rosapi/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package>
<name>rosapi</name>
<version>0.7.16</version>
<version>0.8.1</version>
<description>
Provides service calls for getting ros meta-information, like list of
topics, services, params, etc.
Expand Down
63 changes: 46 additions & 17 deletions rosapi/scripts/rosapi_node
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ from rosapi import proxy, objectutils, params
from rosapi.srv import *
from rosapi.msg import *

topics_glob = []
services_glob = []
params_glob = []

def get_globs():
global topics_glob
global services_glob
global params_glob
topics_glob = [
element.strip().strip("'")
for element in rospy.get_param('~topics_glob', '')[1:-1].split(',')
if len(element.strip().strip("'")) > 0]
services_glob = [
element.strip().strip("'")
for element in rospy.get_param('~services_glob', '')[1:-1].split(',')
if len(element.strip().strip("'")) > 0]
params_glob = [
element.strip().strip("'")
for element in rospy.get_param('~params_glob', '')[1:-1].split(',')
if len(element.strip().strip("'")) > 0]

# Initialises the ROS node
def register_services():
rospy.Service('/rosapi/topics', Topics, get_topics)
Expand All @@ -45,6 +66,7 @@ def register_services():
rospy.Service('/rosapi/services_for_type', ServicesForType, get_services_for_type)
rospy.Service('/rosapi/nodes', Nodes, get_nodes)
rospy.Service('/rosapi/node_details', NodeDetails, get_node_details)
rospy.Service('/rosapi/action_servers', GetActionServers, get_action_servers)
rospy.Service('/rosapi/topic_type', TopicType, get_topic_type)
rospy.Service('/rosapi/service_type', ServiceType, get_service_type)
rospy.Service('/rosapi/publishers', Publishers, get_publishers)
Expand All @@ -65,21 +87,22 @@ def register_services():

def get_topics(request):
""" Called by the rosapi/Topics service. Returns a list of all the topics being published. """
topics = proxy.get_topics()
types = proxy.get_topics_types(topics)
rospy.logdebug("List of allowed topic globs: "+str(topics_glob))
topics = proxy.get_topics(topics_glob)
types = proxy.get_topics_types(topics, topics_glob)
return TopicsResponse(topics, types)

def get_topics_for_type(request):
""" Called by the rosapi/TopicsForType service. Returns a list of all the topics that are publishing a given type """
return TopicsForTypeResponse(proxy.get_topics_for_type(request.type))
return TopicsForTypeResponse(proxy.get_topics_for_type(request.type, topics_glob))

def get_services(request):
""" Called by the rosapi/Services service. Returns a list of all the services being advertised. """
return ServicesResponse(proxy.get_services())
return ServicesResponse(proxy.get_services(services_glob))

def get_services_for_type(request):
""" Called by the rosapi/ServicesForType service. Returns a list of all the services that are publishing a given type """
return ServicesForTypeResponse(proxy.get_services_for_type(request.type))
return ServicesForTypeResponse(proxy.get_services_for_type(request.type, services_glob))

def get_nodes(request):
""" Called by the rosapi/Nodes service. Returns a list of all the nodes that are registered """
Expand All @@ -90,34 +113,39 @@ def get_node_details(request):
node = request.node
return NodeDetailsResponse(proxy.get_node_subscriptions(node), proxy.get_node_publications(node), proxy.get_node_services(node))

def get_action_servers(request):
""" Called by the rosapi/GetActionServers service. Returns a list of action servers based on actions standard topics """
topics = proxy.get_topics(topics_glob)
action_servers = proxy.filter_action_servers(topics)
return GetActionServersResponse(action_servers)
def get_topic_type(request):
""" Called by the rosapi/TopicType service. Given the name of a topic, returns the name of the type of that topic.
Request class has one field, 'topic', which is a string value (the name of the topic)
Response class has one field, 'type', which is a string value (the type of the topic)
If the topic does not exist, an empty string is returned. """
return TopicTypeResponse(proxy.get_topic_type(request.topic))
return TopicTypeResponse(proxy.get_topic_type(request.topic, topics_glob))

def get_service_type(request):
""" Called by the rosapi/ServiceType service. Given the name of a service, returns the type of that service
Request class has one field, 'service', which is a string value (the name of the service)
Response class has one field, 'type', which is a string value (the type of the service)
If the service does not exist, an empty string is returned. """
return ServiceTypeResponse(proxy.get_service_type(request.service))
return ServiceTypeResponse(proxy.get_service_type(request.service, services_glob))

def get_publishers(request):
""" Called by the rosapi/Publishers service. Given the name of a topic, returns a list of node names
that are publishing on that topic. """
return PublishersResponse(proxy.get_publishers(request.topic))
return PublishersResponse(proxy.get_publishers(request.topic, topics_glob))

def get_subscribers(request):
""" Called by the rosapi/Subscribers service. Given the name of a topic, returns a list of node names
that are subscribing to that topic. """
return SubscribersResponse(proxy.get_subscribers(request.topic))
return SubscribersResponse(proxy.get_subscribers(request.topic, topics_glob))

def get_service_providers(request):
""" Called by the rosapi/ServiceProviders service. Given the name of a topic, returns a list of node names
that are advertising that service type """
return ServiceProvidersResponse(proxy.get_service_providers(request.service))
return ServiceProvidersResponse(proxy.get_service_providers(request.service, services_glob))

def get_service_node(request):
""" Called by the rosapi/ServiceNode service. Given the name of a service, returns the name of the node
Expand Down Expand Up @@ -146,24 +174,24 @@ def get_service_response_details(request):
return ServiceResponseDetailsResponse([dict_to_typedef(d) for d in objectutils.get_service_response_typedef_recursive(request.type)])

def set_param(request):
rosapi.params.set_param(request.name, request.value)
rosapi.params.set_param(request.name, request.value, params_glob)
return SetParamResponse()

def get_param(request):
return GetParamResponse(rosapi.params.get_param(request.name, request.default))
return GetParamResponse(rosapi.params.get_param(request.name, request.default, params_glob))

def has_param(request):
return HasParamResponse(rosapi.params.has_param(request.name))
return HasParamResponse(rosapi.params.has_param(request.name, params_glob))

def search_param(request):
return SearchParamResponse(rosapi.params.search_param(request.name))
return SearchParamResponse(rosapi.params.search_param(request.name, params_glob))

def delete_param(request):
rosapi.params.delete_param(request.name)
rosapi.params.delete_param(request.name, params_glob)
return DeleteParamResponse()

def get_param_names(request):
return GetParamNamesResponse(rosapi.params.get_param_names())
return GetParamNamesResponse(rosapi.params.get_param_names(params_glob))

def get_time(request):
return GetTimeResponse(rospy.get_rostime())
Expand All @@ -180,8 +208,9 @@ def dict_to_typedef(typedefdict):
if __name__ == '__main__':
try:
rospy.init_node('rosapi_node')
get_globs()
register_services()
rospy.loginfo("Rosapi started")
rospy.spin()
except rospy.ROSInterruptException:
pass
pass
2 changes: 1 addition & 1 deletion rosapi/src/rosapi/objectutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _get_special_typedef(type):
if type=="time" or type=="duration":
example = {
"type": type,
"fieldnames": ["sec", "nsec"],
"fieldnames": ["secs", "nsecs"],
"fieldtypes": ["int32", "int32"],
"fieldarraylen": [-1, -1],
"examples": [ "0", "0" ]
Expand Down
Loading