From de8a0703b2c07842edb9506561dd7ad03fe98c58 Mon Sep 17 00:00:00 2001 From: JohnN193 <92045055+JohnN193@users.noreply.github.com> Date: Wed, 26 Oct 2022 13:09:56 -0400 Subject: [PATCH] [DATA-277] Update date/time format to match datamanager (#1504) --- services/slam/builtin/builtin.go | 4 +--- services/slam/builtin/orbslam_yaml.go | 1 - services/slam/builtin/orbslam_yaml_test.go | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/services/slam/builtin/builtin.go b/services/slam/builtin/builtin.go index b76117b1853..154f885a2a0 100644 --- a/services/slam/builtin/builtin.go +++ b/services/slam/builtin/builtin.go @@ -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. - slamTimeFormat = "2006-01-02T15_04_05.0000" + slamTimeFormat = time.RFC3339Nano opTimeoutErrorMessage = "bad scan: OpTimeout" localhost0 = "localhost:0" ) @@ -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 + "\"" 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.