Skip to content

Comments

Allow inserting waypoints between existing mission items#2131

Merged
ArturoManzoli merged 4 commits intobluerobotics:masterfrom
ArturoManzoli:1356-Allow-adding-wp-in-the-middle
Sep 29, 2025
Merged

Allow inserting waypoints between existing mission items#2131
ArturoManzoli merged 4 commits intobluerobotics:masterfrom
ArturoManzoli:1356-Allow-adding-wp-in-the-middle

Conversation

@ArturoManzoli
Copy link
Contributor

@ArturoManzoli ArturoManzoli commented Sep 17, 2025

Allow users to add waypoints in between existing mission items.

New ways to add or remove waypoints:

  • Double-click (or double tap on mobile) a mission path to include a WP on that segment's center;
  • Open the context menu (long press on mobile) over a path to access the option to add a WP;
  • Hold CTRL and click a path to add a WP;
  • Hold SHIFT and click a WP do delete it;
wp_add.mp4

Closes #1356

@ArturoManzoli ArturoManzoli requested review from ES-Alexander and rafaellehmkuhl and removed request for rafaellehmkuhl September 17, 2025 17:52
@rafaellehmkuhl
Copy link
Member

Nice!

One question: any reason for us not to use the same mechanism we have today in the survey?

@ArturoManzoli
Copy link
Contributor Author

ArturoManzoli commented Sep 18, 2025

Nice!

One question: any reason for us not to use the same mechanism we have today in the survey?

Do you mean the plus icon that appears in the middle of the segment?

Survey creation is a transient state, and mission paths are persistent, so we’d need to display plus icons on all segments at all times.
To address this, we’ would either need to implement and toggle an 'Add Waypoint' mode or show the plus icons only when hovering over segments.

However, hovering only works with pointing devices like a mouse, meaning mobile and Steam Deck users wouldn’t be able to access them. (Hover based interactions will always need to be a secondary option)

To accommodate all platforms while keeping the UI clean, was implemented the long press/double-tap for mobile and Steam Deck. For desktop users with a keyboard and mouse, using Ctrl to add and Shift to remove (just like in Adobe Photoshop) is a well established and intuitive pattern.

@rafaellehmkuhl
Copy link
Member

Nice!

One question: any reason for us not to use the same mechanism we have today in the survey?

Do you mean the plus icon that appears in the middle of the segment?

Survey creation is a transient state, and mission paths are persistent, so we’d need to display plus icons on all segments at all times.

To address this, we’ would either need to implement and toggle an 'Add Waypoint' mode or show the plus icons only when hovering over segments.

However, hovering only works with pointing devices like a mouse, meaning mobile and Steam Deck users wouldn’t be able to access them. (Hover based interactions will always need to be a secondary option)

To accommodate all platforms while keeping the UI clean, was implemented the long press/double-tap for mobile and Steam Deck. For desktop users with a keyboard and mouse, using Ctrl to add and Shift to remove (just like in Adobe Photoshop) is a well established and intuitive pattern.

For mouse-based devices, can we have the plus icon to show on hover?

@ArturoManzoli ArturoManzoli force-pushed the 1356-Allow-adding-wp-in-the-middle branch 2 times, most recently from 3e62f6d to c48ffb1 Compare September 19, 2025 10:50
@rafaellehmkuhl
Copy link
Member

@ArturoManzoli since my last review was in a comment, without clicking the request for changes button, ping me when you have finished and the PR is ready for review again.

@ArturoManzoli
Copy link
Contributor Author

@ArturoManzoli since my last review was in a comment, without clicking the request for changes button, ping me when you have finished and the PR is ready for review again.

Yup, thanks. I just gotta solve some conflicts between the new command waypoint markers and the ones coming on this PR.

@ArturoManzoli ArturoManzoli force-pushed the 1356-Allow-adding-wp-in-the-middle branch from c48ffb1 to b1ca84d Compare September 22, 2025 12:15
@ArturoManzoli
Copy link
Contributor Author

@rafaellehmkuhl Ready to review!

@ArturoManzoli ArturoManzoli force-pushed the 1356-Allow-adding-wp-in-the-middle branch from b1ca84d to 17f4c1b Compare September 23, 2025 10:06
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation-wise this look perfect. It's also working fine in all tested modes.

I have just one question: when adding a waypoint, it copies the previous one, so if the previous waypoint has extra commands, the new one will also have. Is this a feature or a bug? I can see reasons to go for both directions, but was expecting for bare default waypoints to be added, initially.

Kapture.2025-09-26.at.17.39.08.mp4

@ArturoManzoli
Copy link
Contributor Author

Implementation-wise this look perfect. It's also working fine in all tested modes.

I have just one question: when adding a waypoint, it copies the previous one, so if the previous waypoint has extra commands, the new one will also have. Is this a feature or a bug? I can see reasons to go for both directions, but was expecting for bare default waypoints to be added, initially.

Kapture.2025-09-26.at.17.39.08.mp4

This was actually intentional so the behavior of the vehicle would stay consistent throughout the mission even on passing by newly added waypoints.

But thinking againg, also repeating the previous commands might represent a problem and should be removed from the insertWaypointAtSegmentMidpoint function. I'll do that.

@ArturoManzoli ArturoManzoli force-pushed the 1356-Allow-adding-wp-in-the-middle branch from 17f4c1b to fc9ff21 Compare September 29, 2025 11:11
@ArturoManzoli
Copy link
Contributor Author

I have just one question: when adding a waypoint, it copies the previous one, so if the previous waypoint has extra commands, the new one will also have. Is this a feature or a bug? I can see reasons to go for both directions, but was expecting for bare default waypoints to be added, initially.

Done! Also added a commit that extracts the default commands for general use inside the component

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything working perfectly!
Nice addition!

@ArturoManzoli ArturoManzoli merged commit 92e9c4b into bluerobotics:master Sep 29, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

We should allow the user to add waypoints in the middle of the list

2 participants