Open hanhui03 opened 1 month ago
Try adding px4_usleep(500_ms);
at the beginning of the MulticopterPositionControl::MulticopterPositionControl()
constructor. _parameter_update_sub.updated()
can return true
normally when the parameters change.
MulticopterPositionControl::MulticopterPositionControl(bool vtol) :
ModuleParams(nullptr),
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers),
_vehicle_attitude_setpoint_pub(vtol ? ORB_ID(mc_virtual_attitude_setpoint) : ORB_ID(vehicle_attitude_setpoint))
{
px4_usleep(500_ms); // relax...
_sample_interval_s.update(0.01f); // 100 Hz default
parameters_update(true);
_tilt_limit_slew_rate.setSlewRate(.2f);
_takeoff_status_pub.advertise();
}
Suspect uORB subscription has multi-threaded safety problem.
Describe the bug
mc_pos_control
module_parameter_update_sub.updated()
always returnfalse
, so this module cannot sense the parameter changes. Restart this module will back to normal.To Reproduce
No response
Expected behavior
No response
Screenshot / Media
No response
Flight Log
No response
Software Version
No response
Flight controller
All
Vehicle type
Multicopter
How are the different components wired up (including port information)
In HIL mode
Additional context
No response