-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Multicopter auto - Yaw at waypoint before move #12348
Conversation
@bresch Master |
@PX4/testflights Can you try this PR with the parameter
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions.
// Wait for the yaw setpoint to be aligned | ||
if (!_position_locked) { | ||
_velocity_setpoint.setAll(0.f); | ||
_position_setpoint = _position; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this happens at considerable speed we might have some strange behavior with overshoot and returning back to the point where the trajectory change happened. Maybe just setting the velocity setpoint to 0 would be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no smoothing in that flight task, setting velocity to 0 would lead to some drift.
Will this parameter be automatically selected when automatic avoidance is turned on? |
I have a couple of questions:
Unfortunately, the way the navigator is written, you basically always have to yaw first before proceeding the next waypoint IF the vehicle heading is set to point towards the next waypoint. Otherwise, the heading check within |
@xdwgood I don't think we should couple those because voidance doesn't necessarily mean that the vehicle has a single front facing sensor. @Stifael It's only performing that check in navigator if the yaw is defined in a mission item. In out case, the yaw setpoint is generated in the FlightTaskAuto and the Navigator check is not done. Btw, I added the logic to force yaw before linear acceleration in the standard line tracking algorithm to be consistent but I am not sure is this is really required since it is already limiting the lateral acceleration when the yaw isn't aligned. |
Tested on Pixhawk4 v5 f-450 Position Mode: no issue PR log: towards waypoint: PR log: towards home: PR log: away from home: PR log: along trajectory: |
Tested on Pixhawk 2 Cube V3:Modes Tested Position Mode: Good. Notes: No issues noted, good flight in general. Log: The MPC_YAW_MODE 0 towards waypoint parameter has changed. Log: The MPC_YAW_MODE 1 towards home parameter has changed. Log: The MPC_YAW_MODE 2 away from home parameter has changed. Log: The MPC_YAW_MODE 3 along trajectory parameter has changed. |
Tested on PixRacer V4:Flight Card 2 Modes Tested Procedure Note: Log: The MPC_YAW_MODE 0 towards waypoint parameter has changed. Log: The MPC_YAW_MODE 1 towards home parameter has changed. Log: The MPC_YAW_MODE 2 away from home parameter has changed. Log: The MPC_YAW_MODE 3 along trajectory parameter has changed. |
Tested on Pixhawk Pro v4:Modes Tested
Procedure Notes: Logs:
|
Test flew with avoidance with MPC_YAW_MODE=4. The mission at the end is with the avoidance enabled: This was flown immediately before with MPC_YAW_MODE=0 and MPC_AUTO_MODE=1, same mission: It seemed to have strange behavior when turning. It would go back to the location where it was when the new setpoint was received (while yawing), instead of coming to a standstill. |
@jkflying As you can see in the first 2D plot you shared and the one here below, the vehicle overshoots the setpoint, it's not the setpoint that overshoots |
f52fea0
to
20a7e88
Compare
@jkflying I rebased on top of master, can you review again please such that we can merge?
the rest is just indentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
12 bytes overflow on v2 xD |
…mode ensures that the vehicle yaws towards the next waypoint before accelerating. This is required for drones with front vision and aerodynamic multicopters such as standard vtol planes or highspeed multirotors.
14b18a8
to
a94b10e
Compare
a94b10e
to
019e613
Compare
019e613
to
56d7c1b
Compare
Describe problem solved by the proposed pull request
In some cases, the user wants the drone to yaw first and then move instead of doing a simultaneous yaw and linear motion. A few examples are:
Test data / coverage
SITL tests with
MPC_POS_MODE
0 and 1.On the plot below, you can see that the drone starts to move only when the yaw setpoint reaches the desired heading.
Usage
Set
MPC_YAW_MODE = 4
Note that the proposed solution only cares about setpoints and doesn't check for the actual yaw of the vehicle. If the yaw tracking of your vehicle is bad, improve it or reduce
MPC_YAWR_AUTO_MAX
fixes #11053
@mrivi Can you try that with avoidance please?