Skip to content
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

No horizontal movement API in drone's x, y, z axes #3138

Closed
ICYPOLE opened this issue Nov 14, 2020 · 5 comments · Fixed by #3169
Closed

No horizontal movement API in drone's x, y, z axes #3138

ICYPOLE opened this issue Nov 14, 2020 · 5 comments · Fixed by #3169

Comments

@ICYPOLE
Copy link

ICYPOLE commented Nov 14, 2020

OS: Win10
AirSim: v1.3.1
Python: v3.6.12

I am currently writing a PC keyboard controller in Python for controlling drone. When trying to control the drone for horizontal movement, I found that all of the APIs, such as moveByVelocityAsync, setVelocityControllerGains, are implemented for world x, y, z axes.

I wonder if there is any possible solution to move the drone horizontally in the drone's x, y, z axes, which is more intuitive.

@ICYPOLE ICYPOLE changed the title No x, y horizontal movement API in drone-axis. No x, y horizontal movement API in drone's x, y, z axes Nov 14, 2020
@ICYPOLE ICYPOLE changed the title No x, y horizontal movement API in drone's x, y, z axes No horizontal movement API in drone's x, y, z axes Nov 14, 2020
@rlalpha
Copy link

rlalpha commented Nov 14, 2020

same problem here too.
Try to connect my remote controller: which have format rc: x_velocity, y_velocity, z_velocity, rotate_velocity

@ahmed-elsaharti
Copy link
Contributor

You could create a function that uses the pitch, roll and yaw of the vehicle (from simGetVehiclePose) to break a velocity vector in the Drone's x,y,z axes to components in the world x,y,z axes and then use moveByVelocityAsync to execute those components which would result in an overall motion equivalent to the drone vector you wanted.

Here's a quick 2D example to show what I mean
image

@jonyMarino
Copy link
Collaborator

jonyMarino commented Nov 24, 2020

Hey @ICYPOLE! That would be very handy. Want to submit a PR for a new moveByVelocityBodyFrameAsync and setVelocityControllerGainsBodyFrame with Ahmed's approach?

@jonyMarino
Copy link
Collaborator

Thanks, @ahmed-elsaharti, for your PR! Just for curiosity, what tool are you using to make your graphics?

@jonyMarino jonyMarino linked a pull request Dec 1, 2020 that will close this issue
@ahmed-elsaharti
Copy link
Contributor

@jonyMarino I generally use Microsoft Onenote along with my graphics tablet 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants