diff --git a/source/includes/namespace.md b/source/includes/namespace.md index 07f1d2ed779..734498b726d 100755 --- a/source/includes/namespace.md +++ b/source/includes/namespace.md @@ -82,6 +82,10 @@ Response: } ``` +```python--flyt_python +# Namespace request is not required for any Python API +``` + > Example @@ -155,6 +159,9 @@ namespace.callService(request, function(result) { }); ``` +```python--flyt_python +# Namespace request is not required for any Python API +``` > Example response @@ -203,6 +210,10 @@ message: FlytOS namespace is flytpod } ``` +```python--flyt_python +# Namespace request is not required for any Python API +``` + ### Description: This API returns the global namespace under which FlytOS's instance is running. For users using RESTful, Websocket or ROS APIs, calling this API is a **MUST**, as the value of this namespace is required to call other APIs. diff --git a/source/includes/navigation/access_request.md b/source/includes/navigation/access_request.md index bf462a14a76..894d33f674f 100755 --- a/source/includes/navigation/access_request.md +++ b/source/includes/navigation/access_request.md @@ -104,6 +104,9 @@ Response: ``` +```python--flyt_python +# Access Request is not required for any Python API +``` > Example @@ -196,6 +199,10 @@ access_request.callService(request, function(result) { }); ``` +```python--flyt_python +# Access Request is not required for any Python API +``` + > Example response ```shell @@ -232,6 +239,10 @@ Success: True ``` +```python--flyt_python +# Access Request is not required for any Python API +``` + ###Description: This API enables API control over drone. Sending vehicle to GUIDED/OFFBOARD mode via RC automatically enables API control, and likewise sending vehicle to RC modes such as MANUAL/STABILIZE/ALTCTL/ALT_HOLD/POSCTL/POSHOLD/LOITER disables API control. diff --git a/source/includes/navigation/arm.md b/source/includes/navigation/arm.md index d12aad2fc06..d476e640a7b 100755 --- a/source/includes/navigation/arm.md +++ b/source/includes/navigation/arm.md @@ -94,6 +94,18 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: arm() + + +``` + + > Example ```shell @@ -118,6 +130,8 @@ drone = api.navigation() time.sleep(3.0) drone.arm() + + ``` ```cpp--ros @@ -179,6 +193,19 @@ arm.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.arm() +drone.disconnect() +``` + > Example response @@ -214,6 +241,13 @@ Success: True success:True } +``` +```python--flyt_python +{ + success: True, + message: message + +} ``` ###Description: diff --git a/source/includes/navigation/clear_waypoints.md b/source/includes/navigation/clear_waypoints.md index 81c1db79054..29884ff53af 100755 --- a/source/includes/navigation/clear_waypoints.md +++ b/source/includes/navigation/clear_waypoints.md @@ -88,6 +88,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: clear_waypoints() + +``` + > Example ```shell @@ -154,7 +164,19 @@ waypointClear.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.clear_waypoints() + +drone.disconnect() +``` > Example response ```shell @@ -191,6 +213,12 @@ success (bool): true if action successful success:True } +``` +```python--flyt_python +{ + success: True, + message: message +} ``` ###Description: diff --git a/source/includes/navigation/disarm.md b/source/includes/navigation/disarm.md index 3f6e54e14f0..31eb50344fb 100755 --- a/source/includes/navigation/disarm.md +++ b/source/includes/navigation/disarm.md @@ -91,11 +91,20 @@ Response: success: Boolean, message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector +Function: disarm() ``` + + > Example ```shell @@ -180,7 +189,19 @@ disarm.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.disarm() +drone.disconnect() +``` > Example response @@ -218,6 +239,13 @@ Success: True ``` +```python--flyt_python +{ + success: True, + message: message +} +``` + ###Description: This API disarms the motors. Read API description below before you use it. diff --git a/source/includes/navigation/execute_script.md b/source/includes/navigation/execute_script.md index 2b2992bab06..8b4ab5d34f0 100755 --- a/source/includes/navigation/execute_script.md +++ b/source/includes/navigation/execute_script.md @@ -98,6 +98,16 @@ Response: message: String } +``` + + +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: execute_script(appname, arguments) ``` @@ -192,6 +202,20 @@ execScript.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +# execute onboard script with name in app_name and arguments to be passed with it as arguments +drone.execute_script(appname, arguments) + +drone.disconnect() +``` > Example response @@ -229,6 +253,13 @@ Success: True success:True } +``` +```python--flyt_python +{ + success: True, + message: message + +} ``` ### Description: diff --git a/source/includes/navigation/execute_waypoints.md b/source/includes/navigation/execute_waypoints.md index ada2606a492..27408a93889 100755 --- a/source/includes/navigation/execute_waypoints.md +++ b/source/includes/navigation/execute_waypoints.md @@ -85,6 +85,16 @@ Response: message: String, } +``` + +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: execute_waypoints() + ``` > Example @@ -155,6 +165,20 @@ waypointExecute.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.execute_waypoints() + +drone.disconnect() +``` + > Example response ```shell @@ -190,6 +214,13 @@ success (bool): true if action successful success:True } +``` +```python--flyt_python +{ + success: True, + message: message + +} ``` ### Description: diff --git a/source/includes/navigation/get_waypoints.md b/source/includes/navigation/get_waypoints.md index 7b8d519020d..4f853b819cf 100755 --- a/source/includes/navigation/get_waypoints.md +++ b/source/includes/navigation/get_waypoints.md @@ -127,7 +127,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_waypoints() + +``` > Example ```shell @@ -196,6 +204,18 @@ waypointGet.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_waypoints() +drone.disconnect() +``` > Example response @@ -277,6 +297,25 @@ waypoints (list): consists a list of dictionary, the dictionary consists of (fra ``` +```python--flyt_python +{ + success: True, + message: message, + waypoints: [{ + frame: 3, + command:Int 16, + is_current: true, + autocontinue: true, + param1: 6.0, + param2: 7.0, + param3: 0.0, + param4: 0.0, + x_lat: 65.425532, + y_long: 18.542422, + z_alt: 25},{}] +} +``` + ###Description: This API returns list of current waypoints on autopilot. diff --git a/source/includes/navigation/land.md b/source/includes/navigation/land.md index 9aeca283d9e..8029676fa39 100755 --- a/source/includes/navigation/land.md +++ b/source/includes/navigation/land.md @@ -96,6 +96,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: land(async=False) + +``` + > Example @@ -186,6 +196,19 @@ land.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.land(async=False) +drone.disconnect() +``` + > Example response ```shell @@ -222,6 +245,14 @@ Success: True ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ### Description: Land vehicle at current position. Check API usage section below before using this API. diff --git a/source/includes/navigation/pause_waypoints.md b/source/includes/navigation/pause_waypoints.md index c16da913417..8093f279c46 100755 --- a/source/includes/navigation/pause_waypoints.md +++ b/source/includes/navigation/pause_waypoints.md @@ -87,6 +87,15 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: pause_waypoints() + ``` @@ -157,6 +166,18 @@ waypointPause.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.pause_waypoints() +drone.disconnect() +``` > Example response @@ -193,6 +214,13 @@ success (bool): true if action successful success:True } +``` +```python--flyt_python +{ + success: True, + message: message + +} ``` ### Description: diff --git a/source/includes/navigation/position_hold.md b/source/includes/navigation/position_hold.md index 6cf50abeaf7..2f05902e4dd 100755 --- a/source/includes/navigation/position_hold.md +++ b/source/includes/navigation/position_hold.md @@ -92,6 +92,15 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: hold_position() + +``` > Example ```shell @@ -175,6 +184,17 @@ positionHold.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.hold_position() +``` > Example response @@ -212,6 +232,14 @@ Success: True ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ###Description: Position hold / hover / loiter at current position. diff --git a/source/includes/navigation/position_setpoint.md b/source/includes/navigation/position_setpoint.md index 01f8e7d2a38..15ce84fedb9 100755 --- a/source/includes/navigation/position_setpoint.md +++ b/source/includes/navigation/position_setpoint.md @@ -152,6 +152,15 @@ Response: success: Boolean, message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_local_position(self,x, y, z, yaw=0.0, tolerance=1.0, async=False, relative=True, yaw_valid=False, body_frame=False) + ``` > Example @@ -276,6 +285,18 @@ positionSet.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_local_position(x=5, y=0, z=0, yaw=0.0, tolerance=1.0, async=False, relative=True, yaw_valid=False, body_frame=False) +drone.disconnect() +``` > Example response @@ -312,6 +333,13 @@ Success: True } ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` ###Description: This API commands the vehicle to go to a specified location in local frame and hover. Please check API usage section below before using API. diff --git a/source/includes/navigation/position_setpoint_global.md b/source/includes/navigation/position_setpoint_global.md index a467ced8679..f6ccfdf09af 100755 --- a/source/includes/navigation/position_setpoint_global.md +++ b/source/includes/navigation/position_setpoint_global.md @@ -139,6 +139,15 @@ Response: } ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_global_position(self, lat_x, long_y, rel_alt_z, yaw=0.0, tolerance=1.0, async=False, yaw_valid=False) +``` + > Example @@ -258,7 +267,18 @@ positionSetGlobal.callService(request, function(result) { + result.message); }); ``` - +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_global_position(lat_x=10.342124, long_y=13.4323233, rel_alt_z=5.00, yaw=0.0, tolerance=1.0, async=False, yaw_valid=False) +drone.disconnect() +``` > Example response ```shell @@ -293,6 +313,13 @@ Success: True success:True } ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` ### Description: diff --git a/source/includes/navigation/rtl.md b/source/includes/navigation/rtl.md index cbf8e2f231a..6c00795f572 100755 --- a/source/includes/navigation/rtl.md +++ b/source/includes/navigation/rtl.md @@ -78,6 +78,15 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: RTL() + ``` > Example @@ -160,6 +169,18 @@ rtl.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.RTL() +drone.disconnect() +``` > Example response @@ -198,6 +219,13 @@ Success: True } ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` ### Description: Trigger RTL mode transition of the vehicle. Check API usage section below before using this API. diff --git a/source/includes/navigation/set_current_waypoint.md b/source/includes/navigation/set_current_waypoint.md index 49f203fb3fe..d56de4441f3 100755 --- a/source/includes/navigation/set_current_waypoint.md +++ b/source/includes/navigation/set_current_waypoint.md @@ -100,6 +100,16 @@ Response: } +``` + +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_current_waypoint(wp_seq) + ``` > Example @@ -174,6 +184,19 @@ waypointSetCurrent.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_current_waypoint(2) +drone.disconnect() +``` + > Example response @@ -212,6 +235,14 @@ success (bool): true if action successful ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ### Description: Sets the waypoint Id specified, as the current waypoint from the list of already set wayopints. diff --git a/source/includes/navigation/set_home.md b/source/includes/navigation/set_home.md index 47fc49cc2f8..c30782e7b3c 100755 --- a/source/includes/navigation/set_home.md +++ b/source/includes/navigation/set_home.md @@ -110,6 +110,16 @@ Response: } +``` + +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_home(lat, lon, alt, set_current) + ``` > Example @@ -202,6 +212,19 @@ setHome.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_home(lat=73.12516255,lon= 18.2165632,alt= 2.00, set_current=False) +drone.disconnect() +``` + > Example response ```shell @@ -239,7 +262,13 @@ Success: True } ``` +```python--flyt_python +{ + success: True, + message: message +} +``` ###Description: Manually store a location as new home. diff --git a/source/includes/navigation/set_waypoints.md b/source/includes/navigation/set_waypoints.md index 8fd984fa512..1afa3f75cfa 100755 --- a/source/includes/navigation/set_waypoints.md +++ b/source/includes/navigation/set_waypoints.md @@ -136,6 +136,15 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_waypoints(waypoints_raw) + ``` > Example @@ -317,6 +326,68 @@ waypointSet.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() +wp4 = [{'frame': 0, + 'command': 16, + 'is_current': True, + 'autocontinue': True, + 'param1': 10.2, + 'param2': 10.2, + 'param3': 10.2, + 'param4': 10.2, + 'x_lat': x - 0.0002, + 'y_long': y - 0.0002, + 'z_alt': z + 10 + }, + {'frame': 0, + 'command': 16, + 'is_current': True, + 'autocontinue': True, + 'param1': 10.2, + 'param2': 10.2, + 'param3': 10.2, + 'param4': 10.2, + 'x_lat': x+0.0001, + 'y_long': y + 0.0001, + 'z_alt': z + 10 + }, + {'frame': 0, + 'command': 16, + 'is_current': True, + 'autocontinue': True, + 'param1': 10.2, + 'param2': 10.2, + 'param3': 10.2, + 'param4': 10.2, + 'x_lat': x, + 'y_long': y, + 'z_alt': z + 10 + }, + {'frame': 0, + 'command': 16, + 'is_current': True, + 'autocontinue': True, + 'param1': 10.2, + 'param2': 10.2, + 'param3': 10.2, + 'param4': 10.2, + 'x_lat': x + 0.0001, + 'y_long': y + 0.0001, + 'z_alt': z + 10 + }] + +drone.set_waypoints(wp4) + +drone.disconnect() +``` + > Example response @@ -358,6 +429,14 @@ success (bool): true if action successful ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ### Description: This API replaces current list of waypoints on autopilot with new list passed. diff --git a/source/includes/navigation/takeoff.md b/source/includes/navigation/takeoff.md index b65ce9f9352..e765ecdabb7 100755 --- a/source/includes/navigation/takeoff.md +++ b/source/includes/navigation/takeoff.md @@ -101,7 +101,15 @@ Response: ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: takeoff(height) + +``` > Example ```shell @@ -191,7 +199,20 @@ takeoff.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.takeoff(5) + +drone.disconnect() +``` > Example response ```shell @@ -228,6 +249,13 @@ Success: True ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` ###Description: Takeoff and reach specified height from current location. diff --git a/source/includes/navigation/velocity_setpoint.md b/source/includes/navigation/velocity_setpoint.md index 6521a159ab1..a453830e8dd 100755 --- a/source/includes/navigation/velocity_setpoint.md +++ b/source/includes/navigation/velocity_setpoint.md @@ -156,6 +156,14 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_velocity(self, vx, vy, vz, yaw_rate, tolerance=1.0, async=False, relative=True, yaw_rate_valid=False,body_frame=False) ``` @@ -282,6 +290,19 @@ velocitySet.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_velocity(vx=0, vy=0, vz=0, yaw_rate=0, tolerance=1.0, async=False, relative=True, yaw_rate_valid=False,body_frame=False) + +drone.disconnect() +``` > Example response @@ -318,7 +339,13 @@ Success: True } ``` +```python--flyt_python +{ + success: True, + message: message +} +``` ###Description: This API gives linear (vx,vy,vz) and angular (yaw_rate) velocity setpoint to vehicle. Please check API usage section below before using API. diff --git a/source/includes/parameter/param_create.md b/source/includes/parameter/param_create.md index 4f22333c5d3..87c063284b4 100755 --- a/source/includes/parameter/param_create.md +++ b/source/includes/parameter/param_create.md @@ -102,7 +102,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: create_params() + +``` > Example @@ -186,7 +194,19 @@ paramCreate.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.create_params() +drone.disconnect() +``` > Example response @@ -221,7 +241,12 @@ Bool - True, if action successful } ``` - +```python--flyt_python +{ + success: True, + message: message +} +``` diff --git a/source/includes/parameter/param_delete.md b/source/includes/parameter/param_delete.md index a8da265997a..7da43bb37e4 100755 --- a/source/includes/parameter/param_delete.md +++ b/source/includes/parameter/param_delete.md @@ -92,7 +92,15 @@ Request: Response: { success: Boolean, message: String, } +``` + +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector +Function: delete_params(self, param_id) ``` @@ -169,6 +177,20 @@ paramDelete.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.delete_params(param_id= String) + +drone.disconnect() +``` + > Example response @@ -205,7 +227,13 @@ Bool - True, if action successful ``` +```python--flyt_python +{ + success: True, + message: message +} +``` @@ -259,4 +287,4 @@ Websocket APIs can be called from javascript using [roslibjs library.](https:// Java websocket clients are supported using [rosjava.](http://wiki.ros.org/rosjava) * name: `//param/param_delete` -* serviceType: `core_api/ParamDelete` \ No newline at end of file +* serviceType: `core_api/ParamDelete` diff --git a/source/includes/parameter/param_get.md b/source/includes/parameter/param_get.md index bdbabca4deb..da48113789b 100755 --- a/source/includes/parameter/param_get.md +++ b/source/includes/parameter/param_get.md @@ -104,6 +104,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_param_value(self, param_id) + +``` + > Example @@ -178,7 +188,19 @@ paramGet.callService(request, function(result) { + result.param_info.param_value); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_param_value(param_id=String) +drone.disconnect() +``` > Example response @@ -216,6 +238,14 @@ String - the value of the param } ``` +```python--flyt_python +{ + success: True, + message: message, + param_info: param_info +} +``` + ###Description: This API gets the value of a particular parameter specified. diff --git a/source/includes/parameter/param_get_all.md b/source/includes/parameter/param_get_all.md index 67185f173fa..c27dc02018a 100755 --- a/source/includes/parameter/param_get_all.md +++ b/source/includes/parameter/param_get_all.md @@ -100,7 +100,15 @@ Response: ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_all_params() + +``` > Example @@ -170,7 +178,19 @@ paramGetAll.callService(request, function(result) { + result.param_list); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_all_params() +drone.disconnect() +``` > Example response @@ -214,6 +234,15 @@ success (bool): true if action successful ``` +```python--flyt_python +{ + success: True, + message: message, + param_id: param_id, + param_info: param_info +} +``` + ### Description: This API gets all the parameters available in FlytOS with their values. diff --git a/source/includes/parameter/param_load.md b/source/includes/parameter/param_load.md index 5bd59700b7d..0007a7ab722 100755 --- a/source/includes/parameter/param_load.md +++ b/source/includes/parameter/param_load.md @@ -83,6 +83,15 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: load_params() + ``` > Example @@ -153,6 +162,20 @@ paramLoad.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.load_params() + +drone.disconnect() +``` + > Example response ```shell @@ -185,6 +208,13 @@ Bool - True, if action successful success:True } +``` +```python--flyt_python +{ + success: True, + message: message + +} ``` ###Description: diff --git a/source/includes/parameter/param_reset.md b/source/includes/parameter/param_reset.md index 772c72f4e00..e0369ef387c 100755 --- a/source/includes/parameter/param_reset.md +++ b/source/includes/parameter/param_reset.md @@ -86,7 +86,15 @@ Response: ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: reset_params() + +``` > Example @@ -154,6 +162,19 @@ paramReset.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.reset_params() + +drone.disconnect() +``` > Example response @@ -190,6 +211,14 @@ Bool - True, if action successful ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ### Description: This API resets all the parameter value to the last save parameter state. diff --git a/source/includes/parameter/param_save.md b/source/includes/parameter/param_save.md index f9349a88b9e..03be009e881 100755 --- a/source/includes/parameter/param_save.md +++ b/source/includes/parameter/param_save.md @@ -86,6 +86,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: save_params() + +``` + > Example @@ -154,7 +164,19 @@ paramSave.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.save_params() +drone.disconnect() +``` > Example response @@ -190,6 +212,14 @@ Bool - True, if action successful ``` +```python--flyt_python +{ + success: True, + message: message +} +``` + + ###Description: This API saves the parameters to a file which allows data retention on reboot of FlytOS running systems. diff --git a/source/includes/parameter/param_set.md b/source/includes/parameter/param_set.md index 0acd5a13ba6..d2c5538a3d3 100755 --- a/source/includes/parameter/param_set.md +++ b/source/includes/parameter/param_set.md @@ -102,6 +102,15 @@ Response: message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_params() + ``` > Example @@ -184,7 +193,19 @@ paramSet.callService(request, function(result) { + result.message); }); ``` - +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_params(param_id=String, param_value=String) + +drone.disconnect() +``` > Example response @@ -219,7 +240,12 @@ bool : true if action successful } ``` - +```python--flyt_python +{ + success: True, + message: message +} +``` ### Description: This API sets the value of a desired parameter diff --git a/source/includes/payload/get_adc.md b/source/includes/payload/get_adc.md index 2c6f092aa17..c1c0759ba7d 100755 --- a/source/includes/payload/get_adc.md +++ b/source/includes/payload/get_adc.md @@ -103,7 +103,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_adc() + +``` > Example @@ -196,7 +204,19 @@ adcData.subscribe(request, function(result) { console.log(result.data); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_adc() +drone.disconnect() +``` > Example response @@ -234,6 +254,12 @@ instance of mavros_msgs.msgs.PayloadADC object adc_updated: Int } ``` +```python--flyt_python +{ + adc_voltage: Float[2], + adc_updated: Int +} +``` ### Description: diff --git a/source/includes/payload/gimbal_control.md b/source/includes/payload/gimbal_control.md index 6c790a4df22..188da3859a3 100755 --- a/source/includes/payload/gimbal_control.md +++ b/source/includes/payload/gimbal_control.md @@ -104,6 +104,15 @@ Response: success: Boolean, message: String } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: set_gimbal(self, roll, pitch, yaw) + ``` > Example @@ -200,7 +209,19 @@ gimbalSet.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.set_gimbal(roll=0, pitch=0.1, yaw=0) +drone.disconnect() +``` > Example response @@ -239,6 +260,13 @@ Success: True } ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` ### Description: This API sends gimbal attitude setpoint command to the autopilot via MAVLink and outputs pwm signals on gimbal-dedicated port of FlytPOD/Pixhawk. diff --git a/source/includes/setup/actuator_testing.md b/source/includes/setup/actuator_testing.md index 83cc55998b6..ccfe41b328b 100755 --- a/source/includes/setup/actuator_testing.md +++ b/source/includes/setup/actuator_testing.md @@ -78,7 +78,15 @@ Response: ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: actuator_testing(self, actuator_id, time_s) + +``` > Example ```shell @@ -140,6 +148,19 @@ actuatorTesting.callService(request, function(result) { + result.message); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.actuator_testing(actuator_id=2, time_s=4.00) + +drone.disconnect() +``` > Example response @@ -175,6 +196,14 @@ success: true } ``` +```python--flyt_python +{ + success: True, + message: message + +} +``` + ### Description: This API allows for testing an actuator by providing actuator ID and time to rotate as parameters. If the corresponding actuator rotates on execution of the API correctly for the defined time then the motors are correctly connected. diff --git a/source/includes/setup/esc_calibration.md b/source/includes/setup/esc_calibration.md index c50a041af41..42e124e1405 100755 --- a/source/includes/setup/esc_calibration.md +++ b/source/includes/setup/esc_calibration.md @@ -86,7 +86,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: ESC_calibration(self, pwm_min,pwm_max,num_of_actuators,calibration_state) + +``` > Example @@ -156,6 +164,20 @@ escCalibration.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.ESC_calibration(pwm_min1000.00,pwm_max=2000.00,num_of_actuators=4,calibration_state=2) + +drone.disconnect() +``` + > Example response @@ -193,6 +215,12 @@ success: true ``` +```python--flyt_python +{ + success: True, + message: message +} +``` ### Description: This API helps calibrate ESCs. diff --git a/source/includes/setup/module_calibration.md b/source/includes/setup/module_calibration.md index b668473051f..cc22139aeb8 100755 --- a/source/includes/setup/module_calibration.md +++ b/source/includes/setup/module_calibration.md @@ -85,7 +85,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: module_calibration(self, module_calibrate) + +``` > Example ```shell @@ -148,6 +156,20 @@ moduleCalibration.callService(request, function(result) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.module_calibration(module_calibrate=1) + +drone.disconnect() +``` + > Example response ```shell @@ -182,6 +204,13 @@ success: True } ``` +```python--flyt_python +{ + success: True, + message: message +} +``` + ###Description: This API helps calibrate *accelerometer, magnetometer, gyroscope, level and RC*. diff --git a/source/includes/telemetry/get_RC.md b/source/includes/telemetry/get_RC.md index aa91d1421f7..6bfbc8fd7f1 100755 --- a/source/includes/telemetry/get_RC.md +++ b/source/includes/telemetry/get_RC.md @@ -117,6 +117,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_rc_data() + +``` + > Example ```shell @@ -197,6 +207,20 @@ rcData.subscribe(function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_rc_data() + +drone.disconnect() +``` + > Example response ```shell @@ -232,8 +256,13 @@ success: True rssi: Int, channels: Int[] } +``` - +```python--flyt_python +{ + rssi: Int, + channels: Int[] +} ``` ### Description: diff --git a/source/includes/telemetry/get_attitude_euler.md b/source/includes/telemetry/get_attitude_euler.md index 93ca4989f86..0257fde3965 100755 --- a/source/includes/telemetry/get_attitude_euler.md +++ b/source/includes/telemetry/get_attitude_euler.md @@ -168,7 +168,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_attitude_euler() + +``` > Example @@ -276,6 +284,19 @@ imuEulerData.subscribe(function(message) { ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_attitude_euler() + +drone.disconnect() +``` > Example response ```shell @@ -397,7 +418,16 @@ std_msgs/Header header } ``` - +```python--flyt_python +{ + roll : 0.0 + pitch : 0.0 + yaw : 0.0 + rollspeed : 0.0 + pitchspeed : 0.0 + yawspeed : 0.0 +} +``` ### Description: diff --git a/source/includes/telemetry/get_attitude_quat.md b/source/includes/telemetry/get_attitude_quat.md index 5487516901b..687614c0911 100755 --- a/source/includes/telemetry/get_attitude_quat.md +++ b/source/includes/telemetry/get_attitude_quat.md @@ -206,6 +206,15 @@ Response: } } +``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_attitude_quaternion() + ``` > Example @@ -302,6 +311,20 @@ imuData.subscribe( function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_attitude_quaternion() + +drone.disconnect() +``` + > Example response ```shell @@ -382,6 +405,17 @@ instance of sensor_msgs.msg.Imu class z: Float} } +``` +```python--flyt_python +{ + x: Float, + y: Float, + z: Float, + w: Float, + rollspeed: Float, + pitchspeed: Float, + yawspeed: Float +} ``` ###Description: diff --git a/source/includes/telemetry/get_battery_status.md b/source/includes/telemetry/get_battery_status.md index 157cc77a212..d9491b27e61 100755 --- a/source/includes/telemetry/get_battery_status.md +++ b/source/includes/telemetry/get_battery_status.md @@ -201,6 +201,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_battery_status() + +``` + > Example ```shell @@ -270,6 +280,20 @@ batteryData.subscribe(function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_battery_status() + +drone.disconnect() +``` + > Example response ```shell @@ -325,7 +349,13 @@ instance of sensor_msgs.msg.BatteryState class current: Float, remaining: Float} +``` +```python--flyt_python +{ + voltage: Float, + current: Float, + remaining: Float} ``` diff --git a/source/includes/telemetry/get_distance_sensor.md b/source/includes/telemetry/get_distance_sensor.md index 6e1e3495763..093b3585acc 100755 --- a/source/includes/telemetry/get_distance_sensor.md +++ b/source/includes/telemetry/get_distance_sensor.md @@ -125,9 +125,16 @@ Response: max_range: Float, range: Float } - ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_distance_sensor() +``` > Example @@ -199,6 +206,19 @@ distanceData.subscribe(function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_distance_sensor() + +drone.disconnect() +``` > Example response @@ -241,8 +261,15 @@ instance of sensor_msgs.msgs.Range object max_range: Float, range: Float } - - +``` +```python--flyt_python +{ + radiation_type: Int, + field_of_view: Float, + min_range: Float, + max_range: Float, + range: Float +} ``` ### Description: diff --git a/source/includes/telemetry/get_global_position.md b/source/includes/telemetry/get_global_position.md index bde034dfbb0..4775818a933 100755 --- a/source/includes/telemetry/get_global_position.md +++ b/source/includes/telemetry/get_global_position.md @@ -189,6 +189,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_global_position() + +``` + > Example @@ -279,7 +289,19 @@ gpsData.subscribe(function(message) { console.log(message.data); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_global_position() +drone.disconnect() +``` > Example response @@ -319,8 +341,14 @@ instance of sensor_msgs.msg.NavSatFix class longitude: Float, altitude: Float } +``` - +```python--flyt_python +{ + latitude: Float, + longitude: Float, + altitude: Float +} ``` ### Description: diff --git a/source/includes/telemetry/get_hud.md b/source/includes/telemetry/get_hud.md index ee6a6c65712..515eb981a6d 100755 --- a/source/includes/telemetry/get_hud.md +++ b/source/includes/telemetry/get_hud.md @@ -126,6 +126,16 @@ Response: ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_vfr_hud() + +``` + > Example @@ -195,7 +205,19 @@ vfrHUDData.subscribe(function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_vfr_hud() +drone.disconnect() +``` > Example response ```shell @@ -250,10 +272,17 @@ instance of mavros_msgs.msgs.VFR_HUD class altitude: Float, climb: Float } - - ``` - +```python--flyt_python +{ + airspeed:Float, + groundspeed: Float, + heading: Integer, + throttle: Float, + altitude: Float, + climb: Float +} +``` ### Description: diff --git a/source/includes/telemetry/get_local_position.md b/source/includes/telemetry/get_local_position.md index d5192526a11..e20e784cfc6 100755 --- a/source/includes/telemetry/get_local_position.md +++ b/source/includes/telemetry/get_local_position.md @@ -160,9 +160,17 @@ Response: z: Float} }} - ``` +```python--flyt_python + +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_local_position() + +``` > Example @@ -253,7 +261,19 @@ lpos.subscribe(function(message) { console.log(message.twist); }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID + +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_local_position() +drone.disconnect() +``` > Example response @@ -323,6 +343,16 @@ instance of gemometry_msgs.msg.TwistStamped class }} ``` +```python--flyt_python +{ + x: Float, + y: Float, + z: Float, + vx:Float, + vy: Float, + vz: Float +} +``` diff --git a/source/includes/telemetry/get_vehicle_state.md b/source/includes/telemetry/get_vehicle_state.md index 46e1818d83d..ecc3cb629d4 100755 --- a/source/includes/telemetry/get_vehicle_state.md +++ b/source/includes/telemetry/get_vehicle_state.md @@ -165,7 +165,15 @@ Response: } ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Class: flyt_python.flyt_python.DroneApiConnector + +Function: get_vehicle_state() + +``` > Example @@ -250,7 +258,19 @@ stateData.subscribe(function(message) { }); ``` +```python--flyt_python +from flyt_python.flyt_python import DroneApiConnector +token = '' # Personal Access Token +vehicle_id = '' # Vehicle ID +#create an instance of class DroneApiConnector +drone = DroneApiConnector(token,vehicle_id,ip_address='localhost' wait_for_drone_response =True) +drone.connect() + +drone.get_vehicle_state() + +drone.disconnect() +``` > Example response ```shell @@ -309,8 +329,18 @@ True MANUAL mav_autopilot: Int, mav_sys_status: Int } +``` - +```python--flyt_python +{ + connected: Boolean, + armed: Boolean, + guided: Boolean, + mode: String, + mav_type: Int, + mav_autopilot: Int, + mav_sys_status: Int +} ``` ### Description: diff --git a/source/includes/video_streaming.md b/source/includes/video_streaming.md index 2876eb30416..f46c7c3043e 100755 --- a/source/includes/video_streaming.md +++ b/source/includes/video_streaming.md @@ -47,6 +47,11 @@ NA ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Not Implemented +``` > Example @@ -91,6 +96,11 @@ $.ajax({ NA ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Not Implemented +``` > Example response @@ -132,6 +142,12 @@ Not Implemented NA ``` +```python--flyt_python +# Python API described below can be used in onboard scripts only. For remote scripts you can use http client libraries to call FlytOS REST endpoints from Python. + +Not Implemented +``` + ### Description: This API allows to get the list of video streams avalibale and view the live stream. diff --git a/source/index.html.md b/source/index.html.md index ee60130cab2..ba70e03f3cd 100755 --- a/source/index.html.md +++ b/source/index.html.md @@ -9,6 +9,7 @@ language_tabs: - shell: ros-cli - cpp--ros: roscpp - python--ros: rospy + - python--flyt_python: flyt_python includes: