Add more variables to jiminy log #829
-
Hi,
but the log generated does not contain the new_column variable. |
Beta Was this translation helpful? Give feedback.
Answered by
duburcqa
Jul 24, 2024
Replies: 1 comment 1 reply
-
It is not how it works. You have to delegate this task to the controller. I don't know what you are doing. If you are doing robotics simulation without reinforcement learning, then here is the easiest way to do it: # Keep track of the variables being manually registered.
# The user is responsible for managing their lifetime and update them.
registered_variables = []
# Define a new variable.
# It stores the "current" value that will be written in the log regularly,
# which has to be a `np.ndarray` so that it can be updated in-place using
# `[:] =` assignment operator (or `[()] =` for 0-d scalar arrays).
# The user is responsible for updating it manually whenever its value is
# supposed to change, at user discretion.
registered_variables.append((["my_var_0", "my_var_1"], np.array((2,))
for fieldnames, data in registered_variables.values():
simulator.robot.controller.register_variables(fieldnames, data) I should add an example to document it properly. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lucas-levy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is not how it works. You have to delegate this task to the controller. I don't know what you are doing. If you are doing robotics simulation without reinforcement learning, then here is the easiest way to do it: