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

offboard::set_position_velocity_ned #1532

Open
ucas-zihaowang opened this issue Sep 6, 2021 · 12 comments
Open

offboard::set_position_velocity_ned #1532

ucas-zihaowang opened this issue Sep 6, 2021 · 12 comments
Labels

Comments

@ucas-zihaowang
Copy link

Hello,

In the funtion
Offboard::Result Offboard::set_position_velocity_ned( PositionNedYaw position_ned_yaw, VelocityNedYaw velocity_ned_yaw);

What does VelocityNedYaw mean? Average velocity in each direction ?
Actual flying, I set different VelocityNedYaw, the fly speed is always too fast.

Thanks.

@julianoes
Copy link
Collaborator

It's actually a bit confusing. I believe what the speed sets is the "feed-forward" term for the control.
@Jaeyoung-Lim or @MaEtUgR maybe you can explain it better.

@ucas-zihaowang ucas-zihaowang changed the title offbboard::set_position_velocity_ned offboard::set_position_velocity_ned Sep 7, 2021
@Jaeyoung-Lim
Copy link
Contributor

@happyzihao Could you elaborate on what do you man by too fast? Is it moving faster than the desired setpoint velocity?

@julianoes
Copy link
Collaborator

@happyzihao you can limit the speed using the param MPC_XY_CRUISE.

The velocity that you add to the MAVSDK interface is a control feed-forward.

@julianoes
Copy link
Collaborator

Note to self: we should describe that better in the API docs.

@PeymanAmirii
Copy link

Thanks for your answers. In control, feed-forward usually used for disturbances or outer effects. How do you use velocity as feedforward?
For example the current point is [0, 0, 0] and the desired one is [10, 0, 0]. If we use set_position_velocity_ned(PositionNedYaw(10, 0, 0, 0),VelocityNedYaw(1, 2, 0, 0)), what happens?

@julianoes
Copy link
Collaborator

Without getting into the details of controls, what are you trying to do?

@PeymanAmirii
Copy link

PeymanAmirii commented Jul 29, 2022

I want the quadcopter to fly from its current point A to point B. I want to know what happens if vecotors AB and target velocity have different directions and we use the command set_position_velocity_ned(PositionNedYaw(B_north, B_east, B_down, 0),VelocityNedYaw(target_velocity_north, arget_velocity_east, arget_velocity_down, 0)).

@julianoes
Copy link
Collaborator

You want to fly from A to B, ok. And then you lost me.

@PeymanAmirii
Copy link

PeymanAmirii commented Aug 2, 2022

Thanks for your answer. What I am trying to say is that we can send target velocity and target position using the command set_position_velocity_ned. Conisder that a drone is at point A and we set point B as the target point and also we consider a target velocity vector for the dorne. If we use the command set_position_velocity_ned to send the target velocity and pont but the vector from point A to B has different direction with target velocity, then what happens?
(I think that target velocity and vector from A to B should always have the same direction, but how the command handles the case if they don't have the same direction)

@julianoes
Copy link
Collaborator

Ok, so I think the PX4 controller will go in a straight line between A and B. However, if you, for instance know that there is a strong wind coming from one side you could command the feedforward against that wind and therefore the controller would be able to resist the wind better (at least initially) because it doesn't need to be perturbed by the wind first to find out that it needs to correct for it, but instead you can fight it earlier.

If your feedforward is not against wind but just wants to fly somewhere else, let's say to fly a round trajectory, then you will essentially fight the position controller, and you'll end up with something in between, based on your tuning and how strong your feedforward is.

Does that make sense?

@PeymanAmirii
Copy link

PeymanAmirii commented Aug 5, 2022

Thanks. So I think when we send both the target velocity and target position, the output is a sum of the outputs of the separate position controller and velocity controller. Therefore, they can conflict with each other.

@julianoes
Copy link
Collaborator

Right.

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

No branches or pull requests

4 participants