Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tracking Map, Fix cloth edge visualization #50

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

dcolli23
Copy link
Contributor

This is a large PR but it breaks down to adding the tracking map (see #48) and fixing the RVIZ edge visualization for cloth (#47).

# High-Level Description

Adds the ability for CDCPD to run on multiple deformable object configurations by storing a map of configurations by unique ID (ID unique to each deformable object configuration). This isn't particularly important now but opens the possibility for tracking multiple templates in the future.

This does NOT implement multiple template tracking in the sense of:
- Learning separate LLE weights for separate templates given different initial template states.
- Separating multiple deformable object configurations in the CPD step, meaning that the masked points that belong to another template still impact the CPD score of another, separate deformable object configuration.
- Using masked point association history to disambiguate multi-template (non-instance) segmentation, meaning that if CDCPD receives a mask indicating there are two deformable objects in the segmentation that are interacting, there's no way to tell them apart in the tracking's use of the segmented mask.

## Key Changes

- Adds a std::map to keep track of deformable object configurations (how tracked templates are stored) by unique IDs.
- Changes max segment length to be per edge so that edges can have different maximum lengths.
    - Something of this flavor is necessary to specify max edge lengths based on each template's (potentially different) edge lengths compared to any other template's edge lengths.
    - Though, it's up for debate as to whether this is the best way to handle this.
- Updates the RVIZ edge visualization to only connect tracked points that belong to the same template.
    - Accomplishes this by publishing a MarkerArray message instead of a single Marker message.
    - TODO: Connect points based on the edge list. This would make the visualization respect the actual edges and thus correctly visualize cloth.

## Miscellaneous Changes

- Formats CDCPD and Optimizer function signatures as they could have been considered hard to read.
- Simply renames the CDCPD class "tolerance" member to "tolerance_cpd"
as the former is ambiguous as to what tolerance we're specifying.
- Adds the Stopwatch class which is a super useful context manager
that automatically times a code block's runtime duration and outputs to
the given logger (by passing in the logger's name).
- Makes the vertices, points, and edges of the DeformableObjectTracking
class private and provides getters/setters for these. Should prevent
people from making changes that will shoot them in the foot later.
- Adds testing of ConnectivityGraph in DeformableObjectTracking's tests.
Not ideal but at least it has some tests.
- When a non-square cloth was tracked, not all edges were connected.
This was due to using the number of points in the length direction for
the width direction.
- Fixes edge visualization in RVIZ to actually respect the edges
specfied in the template instead of just going off of point order.
- Cleans up some compiler warnings introduced in earlier commits
@dcolli23 dcolli23 added bug Something isn't working enhancement New feature or request labels Mar 27, 2023
@dcolli23 dcolli23 self-assigned this Mar 27, 2023
@dcolli23
Copy link
Contributor Author

This really needs to be broken up into multiple PRs. +1,113/-342 lines of code means it's basically unreviewable in its current state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant