Simplify the use of frame transformations in skills
TF frames is fundamentally flawed if not all parts of the application use the same cache.
This is a big issue to newcomers only familiar with ROS.
For instance, if one skill modifies a frame through the world model this will propagate to the TF tree eventually, but another frame may be dependent and must wait for the propagation to take place. This yields many opportunities for hard to catch errors with unexpected behaviour as a result.
Do we have guarantees with AauSpatialResoner
that if the world model is updated, that dependent frames can transform directly without delay - assuming that all other required frames are known?
In my humble opinion, AauSpatialResoner or something else should replace tf.TransformListener - which even I fell for as I could not easily reference which methods are available in AauSpatialResoner, no type linkage - IDE can't help me.
Proposal If we only have one spatial resoner, we may designate it as the default one (possibly add an option to change it).
Some basic methods I would like (if they do not already exist):
- get_transform (pose_frame_id, in_frame) # I guess default for in_frame would be pose_frame_id
- transform_pose(pose, to_frame)
- transform_position(3d vector, from_frame, to_frame)
- transform_position_orientation(3d vector, quaternion, from_frame, to_frame) -> (3d vector, quaternion)
Ideally, above would be as short as self.spatial.transform_pose
in a Skill ...
With Python 3 we can define the type and an IDE would help the programmer with referencing the documentation for the methods.
I would even like methods such as:
- update_pose(world_model_element, new_pose)
- update_position(world_model_element, position)
- update_position_orientation(world_model_element, orientation)