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

[Bug] mc_pos_control module _parameter_update_sub.updated() always return false #23788

Open
hanhui03 opened this issue Oct 8, 2024 · 1 comment

Comments

@hanhui03
Copy link

hanhui03 commented Oct 8, 2024

Describe the bug

mc_pos_control module _parameter_update_sub.updated() always return false, so this module cannot sense the parameter changes. Restart this module will back to normal.

mc_pos_control stop
mc_pos_control start

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

@hanhui03
Copy link
Author

hanhui03 commented Oct 8, 2024

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.

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

No branches or pull requests

1 participant