Comments (2)
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
from airsim-neurips2019-drone-racing.
This is happening very rarely coz of an unreal APIs we're using the backend - getAllActors - which fail randomly.
I've incorporated your suggestion in the baseline racer. It makes sense for the simgetobjectpose API to return NaN when object is not found, and the user to check it coz of this edge case
Didn't want to throw an error, which might kill the user's script
from airsim-neurips2019-drone-racing.
Related Issues (20)
- To delete
- Deploying AirSim-based simulations on real-world systems (UAVs) HOT 1
- Fresh install and have error HOT 7
- FPV camera can not send flying drone images back (only the nonFLY drone camera work) HOT 2
- Any way to download/use just the environments? HOT 4
- How to unblock sim- APIs HOT 1
- simGetDisqualified() not working
- [Linux] AirSimExe no longer working HOT 3
- Increase Maximum Throttle HOT 1
- Race finished after reaching first gate HOT 4
- Gate passed in log file no longer updated after drone 2 overtaking HOT 1
- Fresh install crashes on startup HOT 1
- Camera settings API
- getRotorState Error
- Implementation on Pixhawk
- getting instance segmentation
- Airsim Blocks binary in docker Linux crashes after few iteration HOT 1
- Read ClockSpeed via code
- RPCError when calling simGetImages with several instances of ImageRequest
- This repo is missing important files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airsim-neurips2019-drone-racing.