public MissionWaypointTaskMsg(float velocity_range, float idle_velocity, ActionOnFinish finish_action, uint mission_exec_times, YawMode yaw_mode, TraceMode trace_mode, ActionOnRCLost rc_lost_action, GimbalPitchMode gimbal_pitch_mode, MissionWaypointMsg[] mission_waypoints) { _velocity_range = velocity_range; _idle_velocity = idle_velocity; _action_on_finish = finish_action; _mission_exec_times = mission_exec_times; _yaw_mode = yaw_mode; _trace_mode = trace_mode; _action_on_rc_lost = rc_lost_action; _gimbal_pitch_mode = gimbal_pitch_mode; _mission_waypoints = mission_waypoints; }
public MissionWaypointTaskMsg(JSONNode msg) { _velocity_range = msg["velocity_range"].AsFloat; _idle_velocity = msg["idle_velocity"].AsFloat; _action_on_finish = (ActionOnFinish)msg["action_on_finish"].AsInt; _mission_exec_times = (uint)msg["mission_exec_times"].AsInt; _yaw_mode = (YawMode)msg["yaw_mode"].AsInt; _trace_mode = (TraceMode)msg["trace_mode"].AsInt; _action_on_rc_lost = (ActionOnRCLost)msg["action_on_rc_lost"].AsInt; _gimbal_pitch_mode = (GimbalPitchMode)msg["gimbal_pitch_mode"].AsInt; JSONArray waypoints = msg["mission_waypoint"].AsArray; _mission_waypoints = new MissionWaypointMsg[waypoints.Count]; for (int i = 0; i < _mission_waypoints.Length; i++) { _mission_waypoints[i] = new MissionWaypointMsg(waypoints[i]); } }