Skip to content

Commit cef5775

Browse files
committed
obtain control authority moved to set offboard mode
1 parent 087bc60 commit cef5775

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/as2_platform_dji_psdk.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,11 @@ bool DJIMatricePSDKPlatform::ownSetOffboardControl(bool offboard)
172172
{
173173
if (!offboard) {
174174
// Release control authority
175+
RCLCPP_INFO(this->get_logger(), "Releasing control authority");
175176
return setControlAuthority(false);
176177
}
177-
return true;
178+
RCLCPP_INFO(this->get_logger(), "Obtain control authority");
179+
return setControlAuthority(true);
178180
}
179181

180182
bool DJIMatricePSDKPlatform::ownSetPlatformControlMode(const as2_msgs::msg::ControlMode & msg)
@@ -196,7 +198,6 @@ bool DJIMatricePSDKPlatform::ownSetPlatformControlMode(const as2_msgs::msg::Cont
196198
{
197199
// Obtain control authority
198200
RCLCPP_INFO(this->get_logger(), "HOVER || SPEED MODE: Obtain control authority");
199-
success = setControlAuthority(true);
200201
break;
201202
}
202203
default:

0 commit comments

Comments
 (0)