-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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] acceleration setpoint is not filtered and affects too much on the thrust setpoint #18033
Comments
@squizz617 How are you sending the acceleration setpoints? Is this through mavlink? or are you publishing them directly through RTPS? |
@Jaeyoung-Lim I'm publishing directly to |
Even without saturation of the acceleration setpoint, the maximum acceleration is still somehow constrained by the maximum allowed tilt of the vehicle. We could also add an acceleration saturation if really needed, but remember that when using this message, the controller will directly execute the setpoints without smoothing them; you get the complete control of the drone so it's also your responsibility to generate a nice (smooth) and feasible trajectory on your companion computer. If you are not willing to generate a smooth trajectory on the companion computer, it is also possible to send mission waypoints through mavlink. Those can be executed in auto mode (not offboard) and the autopilot will take care of all the vel/accel/jerk constraints to generate a smooth trajectory. |
Hi @bresch, thank you for the reply! However, my concerns here are twofold:
|
For safety how about a final constraint of the acceleration setpoint in the position controller? PX4-Autopilot/src/modules/mc_pos_control/PositionControl/PositionControl.cpp Lines 179 to 180 in 8f03045
|
Description
When controlling the drone through trajectory setpoints in offboard mode, acceleration setpoints have excessively strong effects on the resulting thrust setpoints, as the position & velocity controller do not honor MPC_ACC_HOR_MAX parameter to limit the input acceleration setpoints. Even a short glitch/noise (e.g., one of the setpoint messages sets acceleration.y to 3000 m/s^2) is enough to disrupt the entire trajectory.
Reproduction
Consider the following offboard mission where each waypoint consists of repeated TrajectorySetpoint ROS messages:
Executing the mission by publishing the sequence of messages at 10Hz, the drone draws a quadrilateral trajectory, as shown in flight log01.
However, when one of the waypoint1 messages (22nd message, to be precise) somehow has an error, additionally setting the target y acceleration to 3000 as shown below,
the thrust setpoint over the y axis quickly dominates and blows the drone off, even though the normal messages following the anomalous one quickly resets target acceleration to zero, as shown in flight log02.
Analysis
The velocity controller does not clamp the acceleration setpoint value to the maximum (
MPC_ACC_HOR_MAX
), but directly use the input setpoint to compute the thrust setpoint. Like how_vel_sp
and_thr_sp
vectors are constrained to the bounds defined by relevant parameters (e.g.,MPC_XY_VEL_MAX
,MPC_Z_VEL_MAX_DN
, ...), it seems reasonable that acceleration setpoints are also filtered to prevent such anomalous inputs from jeopardizing the mission.Additional info
Tested on Ubuntu 20.04 running ROS2-foxy, px4_sitl_rtps at v1.12.0 with gazebo 11.5.1.
The text was updated successfully, but these errors were encountered: