[SimpleFlight] move_to_position_async() times out without movement when lookahead=0.5

Open Beginner friendly
#241 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
robotics

Research direction

Start in vehicle_apis/multirotor_api/src/multirotor_api_base.cpp: compare the lookahead validation around lines 751-770 with the MoveToPathPosition temporary-target check around lines 1326-1341, focusing on the equality with GetDistanceAccuracy(). Reproduce with the supplied Python snippet using lookahead=0.5, then compare lookahead=-1; done means the 0.5 m boundary either moves the drone or is rejected up front with a clear parameter error instead of timing out.

Written by the indexing model from the issue text.

Description

bug-report SimpleFlight

Bug report

What's the issue you encountered?

With lookahead=0.5, move_to_position_async() accepts a command to ascend 2 m, but the drone does not move. The command returns False when it times out. With the default lookahead=-1, the drone ascends and returns True.

Tested branch: LucasJSch/ProjectAirSim, IAMAI/fix-takeoff. Commit: 9da8e86417e7ea3bd4075bd45dddfac2258f38f4.

Found while testing the fix for #236. Default takeoff passed on this branch. Latest main was not runtime-tested.

Expected: move toward the destination, or reject an unsupported lookahead value immediately with a clear error.

Include full error message in text form

No parameter error was raised. The command returned False after the timeout.

Lookahead Timeout Return Elapsed simulation time Ascent
0.5 8 s False 8.001 s 0.000 m
-1 (automatic) 20 s True 3.213 s 1.507 m

The automatic case finishes within the existing 0.5 m arrival tolerance.

Environment
  • Project AirSim: control libraries and UE plugin built from the commit above.
  • Autopilot: Simple Flight; quadrotor-x; Fast Physics; distance accuracy 0.5 m.
  • Windows 11 x64; Unreal Engine 5.2.1.
  • Python 3.11.17; projectairsim==1.0.2.
Settings

Both cases used the same custom UE test map and the unmodified v1.0.1 scene_basic_drone.jsonc and robot_quadrotor_fastphysics.jsonc.

How can the issue be reproduced?
  1. Start the build above and load the configuration.
  2. Wait for Drone1 to settle on the ground (LANDED, speed <= 0.05 m/s).
  3. Run the code below inside an async function, with world and drone initialized. It requests a 2 m ascent at 0.5 m/s.
  4. Reload the scene and repeat with lookahead=-1 and timeout_sec=20 for comparison.
if not drone.enable_api_control() or not drone.arm():
    raise RuntimeError("API control or arming failed")

start = drone.get_ground_truth_kinematics()["pose"]["position"]
sim_start = world.get_sim_time()
task = await drone.move_to_position_async(
    start["x"], start["y"], start["z"] - 2.0,  # NED: negative Z is up
    velocity=0.5, timeout_sec=8, lookahead=0.5,
)
result = await task
end = drone.get_ground_truth_kinematics()["pose"]["position"]
print({
    "result": result,
    "elapsed_sim_seconds": (world.get_sim_time() - sim_start) / 1e9,
    "ascent_m": start["z"] - end["z"],
})

await (await drone.land_async(timeout_sec=25))
drone.disarm()
drone.disable_api_control()
Possible cause

Two checks treat the 0.5 m boundary differently:

The temporary target is 0.5 m away, so the drone is told to stop. The final destination is still 2 m away, so the task cannot finish. This appears to explain the timeout.

Dominant language
C++
Stars
890
Forks
170
Avg merge
22h 57m
Merged PRs (30d)
6

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from iamaisim/ProjectAirSim

All issues in iamaisim/ProjectAirSim

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.