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

[DATA-277] Update date/time format to match datamanager #1504

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions services/slam/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ const (
defaultMapRateSec = 60
cameraValidationIntervalSec = 1.
parsePortMaxTimeoutSec = 60
// TODO change time format to .Format(time.RFC3339Nano) https://viam.atlassian.net/browse/DATA-277
// time format for the slam service.
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] Remove TODO. There are also a few other TODOs for DATA-277, so please make sure to remove them all.

slamTimeFormat = "2006-01-02T15_04_05.0000"
slamTimeFormat = time.RFC3339Nano
opTimeoutErrorMessage = "bad scan: OpTimeout"
localhost0 = "localhost:0"
)
Expand Down Expand Up @@ -958,7 +957,6 @@ func (slamSvc *builtIn) getAndSaveDataDense(ctx context.Context, cams []camera.C
// Creates a file for camera data with the specified sensor name and timestamp written into the filename.
// For RGBD cameras, two filenames are created with the same timestamp in different directories.
func createTimestampFilenames(cameraName, dataDirectory, fileType string, slamMode slam.Mode) ([]string, error) {
// TODO change time format to .Format(time.RFC3339Nano) https://viam.atlassian.net/browse/DATA-277
timeStamp := time.Now()

switch slamMode {
Expand Down
1 change: 0 additions & 1 deletion services/slam/builtin/orbslam_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ func (slamSvc *builtIn) orbGenYAML(ctx context.Context, cam camera.Camera) error
slamSvc.logger.Debugf("Error occurred while parsing %s for maps, building map from scratch", slamSvc.dataDirectory)
}
if loadMapTimeStamp == "" {
// TODO change time format to .Format(time.RFC3339Nano) https://viam.atlassian.net/browse/DATA-277
loadMapTimeStamp = time.Now().UTC().Format(slamTimeFormat)
} else {
orbslam.LoadMapLoc = "\"" + loadMapName + "\""
Expand Down
2 changes: 1 addition & 1 deletion services/slam/builtin/orbslam_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
yamlFilePrefixBytes = "%YAML:1.0\n"
slamTimeFormat = "2006-01-02T15_04_05.0000"
slamTimeFormat = time.RFC3339Nano
)

// function to search a SLAM data dir for a .yaml file. returns the timestamp and filepath.
Expand Down