setObjectPose, this client exposes
generic pub / sub / get operations over a predefined topic
registry. Topics are looked up by key (e.g. "set_object_pose"), and
the client handles CDR serialization using the topic’s declared ROS2
message type.
Usage::
client = SimClient()
Publish a Pose to the “set_object_pose” topic
client.pub(“set_object_pose”, { “position”: {“x”: 1.0, “y”: 2.0, “z”: 0.5}, “orientation”: {“x”: 0.0, “y”: 0.0, “z”: 0.0, “w”: 1.0}, })Subscribe and poll
client.sub(“get_object_pose”) pose = client.get(“get_object_pose”)Constructor
Signature
Methods
add_topic()
Signature
close()
Signature
get()
Signature
sub first to start receiving messages.
Returns:
Deserialized message, or None if nothing received within timeout.
pub()
Signature
- A dict matching the ROS2 message fields (auto-converted & CDR-serialized).
- A primitive (bool, int, float) for single-field messages like
Bool. - A pre-built
pycdr2.IdlStructinstance (serialized directly). - A raw
bytesobject (published as-is).
set_named_pose()
Signature
sub()
Signature
get.