I think I understood the problem better but I still don't know how to solve it. Here I am making a new robot model that I load from the configuration file. That gives me a kinematic model that can be accessed using RobotModelPtr. Then the planning scene creates a new internal state that only has the same kinematic tree as my robot. It is used to decouple the real robot from a path planning.
However I would like to synchronize my duplicate kinematic model with the robot state, so that my planning path's start point be the same as the current robot position. Since the real robot has a robot_state_publisher which publishes a tf, I should be able to retrieve joint values from the tf topic.
Should I subscribe to the tf topic? Or is there a simpler way to access the robot model published to tf and get joint values from it?
Thanks