-
Notifications
You must be signed in to change notification settings - Fork 88
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
simGetObjectPose(gate_name) randomly returns nan #38
Comments
This workaround does the trick for me: MAX_NUMBER_OF_GETOBJECTPOSE_TRIALS = 10
def get_ground_truth_gate_poses(self):
gate_names_sorted_bad = sorted(self.airsim_client.simListSceneObjects("Gate.*"))
gate_indices_bad = [int(gate_name.split('_')[0][4:]) for gate_name in gate_names_sorted_bad]
gate_indices_correct = sorted(range(len(gate_indices_bad)), key=lambda k: gate_indices_bad[k])
gate_names_sorted = [gate_names_sorted_bad[gate_idx] for gate_idx in gate_indices_correct]
res = []
for gate_name in gate_names_sorted:
p = self.airsim_client.simGetObjectPose(gate_name)
cpt = 0
while (math.isnan(p.position.x_val) or math.isnan(p.position.y_val) or math.isnan(p.position.z_val)) and cpt < MAX_NUMBER_OF_GETOBJECTPOSE_TRIALS:
print(f"DEBUG: {gate_name} position is nan, retrying...")
cpt = cpt + 1
p = self.airsim_client.simGetObjectPose(gate_name)
assert not math.isnan(p.position.x_val), f"ERROR: {gate_name} p.position.x_val is still {p.position.x_val} after {cpt} trials"
assert not math.isnan(p.position.y_val), f"ERROR: {gate_name} p.position.y_val is still {p.position.y_val} after {cpt} trials"
assert not math.isnan(p.position.z_val), f"ERROR: {gate_name} p.position.z_val is still {p.position.z_val} after {cpt} trials"
res.append(p)
return res |
msb336
pushed a commit
to msb336/AirSim-NeurIPS2019-Drone-Racing
that referenced
this issue
Sep 12, 2019
msb336
pushed a commit
to msb336/AirSim-NeurIPS2019-Drone-Racing
that referenced
this issue
Sep 12, 2019
madratman
added a commit
to madratman/AirSim-NeurIPS2019-Drone-Racing
that referenced
this issue
Sep 12, 2019
madratman
added a commit
to madratman/AirSim-NeurIPS2019-Drone-Racing
that referenced
this issue
Sep 12, 2019
This is happening very rarely coz of an unreal APIs we're using the backend - getAllActors - which fail randomly. |
msb336
added a commit
that referenced
this issue
Sep 26, 2019
fix nan checker snippet in baseline_racer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I have been working quite a while on debugging an algorithm where 'nan' appeared randomly to finally find that this snippet from the baseline is responsible:
This randomly returns 'nan's on random gates after calling airsim_client.reset() repeatedly.
Regards,
Yann.
The text was updated successfully, but these errors were encountered: