-
Notifications
You must be signed in to change notification settings - Fork 4.7k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How to force the drone flying with the specific velocity and Eular angle without fast-physics ? #3203
Comments
Hi @misakabribri , this will mainly depend on the flight data you gathered. For example, if its a PX4 mission, you can simply run AirSim in PX4 SITL or HITL mode and upload your mission to be executed. To address the points you mentioned, if I understand what you're trying to do correctly,
|
@ahmed-elsaharti I found some API functions in RpcLibClientBase.hpp:
|
@misakabribri you could try using simSetVehiclePose to teleport the vehicle along a path but it would still be using multirotor physics. With CV mode you pretty much just have a camera moving around in the scene. Have a look at #2955, my understanding is that the author is working on a fixed wing model there |
@ahmed-elsaharti, do you think that using CV mode and using the blueprint drone (that can be added through the ue editor) can be a way of accomplishing this? Then we can move the drone through |
@jonyMarino This is a BRILLIANT idea! This could also be used as a hacky solution for #3208 import airsim
client = airsim.VehicleClient()
client.confirmConnection()
pose1 = client.simGetObjectPose("BP_FlyingPawn_5");
pose1.position = pose1.position + airsim.Vector3r(-2, -2, -2)
success = client.simSetObjectPose("BP_FlyingPawn_5", pose1, True); |
The preferred way is to use That said, there is currently an open issue with The interesting next step is to go one level beyond setting the vehicle pose, and instead overriding the entire state. Currently,
|
@saihv I haven't experimented with CV mode so far so I might (will probably) be completely wrong here, but doesn't CV mode not spawn any vehicles? My understanding at this point is that the only vehicle that we can set the pose of in CV mode is the actual camera. right? |
Sorry! I made a typo. I meant [non-CV mode (Multirotor) and Teleporting the drone through |
@saihv I've tested the CV mode + What I did to test this was to set up a scene with a drone_pawn as an object in there: This is the initial camera pose and object location: I then grabbed the object's location and moved it 4m backwards using pose1 = client.simGetObjectPose("BP_FlyingPawn_5");
pose1.position = pose1.position + airsim.Vector3r(-4, 0, 0)
success = client.simSetObjectPose("BP_FlyingPawn_5", pose1, True); I then moved the camera backwards an equal amount camera_pose = airsim.Pose(airsim.Vector3r(-4, 0, 0), airsim.to_quaternion(0, 0, 0))
client.simSetCameraPose("0", camera_pose) This resulted in only the camera moving within the original frame. Just to make sure that everything is still referenced to that coordinate system i moved the drone backwards again to pose2: which showed that they're both 4m apart with pose1 grabbed/changed before camera movement while pose2 was grabbed/changed after it. which leads me to conclude that the camera movement did not affect the coordinate system the drone/object is referenced to or the rest of the scene objects. Is it safe to assume that this is a viable solution or is my testing method flawed? Edit: forgot to mention that moving the camera manually after and before these works fine too |
@ahmed-elsaharti Thanks for the quick test! EDIT: Actually nvm, it does make sense. Because NedTransform::NedTransform() is instantiated at the start with a global transform, it will keep a constant origin reference and it shouldn't matter what happens to the pose of the camera or the computer vision pawn itself during the simulation: because |
@saihv I meant the manual WASD camera controls available through the view mode enabled through the Also, would you recommend using this method to programmatically set the orientation of a fixed-location camera trying to |
Yeah I think it should work. I forgot about the |
@saihv I honestly do not blame you. AirSim's got ALOT of functions that are very similarly named. This would be a good segue into the 'API documentation' topic but thats out of the issue's scope anyway 😂.
Yup for the case of #3208 my understanding is that AirSim would be used as a tool to 'visualize/draw' the data. So the drone would be an arbitrary object. |
Side note, I am noticing some weird behavior with M in CV mode. WASD + |
Woops, i just realized that i meant F-mode rather than M-mode. Sorry about that |
Yeah I think as long as F / WASD works it's fine, M is probably decoupling the camera director from the pawn. WASD movement actually displaces the ComputerVisionPawn in the UE world, so that was what I was mainly curious about |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
OS: Windows 10
IDE: VS 2019;
Unreal: UE 4.24.3
Hello. I already have the fligt data (including positions and Euler angles) gathered from other simulation platforms. I want to use AirSim to 'playback' the flight data (just like a 3D-film) and capture images of the drone.
I guess there are at least two things to do:
but I don't know how to do these things.
The text was updated successfully, but these errors were encountered: