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

Motor Delay #223

Open
zcase opened this issue Jun 28, 2024 · 0 comments
Open

Motor Delay #223

zcase opened this issue Jun 28, 2024 · 0 comments

Comments

@zcase
Copy link

zcase commented Jun 28, 2024

@JacopoPan do you know of a way to induce motor delay for a given time amount using the _pyhiics function or would we need to use the _dynamics function to do this?

Could we modify the step function to change:

if self.PHYSICS != Physics.DYN:
    p.stepSimulation(physicsClientId=self.CLIENT)

to

if self.PHYSICS != Physics.DYN:
    for _ in range(self.num_of_steps_for_dealy):
        p.stepSimulation(physicsClientId=self.CLIENT)

where the num_of_steps is calculated by doing something like:

motor_delay_ms = 100  # milliseconds
self.num_of_steps_for_dealy = int(pyb_freq * (motor_delay_ms / 1000))

I did try this but it seems to just instantly crash the drone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant