[ros2interface] show "expanded" message definition#524
Conversation
sloretz
left a comment
There was a problem hiding this comment.
Partial review.
While playing with it and the ROS 1 version, it seems like stripping comments and whitespace makes it a lot easier to read, which is what the ROS 1 version does.
Compare
$ ros2 interface show geometry_msgs/msg/TwistStamped
# A twist with reference coordinate frame and timestamp
std_msgs/Header header
# Standard metadata for higher-level stamped data types.
# This is generally used to communicate timestamped data
# in a particular coordinate frame.
# Two-integer timestamp that is expressed as seconds and nanoseconds.
builtin_interfaces/Time stamp
# Time indicates a specific point in time, relative to a clock's 0 point.
# The seconds component, valid over all int32 values.
int32 sec
# The nanoseconds component, valid in the range [0, 10e9).
uint32 nanosec
# Transform frame with which this data is associated.
string frame_id
Twist twist
# This expresses velocity in free space broken into its linear and angular parts.
Vector3 linear
# This represents a vector in free space.
# This is semantically different than a point.
# A vector is always anchored at the origin.
# When a transform is applied to a vector, only the rotational component is applied.
float64 x
float64 y
float64 z
Vector3 angular
# This represents a vector in free space.
# This is semantically different than a point.
# A vector is always anchored at the origin.
# When a transform is applied to a vector, only the rotational component is applied.
float64 x
float64 y
float64 zwith (manually stripped)
$ ros2 interface show geometry_msgs/msg/TwistStamped
std_msgs/Header header
builtin_interfaces/Time stamp
int32 sec
uint32 nanosec
string frame_id
Twist twist
Vector3 linear
float64 x
float64 y
float64 z
Vector3 angular
float64 x
float64 y
float64 z|
@audrow it looks like the |
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
6ed1076 to
e76dccb
Compare
|
@sloretz I added the sign offs; thanks for pointing that out |
Signed-off-by: Audrow <audrow.nash@gmail.com>
|
@sloretz I agree that it will be nice to remove whitespace and comments. I can extend the current version, or do this in another PR. |
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
Another PR works for me. When you open it, I would recommend making the whitespace and comment removed version the default behavior since it feels a lot easier to understand the output. @jacobperron since this repo has a |
There was a problem hiding this comment.
LGTM with one nitpick, green CI, and confirmation from @jacobperron that it's ok to merge onto master.
Also, nice work with the recursive solution. It's a lot easier to understand.
|
I've already created a |
Signed-off-by: Audrow <audrow.nash@gmail.com>
Signed-off-by: Audrow <audrow.nash@gmail.com>
* Expand interfaces with nesting in interface show Signed-off-by: Audrow <audrow.nash@gmail.com> * Make show interface not print anything on empty lines Signed-off-by: Audrow <audrow.nash@gmail.com> * Test nesting interface + update tests that used nested interfaces Signed-off-by: Audrow <audrow.nash@gmail.com> * Minor refactoring Signed-off-by: Audrow <audrow.nash@gmail.com> * Support arrays of expandable types Signed-off-by: Audrow <audrow.nash@gmail.com> * Yield file lines and use stack to organize nesting Signed-off-by: Audrow <audrow.nash@gmail.com> * Make member variable names and error text more consistent Signed-off-by: Audrow <audrow.nash@gmail.com> * Use str function to make TextLineInterface usage clearer Signed-off-by: Audrow <audrow.nash@gmail.com> * Simplify generator to get interface text lines Signed-off-by: Audrow <audrow.nash@gmail.com> * Reformat to pass flake-8 tests Signed-off-by: Audrow <audrow.nash@gmail.com> Signed-off-by: Craig <CraigUkaea@gmail.com>
* Expand interfaces with nesting in interface show Signed-off-by: Audrow <audrow.nash@gmail.com> * Make show interface not print anything on empty lines Signed-off-by: Audrow <audrow.nash@gmail.com> * Test nesting interface + update tests that used nested interfaces Signed-off-by: Audrow <audrow.nash@gmail.com> * Minor refactoring Signed-off-by: Audrow <audrow.nash@gmail.com> * Support arrays of expandable types Signed-off-by: Audrow <audrow.nash@gmail.com> * Yield file lines and use stack to organize nesting Signed-off-by: Audrow <audrow.nash@gmail.com> * Make member variable names and error text more consistent Signed-off-by: Audrow <audrow.nash@gmail.com> * Use str function to make TextLineInterface usage clearer Signed-off-by: Audrow <audrow.nash@gmail.com> * Simplify generator to get interface text lines Signed-off-by: Audrow <audrow.nash@gmail.com> * Reformat to pass flake-8 tests Signed-off-by: Audrow <audrow.nash@gmail.com> Signed-off-by: Craig <CraigUkaea@gmail.com>
Fixes #348