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

Add optional configuration parameters for osgar.record #968

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

m3d
Copy link
Member

@m3d m3d commented Nov 28, 2023

The variable application for config file is deprecated so there is a need to pass variable configuration parameters via osgar.record. This PR provides new way using --param key=value for example --param app.max_speed=0.1. This was experimentally tested on robot Eduro.

@m3d m3d requested a review from tajgr November 28, 2023 17:36
osgar/record.py Outdated
@@ -88,12 +88,16 @@ def main(record=record):
parser.add_argument('--duration', help='recording duration (sec), default infinite', type=float)
parser.add_argument('--log', help='force record log filename')
parser.add_argument('--application', help='import string to application', default=None)
parser.add_argument('--param', action='append',
help='optional configuration parameters like go.max_speed=0.1')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if more parameters need to be added? nargs='*' ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well for one --param there is only one value, which is "key=value" and not more arguments. You can specify multiple calls via action='append'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example of yesterday run was python -m osgar.record --application osgar.go:Go config/eduro.json --note "try old config" --param app.dist=0.2 --param app.timeout=10.0

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. I would prefer just --param app.dist=0.2 app.timeout=10.0. There it could be also --params?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, in that case it could be --params and nargs='+'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested with simulator. It looks well. Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks m.

@m3d m3d merged commit 91198d2 into master Dec 1, 2023
6 checks passed
@m3d m3d deleted the feature/param-record branch December 1, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants