forked from Archive/PX4-Autopilot
vmount: properly unadvertise uorb topics when stopping or re-configuring vmount. Othwerise subsequent advertise calls may fail (only ever witnessed for _mount_orientation_pub)
This commit is contained in:
parent
cbe3627b8c
commit
b8d389ca4e
|
@ -68,6 +68,10 @@ OutputBase::~OutputBase()
|
|||
if (_vehicle_global_position_sub >= 0) {
|
||||
orb_unsubscribe(_vehicle_global_position_sub);
|
||||
}
|
||||
|
||||
if (_mount_orientation_pub) {
|
||||
orb_unadvertise(_mount_orientation_pub);
|
||||
}
|
||||
}
|
||||
|
||||
int OutputBase::initialize()
|
||||
|
|
|
@ -52,6 +52,13 @@ OutputMavlink::OutputMavlink(const OutputConfig &output_config)
|
|||
{
|
||||
}
|
||||
|
||||
OutputMavlink::~OutputMavlink()
|
||||
{
|
||||
if (_vehicle_command_pub) {
|
||||
orb_unadvertise(_vehicle_command_pub);
|
||||
}
|
||||
}
|
||||
|
||||
int OutputMavlink::update(const ControlData *control_data)
|
||||
{
|
||||
vehicle_command_s vehicle_command = {
|
||||
|
|
|
@ -56,7 +56,7 @@ class OutputMavlink : public OutputBase
|
|||
{
|
||||
public:
|
||||
OutputMavlink(const OutputConfig &output_config);
|
||||
virtual ~OutputMavlink() { }
|
||||
~OutputMavlink();
|
||||
|
||||
virtual int update(const ControlData *control_data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue