April 11, 2023 Software and Documentation Update
Hello all,
Today we released a new version of FarmBot OS, the web app, several of our featured sequences, and published updates to our developer documentation. Here’s what’s new:
water(plant) Lua helper
We’ve added a new high-level water(plant)
Lua helper that moves FarmBot to above a plant and waters it based on its age and assigned watering curve. Note that plants must have a status of “Planted”, and if you’re using this with FarmBot Genesis devices you’ll need to first mount the watering nozzle tool.
To give this helper a try, import our latest Water Using Curve featured sequence and make sure to check out the developer documentation.
dispense(mL) Lua helper
Powering the new water(plant)
helper is a dispense(mL)
helper that generalizes the dispensing of liquids in milliliters by using the FLOW RATE (mL/s) field of a tool. By default, this new function uses the tool named “Watering Nozzle” operated by Pin 8, though you can customize this to use tools of different names and/or pins. Learn more in the docs and give it a try with the updated Dispense Water featured sequence.
grid() Lua helper
Code from our Grid featured sequence has been converted into a general purpose Lua helper that calculates a grid of coordinates based on the provided parameters: grid_points
, spacing
, start
, and offset
, where each parameter is a table with x
, y
, and z
attributes. See the updated Grid featured sequence for an example, or check out the documentation.
This helper is also now used under-the-hood in the photo_grid()
calculations.
set_job(), get_job(), and complete_job() Lua helpers
We’ve improved upon the previous set_job_progress()
and get_job_progress()
helpers with new set_job()
, get_job()
, and complete_job()
Lua helpers that make job management much easier and use far fewer characters. Notably:
- You no longer need to worry about setting the
time
each time you create or update a job - theset_job()
helper will handle this for you. - You can now patch update jobs with a new status or percent without needing to explicitly provide all fields.
-
complete_job()
is a handy shortcut for setting the percent to 100 and status to “Complete”.
See the updated documentation for more details!
Miscellaneous
- Added Korean translation to the app. Thank you @zaxrok on GitHub for the contribution!
- Fixed an issue with the
photo_grid()
Lua helper which was miscalculating the grid and in some circumstances caused the grid to have no grid points. Note that photo grids taken with the latest version of FarmBot OS (v15.4.1) will have slightly different spacing and alignment than grids taken with earlier versions of FarmBot OS. - The
wait()
Lua helper now automatically creates a job to track the progress of the waiting whenever the wait time is over 1000ms. See the updated developer documentation for additional details about advanced usage. - Improved Lua developer documentation for all helper functions by adding more code examples.