Skip to content

Commit

Permalink
[DATA-277] Update date/time format to match datamanager (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnN193 authored Oct 26, 2022
1 parent be610ce commit de8a070
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
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.
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

0 comments on commit de8a070

Please sign in to comment.