Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

[rostopic] Show topic field type with rostopic type#860

Merged
dirk-thomas merged 5 commits intoros:indigo-develfrom
wkentaro:rostopic-type-field
Aug 25, 2016
Merged

[rostopic] Show topic field type with rostopic type#860
dirk-thomas merged 5 commits intoros:indigo-develfrom
wkentaro:rostopic-type-field

Conversation

@wkentaro
Copy link
Copy Markdown
Contributor

@wkentaro wkentaro commented Aug 11, 2016

For jsk-ros-pkg/jsk_visualization#625 (comment)

As shown below:

% rostopic type /raw_image_bgr/image_color/foo
unknown topic type [/raw_image_bgr/image_color/foo]

% rostopic type /raw_image_bgr/image_color/header
sensor_msgs/Image header std_msgs/Header

% rostopic type /raw_image_bgr/image_color/header/frame_id
sensor_msgs/Image header/frame_id string

% rostopic type /raw_image_bgr/image_color
sensor_msgs/Image

The current behavior is below:

% rostopic type /raw_image_bgr/image_color/foo
unknown topic type [/raw_image_bgr/image_color/foo]

% rostopic type /raw_image_bgr/image_color/header
sensor_msgs/Image

% rostopic type /raw_image_bgr/image_color
sensor_msgs/Image

@wkentaro wkentaro force-pushed the rostopic-type-field branch from 800d8bf to fe6d8b2 Compare August 11, 2016 18:34
As shown below:

```bash
% rostopic type /raw_image_bgr/image_color/foo
unknown topic type [/raw_image_bgr/image_color/foo]

% rostopic type /raw_image_bgr/image_color/header
sensor_msgs/Image header std_msgs/Header

% rostopic type /raw_image_bgr/image_color/header/frame_id
sensor_msgs/Image header/frame_id string

% rostopic type /raw_image_bgr/image_color
sensor_msgs/Image
```
@dirk-thomas
Copy link
Copy Markdown
Member

Can you please add a unit test for the new feature.

@wkentaro
Copy link
Copy Markdown
Contributor Author

I added tests

_rostopic_type(_optparse_topic_only('type', argv))

args = argv[2:]
from optparse import OptionParser
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep imports at the top of the module.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@wkentaro
Copy link
Copy Markdown
Contributor Author

Fixed.

_rostopic_type(_optparse_topic_only('type', argv))

parser = argparse.ArgumentParser(prog='%s type' % NAME)
parser.add_argument('topic_or_field', help='Topic or filed name')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: filed

@wkentaro
Copy link
Copy Markdown
Contributor Author

Fixed.

@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for these improvements to rostopic.

@dirk-thomas dirk-thomas merged commit fd1415b into ros:indigo-devel Aug 25, 2016
dirk-thomas pushed a commit that referenced this pull request Aug 25, 2016
As shown below:

```bash
% rostopic type /raw_image_bgr/image_color/foo
unknown topic type [/raw_image_bgr/image_color/foo]

% rostopic type /raw_image_bgr/image_color/header
sensor_msgs/Image header std_msgs/Header

% rostopic type /raw_image_bgr/image_color/header/frame_id
sensor_msgs/Image header/frame_id string

% rostopic type /raw_image_bgr/image_color
sensor_msgs/Image
```
@dirk-thomas
Copy link
Copy Markdown
Member

I just realized that this was against indigo-devel. I reverted the commit and instead cherry-picked it to the kinetic-devel branch: c37a71c

@wkentaro wkentaro deleted the rostopic-type-field branch August 25, 2016 15:54
@wkentaro
Copy link
Copy Markdown
Contributor Author

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants