compas-dev / compas_fab

Robotic fabrication package for the COMPAS Framework.
https://compas.dev/compas_fab/
MIT License
108 stars 32 forks source link

The `__repr__` of `ROSMsg` is incorrect #273

Closed gonzalocasas closed 3 years ago

gonzalocasas commented 3 years ago

The class ROSMsg used as base class for all ROS messages has an incorrect __repr__ definition: https://github.com/compas-dev/compas_fab/blob/main/src/compas_fab/backends/ros/messages/std_msgs.py#L34 Instead of returning the __str__ result, it returns the __str__ method, causing it to fail.

To Reproduce Steps to reproduce the behavior:

>>> ROSMsg()

In the python REPL, just creating a new instance will try to print its __repr__ and it will fail saying it's not a string.