lardemua / atom

Calibration tools for multi-sensor, multi-modal robotic systems
GNU General Public License v3.0
249 stars 27 forks source link

Merge -utf and not -utf into a single mechanism #838

Closed miguelriemoliveira closed 6 months ago

miguelriemoliveira commented 7 months ago

This would be helpful to avoid the user having to insert the -utf flag, and to solve inconsistency issues derived from having two alternatives (#836 ).

miguelriemoliveira commented 6 months ago

Will start working on this, using softbot as an example.

FYI @brunofavs and @manuelgitgomes

miguelriemoliveira commented 6 months ago

So the files that use flag use_tfs are:

configure_calibration_pkg config_visualization

brunofavs commented 6 months ago

Ok, Im doing the softbot example for atom examples today too :)

miguelriemoliveira commented 6 months ago

The idea is to use the xacro for providing information about the joints. If the transformation is not found in the xacro, search in the bagfile for the tf that contains the that transformation.

miguelriemoliveira commented 6 months ago

Im doing the softbot example for atom examples today too :)

Great. Put it in a separate issue.

miguelriemoliveira commented 6 months ago

Use a PR for that please. Its a big change.

miguelriemoliveira commented 6 months ago

Looked into this with @manuelgitgomes.

There is a problem on how to create a hybrid of using both tfs generated by the xacro/joint_states/robot_state_publisher and tfs recorded to the bagfile.

The solution seems to be, in the cases where the xacro is not sufficient, to record a new bagfile which contains only the tfs that do not exist in the xacro.

miguelriemoliveira commented 6 months ago

Running the softbot calibration without the --use_tfs results in error:

Traceback (most recent call last): File "/home/mike/workspaces/catkin_ws/devel/lib/atom_calibration/configure_calibration_pkg", line 15, in exec(compile(fh.read(), python_script, 'exec'), context) File "/home/mike/workspaces/catkin_ws/src/calibration/atom/atom_calibration/scripts/configure_calibration_pkg", line 378, in raise ValueError('TF tree is not connected. Aborting.') ValueError: TF tree is not connected. Aborting.

exit status: 1

The code is this:

https://github.com/lardemua/atom/blob/17629406d9c80b5494c47a9511b18df8bd5391e0/atom_calibration/scripts/configure_calibration_pkg#L369-L378

The graph shows the world and pattern link disconnected from the rest of the tree.

image

miguelriemoliveira commented 6 months ago

The question is how to find that what were missing in the tree is the world->base_link transform in the bagfile.

Or perhaps we do not need to find, we just need to add all the transforms in the bagfile that do not exist in the xacro ...

miguelriemoliveira commented 6 months ago

I think this is working better. Here's the result of configuring hte softbot

image

The left branch (back_camera) was not in the xacro, so it was added from the tf with static transforms. The world to base_link was also added.

miguelriemoliveira commented 6 months ago

Producing the bagfile seems to be working fine.

The original softbot bagfile has frames above. However, after filtering the bagfile to have only the frames that do not exist in the xacro, we get:

image

miguelriemoliveira commented 6 months ago

Should be working fine. --use_tfs is gone.