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

RSDK-5334 - Remove unused code #317

Merged
merged 11 commits into from
Jan 10, 2024

Conversation

kkufieta
Copy link
Contributor

@kkufieta kkufieta commented Jan 4, 2024

Ticket: https://viam.atlassian.net/browse/RSDK-5334

Done:

  • Removed data_dir, cloud_story_enabled, map_rate_sec
  • Removed unused functions and old todo comments

Tested on:

  • Intel Mac w/ lidar
  • Rover w/ lidar + odom

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 4, 2024
@kkufieta kkufieta added the appimage Build AppImage of PR label Jan 4, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 4, 2024
@kkufieta kkufieta force-pushed the kk/rsdk-5334-remove-unused-code branch from e6f1cd9 to fe403c4 Compare January 8, 2024 15:00
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2024
@kkufieta kkufieta changed the title RSDK-5334 - Remove unused code from C++ RSDK-5334 - Remove unused code Jan 8, 2024
@kkufieta kkufieta requested review from kim-mishra and removed request for jeremyrhyde January 8, 2024 17:05
Comment on lines 583 to 584
std::string filename =
"temp_internal_state_" + boost::uuids::to_string(uuid) + ".pbstream";
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be in a tmp dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point - I think so. @JohnN193 can you take a look and confirm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

i think having a temp dir just adds more for us to cleanup, but if its better practice to use one then thats fine with me!

Copy link
Collaborator

@kim-mishra kim-mishra Jan 9, 2024

Choose a reason for hiding this comment

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

I think it is better practice - for linux machines anything in that directory will get cleaned up during boot according to https://linuxhandbook.com/tmp-directory/amp/

This would at least protect us on some machines in the case of a crash before cleanup

@randhid randhid removed their request for review January 8, 2024 22:48
Copy link
Collaborator

@JohnN193 JohnN193 left a comment

Choose a reason for hiding this comment

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

LGTM, just had one question

@@ -28,6 +28,7 @@ const SensorId kOdometerSensorId{SensorId::SensorType::ODOMETRY, "odometry"};

class MapBuilder {
public:
MapBuilder() : trajectory_builder(){};
Copy link
Collaborator

Choose a reason for hiding this comment

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

[q] what does adding this here do?

Copy link
Contributor Author

@kkufieta kkufieta Jan 9, 2024

Choose a reason for hiding this comment

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

The valgrind test was complaining that trajectory_builder was not initialized but used in an if-statement (Conditional jump or move depends on uninitialised value(s)), which happens when we error out here.

This change initializes trajectory_builder to nullptr and fixes the issue.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 10, 2024
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 10, 2024
Copy link
Collaborator

@kim-mishra kim-mishra left a comment

Choose a reason for hiding this comment

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

lgtm!

@kkufieta kkufieta merged commit 60b6e8a into viam-modules:main Jan 10, 2024
7 checks passed
@kkufieta kkufieta deleted the kk/rsdk-5334-remove-unused-code branch January 10, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appimage Build AppImage of PR safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants