I have a problem that needs to count the length of each ROS topic msg.
I modified rostopic(/opt/ros/smart-ros/lib/python2.7/dist-packages/rostopic / __ init__.py):
Class CallbackEcho(object) ->
Def callback (self, data, callback_args, current_time = None):
Print('message length =',sys.getsizeof(data)) #statics msg length
But when the message contains a vector or struct list, the length is incorrect.
Please help solve this problem?
Thanks.