Disarming commander using PX4 software module


Is there a way to send the disarm command to the commander from an PX4 software module? Or do I have to implement a new ORB topic and handle it inside commander?


1 Like


I think this should be possible by publishing the vehicle command VEHICLE_CMD_COMPONENT_ARM_DISARM once.

It should then get handled here:

Thanks! I was thinking about that. However, I did not find out if it is possible to send to one orb stream from multiple processes.
Is this the difference from orb_advertise_queue() used for this commands to orb_advertise() used normally?

By the way: How do you adjust the stack size of a new module?

For vehicle commands we usually use the implementation with queue. As far as I know that’s not required because we publish from multiple tasks/threads but rather because we don’t to have drops but we want every message to arrive. Drops can happen if a single publisher or multiple publishers in different tasks/threads publish in rapid succession without the subscriber catching up fast enough.

By the way: How do you adjust the stack size of a new module?

The stack size of the main function of a module is defined like this:

However, this main function is usually only used to parse some cli arguments and then start a daemon task. When you start this daemon task you can pass the stack size: