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

Execution order of simulation loop for drone in Unity #3126

Open
ykeuter opened this issue Nov 4, 2020 · 2 comments
Open

Execution order of simulation loop for drone in Unity #3126

ykeuter opened this issue Nov 4, 2020 · 2 comments

Comments

@ykeuter
Copy link
Contributor

ykeuter commented Nov 4, 2020

InvokeTickInAirSim is called in LateUpdate:

airsimInterface.InvokeTickInAirSim(Time.deltaTime);

while transform is updated in FixedUpdate:

Is there a reason for this? FixedUpdate and LateUpdate are not necessarily in sync.

Also, I would expect currentPose = poseFromAirLib; after transform is updated.

What am I missing?

@ykeuter
Copy link
Contributor Author

ykeuter commented Nov 21, 2020

I changed this execution order in PR #3128 .

Without these changes, on the first call to FixedUpdate the drones are positioned at the origin (since poseFromAirLib is not set yet), causing a collision. AirSim then processes this collision, but at the actual position of the drones, causing the drones to tumble down.

Something similar happens in single drone mode. In this case the "fake" collision (with the floor at the origin now) is interpreted as a landing by AirSim, making the drone "hover" mid-air at the start, even though it is only armed.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had activity from the community in the last year. It will be closed if no further activity occurs within 20 days.

@stale stale bot added the stale label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants