Skip to content

Conversation

@jingxiangmo
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the control loop timing in the JoystickRNNDeploy run method to better manage sleep intervals and log loop overrun times. Key changes include:

  • Replacing the previous target_time mechanism with a sleep_time computed from the loop start time.
  • Reordering the asyncio.gather call to correctly assign the observation.
  • Adding a general exception block to log errors before performing postflight cleanup.
Comments suppressed due to low confidence (1)

ksim_kbot/deploy/deploy_joystick_rnn.py:196

  • Verify that the ordering in asyncio.gather is intentional so that observation is properly assigned from get_observation. Misordering could result in unintended behavior if the order of returned results does not match the expected variable assignment.
_, observation = await asyncio.gather(self.send_actions(position, velocity), self.get_observation(),)

@WT-MM
Copy link
Contributor

WT-MM commented Apr 28, 2025

I think the current implementation is actually more correct than this. Adding dt to the loop process time would lead to overruns. By using target time, we're basically saying "whatever happens, we want to start the next iteration at the expected time."

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.

5 participants