again, not 100% sure on how ROS creates its data objects, but this could potentially be reduced to:
joints = (attr for attr in dir(msg) if not attr.startswith('_'))
ja_bytes = []
for joint in joints:
if getattr(msg, joint) // 256 > 0:
ja_bytes.append(255)
ja_bytes.append(getattr(msg, joint) % 255)
else:
ja_bytes.append(getattr(msg, joint))
ja_bytes.append(0)
Originally posted by @agupta231 in #3 (comment)