public static void Hover(
            string vessel_name,
            CommonData common_data,
            Connection connection,
            Service space_center,
            Vessel vessel,
            double tar_altitude,
            Vector3d tar_pos = null,
            KrpcAutoPilot.Control.RcsLayout rcs_layout = KrpcAutoPilot.Control.RcsLayout.TOP)
        {
            KrpcAutoPilot.Control control = new KrpcAutoPilot.Control(vessel_name, common_data, connection, space_center, vessel);
            control.UpdateData();

            control.Engage();

            vessel.Control.RCS = true;

            while (true)
            {
                if (!control.UpdateData())
                {
                    break;
                }
                if (control.Hover(tar_altitude, tar_pos, rcs_layout))
                {
                    break;
                }
                if (control.Execute() == KrpcAutoPilot.Control.Status.FAIL)
                {
                    break;
                }
                Thread.Sleep(100);
            }

            control.DisEngage();
            control.Dispose();
        }
        public static void Recycle(
            string vessel_name,
            CommonData common_data,
            Connection connection,
            Service space_center,
            Vessel vessel,
            KrpcAutoPilot.Control.RcsLayout rcs_layout,
            Vector3d tar_pos, double tar_altitude, double landing_min_velocity, double heading,
            ref KrpcAutoPilot.Control.LandingAdjustBurnStatus landing_adjust_burn_status,
            ref bool landing_adjust_could_burn)
        {
            KrpcAutoPilot.Control control = new KrpcAutoPilot.Control(vessel_name, common_data, connection, space_center, vessel);
            control.UpdateData();
            control.Command.SetHeadingAngle(Math.PI);

            control.Engage();

            SwitchRcsEngines(vessel, true);
            vessel.Control.RCS = true;

            vessel.Control.Brakes = true;
            SwitchEngineMode(vessel);
            Thread.Sleep(1000);
            control.Trajectory.ReCacheAvailableThrust();
            SwitchEngineMode(vessel);

            Console.WriteLine("Landing init");
            control.LandingInit(tar_altitude, landing_min_velocity);

            Console.WriteLine("Adjust landing position");
            while (true)
            {
                if (!control.UpdateData())
                {
                    break;
                }
                landing_adjust_burn_status = control.AdjustLandingPosition(tar_pos, tar_altitude, landing_adjust_could_burn);
                if (landing_adjust_burn_status == KrpcAutoPilot.Control.LandingAdjustBurnStatus.FINISHED)
                {
                    break;
                }
                if (control.Execute() == KrpcAutoPilot.Control.Status.FAIL)
                {
                    break;
                }
                Thread.Sleep(100);
            }

            SwitchEngineMode(vessel);

            while (true)
            {
                if (!control.UpdateData())
                {
                    break;
                }
                if (control.Landing(tar_pos, tar_altitude, rcs_layout, 5d, heading))
                {
                    break;
                }
                if (control.Execute() == KrpcAutoPilot.Control.Status.FAIL)
                {
                    break;
                }
                Thread.Sleep(100);
            }

            control.DisEngage();
            control.Dispose();
            vessel.Control.Brakes      = false;
            landing_adjust_burn_status = KrpcAutoPilot.Control.LandingAdjustBurnStatus.ABANDON;
        }