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 a "timestamp" item to the info return value from DrakeGymEnv.step(...) #21899

Open
samzapo opened this issue Sep 12, 2024 · 2 comments · May be fixed by #21900
Open

Add a "timestamp" item to the info return value from DrakeGymEnv.step(...) #21899

samzapo opened this issue Sep 12, 2024 · 2 comments · May be fixed by #21900
Assignees
Labels
component: pydrake Python API and its supporting Starlark macros

Comments

@samzapo
Copy link
Collaborator

samzapo commented Sep 12, 2024

It is often helpful to have the simulation timestamp after a call to env.step() to, e.g. render a video of image observations with simulation time as the video's timestamp.

def step(self, action):

@samzapo samzapo linked a pull request Sep 12, 2024 that will close this issue
@samzapo
Copy link
Collaborator Author

samzapo commented Sep 13, 2024

Alternatively, this issue could be titled "add option to customize info returned by calls to step() and reset().

E.g., a Callable provided to __init__.

DrakeGymEnv.__init__(
    ...
    calc_step_info_function :  Callable[[Simulator, Context], dict] = None,
    ...
)

where an implementation that solves my issue would be:

def calc_step_info_function(simulator, diagram_context) -> dict:
    info = {"timestamp", diagram_context.get_time()}
    return info

@jwnimmer-tri
Copy link
Collaborator

Given #21900, I'll assign @samzapo on this issue.

@jwnimmer-tri jwnimmer-tri added the component: pydrake Python API and its supporting Starlark macros label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pydrake Python API and its supporting Starlark macros
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants