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

ResetBasePositionAndOrientation didn't work while simulation is running. #193

Open
Omikaa opened this issue Mar 1, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@Omikaa
Copy link

Omikaa commented Mar 1, 2024

I set a function in one step in the training env.And it is to test whether the drone flies out of the bound.
If it flies out of the bound that I set, the function will reset the drone's pos, orientation and velocity. Then I can give a punishment in reward, and the episode can be going on.
But when I use the function, I clip the pos first.And use pybullet.resetBasePositionAndOrientation to reset its pos.However, in the simulation environment, the quadrotor's pos will not be changed.
After running pybullet.stepSimulation, the value of the pos will become that is before clipping.
I have no idea why pybullet.stepsimulation doesn't work.

@JacopoPan JacopoPan added the question Further information is requested label Mar 16, 2024
@JacopoPan
Copy link
Member

Something like this should work, if it doesn't for you, please provide a minimal example of the problem

p.resetBasePositionAndOrientation(self.DRONE_IDS[nth_drone],
                                          pos,
                                          quat,
                                          physicsClientId=self.CLIENT
                                          )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants