problems encountered using python api "simSetVehiclePose" #4742
Unanswered
DarkKnightCyd
asked this question in
Support Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I use api "simSetVehiclePose" to spawn the drone at certain position .It seems that the drone cannot reach to given pose after the function was called.To evaluate this, I wrote a while loop to find out ,here's the code:
while True:self.drone.simSetVehiclePose(pose, False, self.drone_name)time.sleep(1)s_now=self.drone.simGetVehiclePose(self.drone_name)col =self.drone.simGetCollisionInfo(self.drone_name)if col.has_collided:breakif np.linalg.norm(s_now.position.to_numpy_array() - pose.position.to_numpy_array()) < 1.e-2 and \ np.linalg.norm(s_now.orientation.to_numpy_array() - pose.orientation.to_numpy_array()) < 1.e-2:breaki += 1print(i)And it turns out that it takes serveral times to get drone to given pose.And here's my settings.json:
{
"SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md",
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"PhysicsEngineName": "ExternalPhysicsEngine",
"ClockSpeed":1,
"Vehicles": {
"Drone1": {
"VehicleType": "simpleflight",
}
Can anyone help with this issue? Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions