Open
Conversation
hidmic
reviewed
Feb 3, 2026
| @@ -0,0 +1,52 @@ | |||
| frame_id: map | |||
Collaborator
There was a problem hiding this comment.
@Lobotuerk can we bomb the atic? I don't think we'll need it.
| @@ -0,0 +1,51 @@ | |||
| #!/usr/bin/python3 | |||
| RCLCPP_INFO(rclcpp::get_logger("DGENode"), "Loading dense grid from %s", dense_grid_path.c_str()); | ||
| torch::jit::Module dense_grid_module = torch::jit::load(dense_grid_path); | ||
| bool found = false; | ||
| for (const auto& buffer : dense_grid_module.named_buffers()) { |
Collaborator
There was a problem hiding this comment.
@Lobotuerk should it assert there's only one buffer in the module?
Comment on lines
+100
to
+112
| bool device_found = false; | ||
| for (const auto& param : image_encoder_.parameters()) { | ||
| device = param.device(); | ||
| device_found = true; | ||
| break; | ||
| } | ||
| if (!device_found) { | ||
| for (const auto& buffer : image_encoder_.named_buffers()) { | ||
| device = buffer.value.device(); | ||
| device_found = true; | ||
| break; | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
@Lobotuerk meta: this could be a separate utility, torch::Device infer_device(const torch::jit::Module&). I'm actually surprised it doesn't exist already.
Comment on lines
+134
to
+147
| torch::Device device = torch::kCPU; | ||
| bool device_found = false; | ||
| for (const auto& param : image_encoder_.parameters()) { | ||
| device = param.device(); | ||
| device_found = true; | ||
| break; | ||
| } | ||
| if (!device_found) { | ||
| for (const auto& buffer : image_encoder_.named_buffers()) { | ||
| device = buffer.value.device(); | ||
| device_found = true; | ||
| break; | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
@Lobotuerk meta: why do this on every call and not just once on initialization?
| void initialize_grid_parameters() { | ||
| X_size_ = dense_grid_tensor_.size(0); | ||
| Y_size_ = dense_grid_tensor_.size(1); | ||
| F_size_ = dense_grid_tensor_.size(2); |
|
|
||
| // Rotate the pose feature to match the orientation of the pose | ||
| // double theta = pose.so2().log(); | ||
| // auto rotated_pose_feature = rotate_circular_feature(pose_embedding_tensor, theta); |
|
|
||
| { | ||
| feature_detections_sub_ = | ||
| std::make_unique<message_filters::Subscriber<FeatureDetections>>( |
Collaborator
There was a problem hiding this comment.
@Lobotuerk meta: you may as well drop the feature_detections naming and switch to image.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DISCLAIMER: It does not localise, adds support for inference as a sensor model