From c1a3187fdc11f3f8a74b3d72d2fa841ee37162c5 Mon Sep 17 00:00:00 2001 From: johnn193 Date: Mon, 17 Oct 2022 18:35:09 +0100 Subject: [PATCH 1/2] update time format --- services/slam/builtin/builtin.go | 2 +- services/slam/builtin/orbslam_yaml_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/slam/builtin/builtin.go b/services/slam/builtin/builtin.go index 13ed71c8f71..3f980e43f8e 100644 --- a/services/slam/builtin/builtin.go +++ b/services/slam/builtin/builtin.go @@ -57,7 +57,7 @@ const ( parsePortMaxTimeoutSec = 60 // TODO change time format to .Format(time.RFC3339Nano) https://viam.atlassian.net/browse/DATA-277 // time format for the slam service. - slamTimeFormat = "2006-01-02T15_04_05.0000" + slamTimeFormat = time.RFC3339Nano opTimeoutErrorMessage = "bad scan: OpTimeout" localhost0 = "localhost:0" ) diff --git a/services/slam/builtin/orbslam_yaml_test.go b/services/slam/builtin/orbslam_yaml_test.go index 3aeb2164d71..dc14b4ff3b5 100644 --- a/services/slam/builtin/orbslam_yaml_test.go +++ b/services/slam/builtin/orbslam_yaml_test.go @@ -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. From 59ee560229cd928616d840abe98ce9917862794b Mon Sep 17 00:00:00 2001 From: johnn193 Date: Tue, 25 Oct 2022 16:11:41 +0100 Subject: [PATCH 2/2] remove comments --- services/slam/builtin/builtin.go | 2 -- services/slam/builtin/orbslam_yaml.go | 1 - 2 files changed, 3 deletions(-) diff --git a/services/slam/builtin/builtin.go b/services/slam/builtin/builtin.go index 3f980e43f8e..30dba716d7a 100644 --- a/services/slam/builtin/builtin.go +++ b/services/slam/builtin/builtin.go @@ -55,7 +55,6 @@ 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. slamTimeFormat = time.RFC3339Nano opTimeoutErrorMessage = "bad scan: OpTimeout" @@ -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 { diff --git a/services/slam/builtin/orbslam_yaml.go b/services/slam/builtin/orbslam_yaml.go index f392db09660..f5d3a2ef13a 100644 --- a/services/slam/builtin/orbslam_yaml.go +++ b/services/slam/builtin/orbslam_yaml.go @@ -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 + "\""