测试offboard模式的安全代码
这段代码用于检验offboard模式的安全启动,执行后飞机只会轻微的旋转,不会起飞。 // // Created by zm on 19-4-8. // To enable px4 offboard control. // input: Target Attitude & thrust // output: setpoint_raw attitude // # include <ros/ros.h> # include <std_msgs/Float32.h> # include <geometry_msgs/PoseStamped.h> # include <geometry_msgs/Quaternion.h> # include <mavros_msgs/CommandBool.h> # include <mavros_msgs/SetMode.h> # include <mavros_msgs/State.h> # include <mavros_msgs/AttitudeTarget.h> mavros_msgs :: State current_state ; mavros_msgs :: AttitudeTarget targetattitude ; void state_cb ( const mavros_msgs :: State :: ConstPtr &