コード例 #1
0
 public GetServerVersion()
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 0,
         Method    = "getServerVersion",
         args      = new ArrayList {
         }
     };
 }
コード例 #2
0
 public RotateToYaw(float yaw)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "rotateToYaw",
         args      = new ArrayList {
             yaw, 600, 5, ""
         }
     };
 }
コード例 #3
0
 public Land()
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "land",
         args      = new ArrayList {
             60, ""
         }
     };
 }
コード例 #4
0
 public WeatherEnable(bool enable)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "simEnableWeather",
         args      = new ArrayList {
             enable
         }
     };
 }
コード例 #5
0
 public WeatherSet(int weatherType, float intensity)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 0,
         Method    = "simSetWeatherParameter",
         args      = new ArrayList {
             weatherType, intensity
         }
     };
 }
コード例 #6
0
 public EnableApiControl()
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 0,
         Method    = "enableApiControl",
         args      = new ArrayList {
             true, ""
         }
     };
 }
コード例 #7
0
 public Takeoff()
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "takeoff",
         args      = new ArrayList {
             5, ""
         }
     };
 }
コード例 #8
0
 public ArmDisarm(bool arm)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "armDisarm",
         args      = new ArrayList {
             arm, ""
         }
     };
 }
コード例 #9
0
 public RotateByYawRate(float yawRate, float duration)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "rotateByYawRate",
         args      = new ArrayList {
             yawRate, duration, ""
         }
     };
 }
コード例 #10
0
 public Hover(float delay)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "hover",
         args      = new ArrayList {
             delay *1000
         }
     };
 }
コード例 #11
0
 public MultirotorState()
 {
     command = new MessagePackCommand()
     {
         Request   = 0,
         MessageId = 1,
         Method    = "getMultirotorState",
         args      = new ArrayList {
             ""
         }
     };
 }
コード例 #12
0
 // Need to figure out how to use current xyz as reference for moveToPosition
 public FlyForward(int distance)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "moveToPosition",
         // x y z velocity
         args = new ArrayList {
             distance, 0, -10, 5, 60, 0, new YawMode {
                 is_rate = false, yaw_or_rate = 0
             }, -1, 1, ""
         }
     };
 }
コード例 #13
0
 public MoveByVelocity(float vx, float vy, float vz, float duration)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "moveByVelocity",
         // x y z velocity
         args = new ArrayList {
             vx, vy, vz, duration, 0, new YawMode {
                 is_rate = false, yaw_or_rate = 0
             }, ""
         }
     };
 }
コード例 #14
0
 // Need to figure out how to use current xyz as reference for moveToPosition
 public MoveToPosition(float xposition, float yposition, float zposition)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "moveToPosition",
         // Setting timeout to 10 minutes for now
         args = new ArrayList {
             xposition, yposition, zposition, 5, 600, 0, new YawMode {
                 is_rate = false, yaw_or_rate = 0
             }, -1, 1, ""
         }
     };
 }
コード例 #15
0
ファイル: Wind.cs プロジェクト: dbaldwin/DroneBlocksAirSim
 // x is north, y is east, z is down
 public Wind(int x_vel, int y_vel, int z_vel)
 {
     command = new MessagePackCommand
     {
         Request   = 0,
         MessageId = 1,
         Method    = "simSetWind",
         args      = new ArrayList {
             new Dictionary <string, int>()
             {
                 { "x_val", x_vel },
                 { "y_val", y_vel },
                 { "z_val", z_vel }
             }
         }
     };
 }
コード例 #16
0
        public MoveByRollPitchYaw(float roll, float pitch, float yaw, float duration)
        {
            // RPY will come in as degrees but should be converted to radians per the API
            roll *= (float)(Math.PI / 180);

            // These are negative per https://github.com/microsoft/AirSim/blob/master/PythonClient/airsim/client.py#L1028
            pitch *= (float)(Math.PI / 180) * -1;
            yaw   *= (float)(Math.PI / 180) * -1;

            command = new MessagePackCommand
            {
                Request   = 0,
                MessageId = 1,
                Method    = "moveByRollPitchYawZ",
                // 4th param is Z and we set it to 0 for now
                args = new ArrayList {
                    roll, pitch, yaw, 0, duration, ""
                }
            };
        }