Blockly visual programming on ardupilot

Googles Blockly visual program editor also supports LUA scripting, I have used it for home automation for years as a simple way of doing basic logic, but if someone built a version specifically for autopilot it would make Lua programming radically simpler, generating Lua would just be a matter of picking your inputs and outputs. generating mavlink messages would just be a couple of clicks and with all the new Lua bindings it has the ability to be extremely powerful but simple enough a child could do it.

2 Likes

I really like this idea. I would love to see someone take this on and provide some ArduPilot-specific Lua visuals and output.

While my own skillset is probably (barely) adequate to make an attempt, I fear I would not have the time to do it proper justice, nor do I have a background in web development that would probably be useful for the project.

I wonder if a guy like @willpiper24 could work some magic with this? Or perhaps, like Willโ€™s GSoC 2021 Firmware Builder, this may be a candidate for a future GSoC project?

2 Likes

This is really a good idea.
I think for a starter, it can be developed using SITL.

I have made some progress towards making this work, but rather than tackle a custom blocky implementation, I have been making a json to mavlink converter.

The idea is if we can convert all the mavlink sensors to json sensors using an ESP32 chip, it can then be sent to a home automation system that has blockly built in for making custom actions.

Sensor data or commands can be sent to the rover by writing the sensor or command to a virtual sensor. The virtual sensor result is requested by the ESP32 and relayed to the flight controller by sending a mavlink message. so in theory it could do anything you can do with mavlink messages.

The main reason Iโ€™m looking to use this is for long term logging of a solar rover. mission planner is never going to run for months without crashing, so I needed something more reliable that could also send alerts to my phone if something happens to it, as itโ€™s going to be doing laps in a public place and I canโ€™t watch it 24/7.

in theory this example should stop the rover once its done a lap of the park and its back to the charging area at waypoint 1, if its under 50v it will enable hold mode until itโ€™s over 50v, then it will switch to auto to do another lap.