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
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ setup: install-dependencies ensure-submodule-initialized artifact-pull
install-dependencies:
ifneq (, $(shell which brew))
brew update
brew install abseil boost viamrobotics/brews/ceres-solver@2.1 protobuf ninja cairo googletest lua@5.3 pkg-config cmake go@1.20 grpc clang-format
brew install abseil boost viamrobotics/brews/suite-sparse@7.1 viamrobotics/brews/ceres-solver@2.1 protobuf ninja cairo googletest lua@5.3 pkg-config cmake go@1.20 grpc clang-format
kkufieta marked this conversation as resolved.
Show resolved Hide resolved
brew link lua@5.3
brew install openssl@3 eigen gflags glog sphinx-doc pcl viamrobotics/brews/nlopt-static
else ifneq (, $(shell which apt-get))
Expand Down
28 changes: 6 additions & 22 deletions cartofacade/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,11 @@ const (
type CartoConfig struct {
Camera string
MovementSensor string
MapRateSecond int
DataDir string
ComponentReference string
LidarConfig LidarConfig

CloudStoryEnabled bool
EnableMapping bool
ExistingMap string
EnableMapping bool
ExistingMap string
}

// CartoAlgoConfig contains config values from app
Expand Down Expand Up @@ -392,17 +389,6 @@ func getConfig(cfg CartoConfig) (C.viam_carto_config, error) {
return C.viam_carto_config{}, err
}

// Remove cloud_story_enabled, map_rate_sec, and data_dir from C++ code
// JIRA Ticket: RSDK-52334 https://viam.atlassian.net/browse/RSDK-5334
vcc.cloud_story_enabled = C.bool(true)
vcc.data_dir = goStringToBstring("/tmp/")
if cfg.EnableMapping {
// Set to arbitrarily high value to ensure no maps get saved during operation
vcc.map_rate_sec = C.int(9000)
} else {
vcc.map_rate_sec = C.int(0)
}

vcc.lidar_config = lidarCfg

vcc.enable_mapping = C.bool(cfg.EnableMapping)
Expand Down Expand Up @@ -519,20 +505,16 @@ func toError(status C.int) error {
return errors.New("VIAM_CARTO_LIB_NOT_INITIALIZED")
case C.VIAM_CARTO_UNKNOWN_ERROR:
return errors.New("VIAM_CARTO_UNKNOWN_ERROR")
case C.VIAM_CARTO_DATA_DIR_NOT_PROVIDED:
return errors.New("VIAM_CARTO_DATA_DIR_NOT_PROVIDED")
case C.VIAM_CARTO_SLAM_MODE_INVALID:
return errors.New("VIAM_CARTO_SLAM_MODE_INVALID")
case C.VIAM_CARTO_LIDAR_CONFIG_INVALID:
return errors.New("VIAM_CARTO_LIDAR_CONFIG_INVALID")
case C.VIAM_CARTO_MAP_RATE_SEC_INVALID:
return errors.New("VIAM_CARTO_MAP_RATE_SEC_INVALID")
case C.VIAM_CARTO_COMPONENT_REFERENCE_INVALID:
return errors.New("VIAM_CARTO_COMPONENT_REFERENCE_INVALID")
case C.VIAM_CARTO_LUA_CONFIG_NOT_FOUND:
return errors.New("VIAM_CARTO_LUA_CONFIG_NOT_FOUND")
case C.VIAM_CARTO_DATA_DIR_INVALID_DEPRECATED_STRUCTURE:
return errors.New("VIAM_CARTO_DATA_DIR_INVALID_DEPRECATED_STRUCTURE")
case C.VIAM_CARTO_INTERNAL_STATE_FILE_SYSTEM_ERROR:
return errors.New("VIAM_CARTO_INTERNAL_STATE_FILE_SYSTEM_ERROR")
case C.VIAM_CARTO_MAP_CREATION_ERROR:
return errors.New("VIAM_CARTO_MAP_CREATION_ERROR")
case C.VIAM_CARTO_UNKNOWN_SENSOR_NAME:
Expand Down Expand Up @@ -567,6 +549,8 @@ func toError(status C.int) error {
return errors.New("VIAM_CARTO_NOT_IN_TERMINATABLE_STATE")
case C.VIAM_CARTO_IMU_PROVIDED_AND_IMU_ENABLED_MISMATCH:
return errors.New("VIAM_CARTO_IMU_PROVIDED_AND_IMU_ENABLED_MISMATCH")
case C.VIAM_CARTO_IMU_READING_EMPTY:
return errors.New("VIAM_CARTO_IMU_READING_EMPTY")
case C.VIAM_CARTO_IMU_READING_INVALID:
return errors.New("VIAM_CARTO_IMU_READING_INVALID")
case C.VIAM_CARTO_ODOMETER_READING_INVALID:
Expand Down
1 change: 0 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type OptionalConfigParams struct {
LidarDataFrequencyHz int
MovementSensorName string
MovementSensorDataFrequencyHz int
MapRateSec int
EnableMapping bool
ExistingMap string
}
Expand Down
2 changes: 0 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func TestGetOptionalParameters(t *testing.T) {
test.That(t, optionalConfigParams.MovementSensorName, test.ShouldEqual, "")
test.That(t, optionalConfigParams.MovementSensorDataFrequencyHz, test.ShouldEqual, 0)
test.That(t, optionalConfigParams.EnableMapping, test.ShouldBeFalse)
test.That(t, optionalConfigParams.MapRateSec, test.ShouldEqual, 0)
test.That(t, optionalConfigParams.ExistingMap, test.ShouldEqual, "")
})

Expand All @@ -150,7 +149,6 @@ func TestGetOptionalParameters(t *testing.T) {
test.That(t, optionalConfigParams.MovementSensorName, test.ShouldEqual, "")
test.That(t, optionalConfigParams.MovementSensorDataFrequencyHz, test.ShouldEqual, 0)
test.That(t, optionalConfigParams.EnableMapping, test.ShouldBeFalse)
test.That(t, optionalConfigParams.MapRateSec, test.ShouldEqual, 0)
test.That(t, optionalConfigParams.ExistingMap, test.ShouldEqual, "")
})

Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func TestIntegrationCartographer(t *testing.T) {
test.That(t, err, test.ShouldBeNil)
}()

// Set mapRateSec for mapping mode
// Enable mapping mode
enableMapping := true

// Run mapping test
Expand Down
Loading
Loading