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

Support bounded and unbounded arrays with rqt_plot (This should NOT be merged to crystal) #53

Closed

Conversation

mlautman
Copy link
Member

@mlautman mlautman commented Apr 7, 2020

This depends on As it depends on ros-visualization/rqt#224

By taking advantage of bounded and unbounded array support in rqt_py_common field parsing, we are able to once again plot values out of variable size arrays with rqt_plot

This change involved more or less reverting rosplot.py, and plot_widget.py to their ros1 equivalents and then using the new RQT_py_common support for dealing with bounded and unbounded arrays.

@mlautman
Copy link
Member Author

mlautman commented Apr 7, 2020

@brawner and @dirk-thomas please review

Copy link
Contributor

@brawner brawner left a comment

Choose a reason for hiding this comment

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

Since this depends on a PR that changes API and since this adjusts API slightly, I also think this one should be targeting Foxy.

if array_idx < 0:
return slot_type, False, None
topic_type_info = message_field_type_helpers.MessageFieldTypeInfo(topic_type_str)
slot_type = topic_type_info.base_type_str
Copy link
Contributor

Choose a reason for hiding this comment

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

These two variables are not used except as a return, you might as well just put them in the return directly.

if end_array_idx < 0:
return None, False, None
if topic_type_info.is_static_array:
array_size = topic_type_info.static_array_size
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to create a helper function (in message_helpers.py?) that calculates array size with this information.

src/rqt_plot/plot_widget.py Outdated Show resolved Hide resolved

# TODO: add bytes to this as you could treat bytes as an array of uint
Copy link
Contributor

Choose a reason for hiding this comment

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

Byte array is standard type, so I think this should be included and nix the TODO

Copy link
Member Author

Choose a reason for hiding this comment

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

On further consideration, I don't think we should do this. It would be like plotting the first character of a string. Not that useful imho

@mlautman mlautman requested a review from brawner April 9, 2020 04:33
@mlautman mlautman changed the title WIP: Support bounded and unbounded arrays with rqt_plot (This should NOT be merged to crystal) Support bounded and unbounded arrays with rqt_plot (This should NOT be merged to crystal) Apr 17, 2020
@ivanpauno
Copy link
Contributor

Closing in favor of #71.

@ivanpauno ivanpauno closed this Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants