Skip to content

Revisit ROS message access through loops #8

@andrew103

Description

@andrew103

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions