the question is pretty straight forward. I would like to control a drone (Bitcraze Crazyflie), using a Google Home. The Input is: "Drone fly to x3 y4", processed as usual by Firebase etc. Resulting in the Google Assistant Output: "Flying to x3 y4", but also an Ouput in e.g. JSON format, to navigate the drone. Because the drone works with Python, this is the preferable Output language.
EDIT Added more Context
Currently I'm using an node server running this code:
'use strict';
// Import the Dialogflow module from the Actions on Google client library.
const {dialogflow} = require('actions-on-google');
// Import the firebase-functions package for deployment.
const functions = require('firebase-functions');
// Instantiate the Dialogflow client.
const app = dialogflow({debug: true});
// Handle the Dialogflow intent named 'fly'.
// The intent collects parameters named 'xaxis, yaxis'.
app.intent('fly', (conv, {xaxis,yaxis}) => {
const xAxis = xaxis;
const yAxis = yaxis;
// Respond with the user's coordinates and end the conversation.
conv.close('Roger that, flying to ' + xAxis + ", " + yAxis);
});
// Set the DialogflowApp object to handle the HTTPS POST request.
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
Now I would like to get the const xAxis and yAxis and use them in a Python program. I've tried using
process.stdout.write(xAxis + yAxis);
Listening in Python with something like
out = sensor.stdout.read(1)
but the code will be run on the Google Server, so local port listening does not work.
Thanks for your help.