-
Notifications
You must be signed in to change notification settings - Fork 332
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
Make the output from fibonacci_client_py feedback and result look nicer #388
Comments
Further explanation: Maybe, we should override |
That would affect any code using the Python type |
Yes, my idea was subclass from |
I don't think we should introduce a custom array class either. A message field should store a vanilla |
Ok. |
No, I don't think so. We just need to do the same thing here that we did for messages; that is, we override |
@clalancette Please use permalinks since this doesn't point anymore where you likely intended it to point to. I guess you wanted to point to the repr method of a generated message?
@clalancette The specific sub elements of a service - the request and the response - are just messages themselves. So I don't understand where you think those would need similar changes?
@ivanpauno I agree. I will go ahead and do so. Please feel free to continue commenting and this can be reopened if necessary. |
So I may be wrong about services, but the problem that @ivanpauno first reported in the description is still a problem. Running the
So I think this is still a problem (maybe just in actions). Thus I'll reopen. |
One possible solution is to first create an array.array object, and then set to that object a custom x = array.array(typecode)
x.__repr__ = custom_repr I don't like much the idea of "hacking" a method without changing the type of the object, but it's a possible solution if we don't want to create a custom class. |
I took another quick look at this. https://github.com/ros2/demos/tree/master/action_tutorials/action_tutorials_interfaces does indeed invoke Thus, while we could override the demos/action_tutorials/action_tutorials_py/action_tutorials_py/fibonacci_action_client.py Line 61 in 9765191
array.array ; after all, it is client code at that point, so it is a good example.
@ivanpauno If you agree with this, then I'll move this issue over to https://github.com/ros2/demos, and we can fix it over there. Thoughts? |
Yes, I agree that's the best solution. |
Follow-up of ros2/rosidl_python#60.
Example:
Run in one terminal:
in another terminal:
Output:
[INFO] [fibonacci_action_client]: Received feedback: array('i', [0, 1, 1])
Expected output:
The text was updated successfully, but these errors were encountered: