Greenhouse environment simulation for the MDP RO47007 course at TU Delft.
Project description
mdp-greenhouse-sim
This project represents the greenhouse simulation used during the course RO47007 ''Multidisciplinary Project'' in the Master's program robotics at TU Delft in 2026. This software simulates (simplified) greenhouse climates and allows one to query sensor values for different types of physical measurements, e.g., temperature or humidity. This project is part of the Open Educational Resources (OER) developed for the MIRTE Master robot in higher education, see mirte.org. This software has been created by the Robust Robot Systems (R2S) section of the Department of Cognitive Robotics at TU Delft.
Install
The MDP greenhouse simulation is available via PyPI and can be installed via:
python -m pip install mdp-greenhouse
Command Line Interface of the simulator
This package installs a CLI to create, edit, read, and view created greenhouse environments. You can see an overview of commands using the -h flag:
mdp-greenhouse -h
We briefly go through the basic commands of the CLI.
Create a new greenhouse setup
Create a new greenhouse setup in a folder with default config templates:
mdp-greenhouse --init /path/to/new-setup-folder
This command will create two files. The file greenhouse_config.yaml contains the basic information of the greenhouse, e.g., table sizes, visualization settings, and the greenhouse climate configuration. The file tag_locations.json contains the location of placed tables and sensor markers, including information on the available sensor measurements at each marker location.
If files already exist and you want to replace them:
mdp-greenhouse --init /path/to/new-setup-folder --overwrite
Edit a greenhouse environment
Since the newly created greenhouse is empty, i.e., does not contain tables or sensor locations, we have to edit this greenhouse layout first:
mdp-greenhouse --edit /path/to/new-setup-folder
This command opens the edit GUI and lets you place tables in the predefined size horizontally or vertically, and place marker locations and specify which sensor values are available at a given location. note: make sure to use unique names and IDs for use later when querying data. note: not using a path will open the folder selection dialog box.
Read sensor data for a given tag ID
The read CLI allows you to read sensor data for a specific tag ID in the greenhouse. You can list available tag IDs:
mdp-greenhouse --read --list-tags --config-folder /path/to/config-folder
To stream sensor data for tag tag_id every second:
mdp-greenhouse --read <tag_id> --config-folder /path/to/config-folder
or from the default greenhouse:
mdp-greenhouse --read <tag_id>
View the whole greenhouse climate
The view the whole simulated greenhouse climate, we can use the view GUI. This will show the greenhouse climate over time of the day.
mdp-greenhouse --view /path/to/new-setup-folder
In the view GUI, you can select the physical measurement to view, e.g., temperature, and let the simulation playback throughout the 24 hours of a day. To speed up the simulation, you can also change the speed up factor, e.g., to simulate one minute in every real second.
API to integrate the simulator into your code
You can also integrate the greenhouse simulation into your own code using the Python API:
from greenhouse_sim.simulator import GreenhouseSimulator
sim = GreenhouseSimulator(tag_file=None, sim_config_file=None)
print(f'Available tags are {sim.tags()}')
print(f'Available sensors are {sim.sensors()}')
print(f'Retrieveing sensor data for tag {sim.tags()[0]}:')
print(sim.get_sensor_data(sim.tags()[0]))
This code snippet loads the greenhouse simulator either from the default config (tag_file=None, sim_config_file=None) or from a specified configuration. Afterwards, we print the available tags and sensor types, and receive the values for the first tag in the list.
Configuration options
The greenhouse simulator allows different configuration options for your development in the greenhouse_config.yaml file:
speedup_factor: 1800denotes the speed up of realtime simulation. For instance, 1800 means that one real second corresponds to 0.5 hours of simulation time.debug_mode: falseif set totrue, this flag lets the simulator use a fixed time and seed to allow reproducibility.debug_time_of_day: 12.0time of day in hours (0-24) when debug_mode is truedebug_seed: 42fixed seed for reproducibility in debug mode
To configure your own climate, you can change the sensor setup in the greenhouse_config.yaml file. Every physical measurement, e.g., temperature, is represented through basic dynamics function that adjusts the value based on the time of day using sinusoidal dynamics. Let us go through a single sensor first using the example of temperature:
sensors:
temperature:
- "value_at_midnight": 18 # This is the specified temperature value at midnight (i.e. 24:00)
"value_at_noon": 26 # # This is the specified temperature value at noon (i.e. 12:00)
"noise_sigma": 0 # Specify the Gaussian noise added to the sensor value
"decay_distance": 10.67 # This specifies how the measurements decay over the position domain
"decay_type": "linear" # The type of decay. We support linear and square decays
"position": [5., 5.83] # The center used in the decay computation.
"angle": 10 # Specifies the angle for the dynamics type linear
"dynamics": "radial" # Specifies the used dynamics: Uniform values over the position space, linear gradient, or radial gradient dynamics over the position space.
You can also specify multiple dynamics per sensor. These dynamics are then combined in a composite sensor that returns the max of the individual sensors.
Layout editor behavior
- tag placement snaps to
snap_step_m - new tables snap to
snap_step_m - existing tags and tables can be dragged to reposition them
- tags and tables both show hover tooltips
Misc
Both GUIs show a startup dialog to choose:
- default config folder, or
- a custom folder containing
greenhouse_config.yamlandtag_locations.json.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdp_greenhouse-1.0.6.tar.gz.
File metadata
- Download URL: mdp_greenhouse-1.0.6.tar.gz
- Upload date:
- Size: 31.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06ec114e6fc62c9f920721b9f4a81df28528d9b25281cc72e2edc700595415c5
|
|
| MD5 |
ff50a6415adf7e8c2618a15bb2b7e343
|
|
| BLAKE2b-256 |
5da98b4121c3fc3365c5b620fbe753ebc58a46334e469eb2c1c0f33fea92190f
|
File details
Details for the file mdp_greenhouse-1.0.6-py3-none-any.whl.
File metadata
- Download URL: mdp_greenhouse-1.0.6-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09d8e2c6d7c3eb4147ceb2c16f4f0b4246074b2df2ae9cfdc2c4e444756be25b
|
|
| MD5 |
227e28169c29f685e9404a5e660b2c28
|
|
| BLAKE2b-256 |
3ef77a3f4b3a0ec4347331cc32ce4e599f6e7c9d8c0d52af391a27a51b6616c6
|