diff --git a/CHANGELOG.md b/CHANGELOG.md index c350219..1a5d641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). ## Unreleased +## 0.10.4 - 2024-04-09 +### Added +- `reconfigure` + - `ParameterServer.getValue()` to obtain the parameter value. + ## 0.10.3 - 2024-04-09 ### Added - Before building the project, all uncommitted changes are stashed. diff --git a/autopsy/reconfigure.py b/autopsy/reconfigure.py index 1725bd6..46f29bd 100644 --- a/autopsy/reconfigure.py +++ b/autopsy/reconfigure.py @@ -1011,6 +1011,30 @@ def __contains__(self, name): return name in self._parameters + def getValue(self, name): + """Obtain a value of parameter 'name'. + + Arguments: + name -- name of the parameter, str + + Returns: + value -- value of the parameter, any + + Raises: + ValueError -- when parameter with name 'name' does not exist + + Note: This serves as a compatibility layer with other versions + of parameter handling classes. All parameters can be still accessed + using the dot notation. + """ + if not self.__contains__(name): + raise ValueError( + "Parameter with name '%s' does not exist." % name + ) + + return self._parameters[name].value + + def link(self, param1, param2): """Links two constrained parameters together so one cannot be more then the other. diff --git a/package.xml b/package.xml index f1dea7d..8556cfc 100644 --- a/package.xml +++ b/package.xml @@ -4,7 +4,7 @@ schematypens="http://www.w3.org/2001/XMLSchema"?> autopsy - 0.10.3 + 0.10.4 A set of Python utils for F1Tenth project. Jaroslav Klapálek