-
Notifications
You must be signed in to change notification settings - Fork 47
Sparse Vertex Cost Message for Cost Updates and Rviz Support for Dynamic Updates #60
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
Merged
amock
merged 4 commits into
naturerobots:feature/dynamic-cost-updates
from
JustusBraun:pr/dynamic-cost-updates
Aug 5, 2025
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
696d75f
Add MeshVertexCostsSparse message to efficiently update only changed
JustusBraun 96cf4de
Process Cost Updates in batches to prevent locking the VertexBuffer o…
JustusBraun 17da0ce
Fix color loading from H5
JustusBraun bf31bc7
Backport to ROS Humble
JustusBraun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # MeshVertexCostsSparse | ||
| # Holds costs for a subset of the mesh vertices | ||
|
|
||
| # The vertex indices | ||
| uint32[] vertices | ||
|
|
||
| # The cost per vertex | ||
| float32[] costs | ||
|
|
||
| # The default value for all other vertices | ||
| float32 default_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Mesh Attribute Message | ||
| std_msgs/Header header | ||
| string uuid | ||
| string type | ||
| mesh_msgs/MeshVertexCostsSparse mesh_vertex_costs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
rviz_mesh_tools_plugins/include/rviz_mesh_tools_plugins/ThreadSaveQueue.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #pragma once | ||
|
|
||
| #include <queue> | ||
| #include <mutex> | ||
|
|
||
| namespace rviz_mesh_tools_plugins | ||
| { | ||
|
|
||
|
|
||
| template <typename T> | ||
| class ThreadSafeQueue: protected std::queue<T> | ||
| { | ||
| public: | ||
| T pop() | ||
| { | ||
| std::lock_guard lock(mutex_); | ||
| T elem = this->std::queue<T>::front(); | ||
| this->std::queue<T>::pop(); | ||
| return elem; | ||
| } | ||
|
|
||
| std::vector<T> popAll() | ||
| { | ||
| std::lock_guard lock(mutex_); | ||
| std::vector<T> data; | ||
| data.reserve(this->size()); | ||
|
|
||
| while(!this->empty()) | ||
| { | ||
| data.push_back(this->std::queue<T>::front()); | ||
| this->std::queue<T>::pop(); | ||
| } | ||
| return data; | ||
| } | ||
|
|
||
| void push(const T& elem) | ||
| { | ||
| std::lock_guard lock(mutex_); | ||
| this->std::queue<T>::push(elem); | ||
| } | ||
|
|
||
| private: | ||
| std::mutex mutex_; | ||
| }; | ||
|
|
||
| } // namespace rviz_mesh_tools_plugins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JustusBraun Thanks for the first update! :)
Looking good, just found a typo in this filename (save vs safe), could you fix that? (maybe as part of the next PR if one is coming)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, I will do that :D