How do I broadcast multiple static transforms from different objects in the same process? [closed]
As per #310103 I need to broadcast some transforms for a pick&place application. Specifically, I (think I) need:
- 2 static transforms for my robotic arm, to connect its base_link to the world (skippable, but the problem would remain though) and to have the pose of the center of the fingers in the end effector (last_link -> fingers_center);
- 1 static transform to connect the mesh origin point of a pickable object to the grasping pose;
- 1 (normal) transform from world to mesh origin point (which is currently not being broadcast at all, hopefully for the error related to the multiple static transforms);
- all the transforms from arm base to end effector are handled by robot_state_publisher, so that I don't need to care about.
The problem arises when I publish more than one static transform from the same process, I think. As per #287469 and #261815, the solution should be relatively simple: send all the static transforms in one go, together. This is however infeasible at the moment for two separate design reasons:
- encapsulation mandates that the robotic arm and the pickable are separate C++ classes managed by a process class which has to contain only the pick&place logic, making the "how" I achieve the result an implementation detail. Returning the
TransformStamped
messages to the process would violate such a requirement; - the pickable is instantiated multiple times, and in a loop, so I would also be continuously republishing unchanged static transforms for the arm with no real reason (more of a logic error than a performance issue, I'm guessing).
Is there a way to therefore accomplish the goal of broadcasting these 3 static transforms with these limitations?