"Exceeded maximum number of file descriptors" error while running Quadcopter​_Controlle​rWithNavig​ation model in SITL

1 view (last 30 days)
I am getting this error in NSH shell while running Quadcopter_ControllerWithNavigation model in SITL mode
ERROR [uORB] vehicle_global_position advertise failed (5)
WARN [cdev] : exceeded maximum number of file descriptors, accesing /obj/vehicle_status0

Accepted Answer

Manoj Velmurugan
Manoj Velmurugan on 14 Dec 2022
PX4 PWM Output block was not releasing file descriptors correctly during the disarmed state in SITL mode. Hence it was exhausting all the available file descriptors and causing this issue.
As a workaround,
locate and open the support package root folder using the following command,
>>matlabshared.supportpkg.getSupportPackageRoot
Navigate to toolbox\target\supportpackages\px4\src folder and open MW_PX4_PWM.cpp
After the line 306,
orb_publish(ORB_ID(vehicle_status), vehicle_status_pub, &arm_vehicle_stat);
insert the following line,
orb_unsubscribe(vehicle_status_fd);
Redeploy the model from Simulink.

More Answers (0)

Categories

Find more on Event Functions in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!