上/解锁服务
- 消息名称:
mavros/cmd/arming
- 类型:
mavros_msgs::CommandBool
- 头文件:
mavros_msgs/CommandBool.h
请求参数在mavros github的mavros/ mavros_msgs / srv / CommandBool.srv里面
# Common type for switch commands
bool value
---
bool success
uint8 result
示例:
ros::ServiceClient px4_arming_client = nh.serviceClient<mavros_msgs::CommandBool>("/uav" + std::to_string(uav_id) + "/mavros/cmd/arming");
mavros_msgs::CommandBool arm_cmd;
arm_cmd.request.value = true;
px4_arming_client.call(arm_cmd);
if (arm_cmd.response.success)
{
cout << GREEN << node_name << " vehicle disarming, success!" << TAIL << endl;
}
else
{
cout << RED << node_name << " vehicle disarming, fail!" << TAIL << endl;
}