I’m working on logging the position of a 4-wheeled holonomic robot, but I’m having trouble with the data logger as it does not call the frame_logging_func(task, scene)
function which is added using data_logger.add_data_frame_logging_func(frame_logging_func)
.
My code is based on the Follow Target example from the tutorials, however the output file always end up empty. It is possible to manually add data to the data logger using data_logger.add_data(...)
and this is stored successfully in the output file, but the function passed to the data_logger.add_data_frame_logging_func()
seems to never be called (this has been checked by printing within the function)
The code below shows the function triggered when the start logging button is clicked. The repo for the extension can be found here (The project is still under development and I’m relatively new to omniverse)
def _on_logging_event(self, val):
world = self.get_world()
data_logger = world.get_data_logger()
if not world.get_data_logger().is_started():
def frame_logging_func(tasks, scene):
return {
"joint_positions": 0
}
data_logger.add_data_frame_logging_func(frame_logging_func)
data_logger.add_data({"joint_positions": 0}, 1.0, 1.0)
if val:
data_logger.start()
else:
data_logger.pause()
return