ros2 / ros2/ros2cli

Could not get publisher / subscriptions info from topic through XMLRPC

Open
#574 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Hi, I'm trying to get publisher and subscription info by topic through XMLRPC interface, but get unknown tag when invoking the following functions.

  1. get_publishers_info_by_topic(topic_name)
  2. get_subscriptions_info_by_topic(topic_name)

Bug report

Required Info:

  • Operating System:
    • OSX / Ubuntu 20.04
  • Installation type:
    • binary
  • Version or commit hash:
    • FOXY latest release
  • DDS implementation:
    • ALL implementations
  • Client library (if applicable):
    • none
Steps to reproduce issue
cwyark@geek:[ros2_ws]: python3
Python 3.6.8 (default, Sep 30 2019, 22:08:18) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpc
>>> from xmlrpc import client
>>> p = client.ServerProxy('http://localhost:11523/ros2cli/')
>>> p.get_topic_names_and_types()
[['/chatter', ['std_msgs/msg/String']], ['/parameter_events', ['rcl_interfaces/msg/ParameterEvent']], ['/rosout', ['rcl_interfaces/msg/Log']]]
>>> p.get_publishers_info_by_topic('/chatter')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 1154, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 1170, in single_request
    return self.parse_response(resp)
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 1336, in parse_response
    p.feed(data)
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 439, in feed
    self._parser.Parse(data, 0)
  File "/private/var/folders/pq/_2x0qf_n70xf3mnpp1xdd_s00000gn/T/python-build.20190930220651.51176/Python-3.6.8/Modules/pyexpat.c", line 419, in StartElement
  File "/Users/cwyark/.pyenv/versions/3.6.8/lib/python3.6/xmlrpc/client.py", line 677, in start
    raise ResponseError("unknown tag %r" % tag)
xmlrpc.client.ResponseError: ResponseError("unknown tag 'rclpy.topic_endpoint_info.TopicEndpointInfo'",)
Expected behavior

We could use any XMLRPC tool to get the publisher info by topic name.

Actual behavior

Got exception when invoking get_publishers_info_by_topic and get_subscriptions_info_by_topics

Additional information

I tried use python rclpy node to get these information without any problems, so I guess the problem happened at serialize / deserialize XMLRPC message at server side.


Feature request

Feature description
Implementation considerations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the XMLRPC handlers for get_publishers_info_by_topic and get_subscriptions_info_by_topic in ros2cli, then inspect how rclpy.topic_endpoint_info.TopicEndpointInfo results are serialized. Reproduce the calls against the Foxy setup described in the issue and verify that standard XMLRPC clients can parse both responses without an unknown-tag error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.