Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #337 from OpenAgInitiative/develop
Browse files Browse the repository at this point in the history
openag_brain v1.0.0 release merging the develop branch to the (stable) master.
  • Loading branch information
rbaynes authored Sep 5, 2017
2 parents 52b929c + 1c3c1ed commit 88b2ba0
Show file tree
Hide file tree
Showing 530 changed files with 8,861 additions and 22,428 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
**.DS_Store

# PlatformIO firmware-specific stuff
# Added 2017-03-22 gordonb
**.pioenvs
firmware/src

# Python
*.swp
Expand Down
40 changes: 13 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,28 @@ RUN apt-get update && \
libboost-filesystem-dev \
libxml2-dev \
libgtest-dev
# Tell apt to read from the ROS package repository
RUN sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu jessie main" > /etc/apt/sources.list.d/ros-latest.list'
RUN wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -

RUN sudo locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8

# Create pi user
RUN useradd pi && echo 'pi:hypriot' | chpasswd && echo "pi ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && mkdir -p /home/pi && chown pi:pi /home/pi

# Give pi access to the camera device
RUN sudo usermod -a -G video pi

RUN groupadd gpio

USER pi
WORKDIR /home/pi/
# Give the pi user access to the usb drive for flashing an Arduino
RUN sudo usermod -a -G dialout pi
# Add catkin install dir (built with catkin)
# Note that you must run docker builds from ~/catkin_ws
#
# cd ~/catkin_ws
# docker build -f ./src/openag_brain/Dockerfile .
#

# We use COPY rather than ADD, as COPY is preferred for local files.
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#add-or-copy
COPY . /home/pi/catkin_ws
COPY . /home/pi/catkin_ws/src/openag_brain
RUN sudo chown -R pi:pi ~/catkin_ws
# Install ROS boostrapping tool
RUN sudo apt-get update && sudo apt-get install --no-install-recommends -y -q \
python-pip python-rosdep
# Install dependencies with rosdep
RUN sudo rosdep init && rosdep update && rosdep install --from-paths ~/catkin_ws/src --ignore-src --rosdistro indigo -y -r --os=debian:jessie
RUN cd ~/catkin_ws && ./src/catkin/bin/catkin_make install
# Add .bashrc
RUN echo -e '[ -z "$PS1" ] && return' >~/.bashrc
RUN echo -e 'source ~/catkin_ws/install/setup.bash' >>~/.bashrc
# Install openag_python from the git repository
RUN cd ~ && git clone http://github.com/OpenAgInitiative/openag_python.git
RUN sudo pip install ./openag_python

# Set up ROS environment vars
ENV LANG=en_US.UTF-8 ROS_DISTRO=indigo

RUN /home/pi/catkin_ws/src/openag_brain/scripts/install_dev

# Run the project
CMD ["/home/pi/catkin_ws/install/env.sh", "rosrun", "openag_brain", "main", "personal_food_computer_v2.launch"]
USER pi
299 changes: 237 additions & 62 deletions data/mock_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,72 +30,247 @@
}

MOCK_RECIPE_FLEXFORMAT_A = {
"_id": "general_greens",
"format": "flexformat",
"version": "1.0",
"seeds": ["green_lettuce_seed", "romaine_lettuce_seed"],
"plant_type": ["lettuce", "green"],
"certified_by": ["SuperSmartScientist"],
"optimization": ["general purpose"],
"_id": "example_recipe_flexformat",
"author": "John Doe",
"rating": 20,
"downloads": 10000,
"certified_by": [
"SuperSmartScientist"
],
"date_created": "2017-02-08",
"downloads": 10000,
"format": "flexformat",
"optimization": [
"general purpose"
],
"phases": [
{ "name": "early",
{
"cycles": 14,
"time_units" : "hours",
"variable_units": {"air_temperature": "Celcius",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml",
"light_illuminance": "percent_relative"},
"step": { "air_temperature": [{"start_time": 0, "end_time": 6, "value": 20},
{"start_time": 6, "end_time": 18, "value": 23},
{"start_time": 18, "end_time": 24, "value": 19}],
"nutrient_flora_duo_a": [{"start_time": 0, "end_time": 6, "value": 5},
{"start_time": 6, "end_time": 18, "value": 2},
{"start_time": 18, "end_time": 24, "value": 5}],
"nutrient_flora_duo_b": [{"start_time": 0, "end_time": 6, "value": 2}],
"light_illuminance": [{"start_time": 0, "end_time": 6, "value": 4},
{"start_time": 18, "end_time": 24, "value": 3}],
},
},
{ "name": "middle",
"name": "early",
"step": {
"air_temperature": [
{
"end_time": 7,
"start_time": 0,
"value": 22
},
{
"end_time": 18,
"start_time": 7,
"value": 25
},
{
"end_time": 24,
"start_time": 18,
"value": 23
}
],
"light_intensity_blue": [
{
"end_time": 6,
"start_time": 0,
"value": 0
},
{
"end_time": 18,
"start_time": 6,
"value": 1
},
{
"end_time": 24,
"start_time": 18,
"value": 0
}
],
"light_intensity_red": [
{
"end_time": 6,
"start_time": 0,
"value": 1
},
{
"end_time": 18,
"start_time": 6,
"value": 1
},
{
"end_time": 24,
"start_time": 18,
"value": 0
}
],
"nutrient_flora_duo_a": [
{
"end_time": 6,
"start_time": 0,
"value": 5
},
{
"end_time": 18,
"start_time": 6,
"value": 2
},
{
"end_time": 24,
"start_time": 18,
"value": 5
}
],
"nutrient_flora_duo_b": [
{
"end_time": 6,
"start_time": 0,
"value": 2
}
]
},
"time_units": "hours",
"variable_units": {
"air_temperature": "Celcius",
"light_illuminance": "percent_relative",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml"
}
},
{
"cycles": 20,
"time_units" : "hours",
"variable_units": {"air_temperature": "Celcius",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml",
"light_illuminance": "percent_relative"},
"step": { "air_temperature": [{"start_time": 0, "end_time": 6, "value": 20},
{"start_time": 6, "end_time": 18, "value": 23},
{"start_time": 18, "end_time": 24, "value": 19}],
"nutrient_flora_duo_a": [{"start_time": 0, "end_time": 6, "value": 5},
{"start_time": 6, "end_time": 18, "value": 2},
{"start_time": 18, "end_time": 24, "value": 5}],
"nutrient_flora_duo_b": [{"start_time": 0, "end_time": 6, "value": 2}],
"light_illuminance": [{"start_time": 0, "end_time": 6, "value": 4},
{"start_time": 18, "end_time": 24, "value": 3}]
},
},
{ "name": "late",
"name": "middle",
"step": {
"air_temperature": [
{
"end_time": 6,
"start_time": 0,
"value": 20
},
{
"end_time": 18,
"start_time": 6,
"value": 23
},
{
"end_time": 24,
"start_time": 18,
"value": 19
}
],
"light_illuminance": [
{
"end_time": 6,
"start_time": 0,
"value": 4
},
{
"end_time": 24,
"start_time": 18,
"value": 3
}
],
"nutrient_flora_duo_a": [
{
"end_time": 6,
"start_time": 0,
"value": 5
},
{
"end_time": 18,
"start_time": 6,
"value": 2
},
{
"end_time": 24,
"start_time": 18,
"value": 5
}
],
"nutrient_flora_duo_b": [
{
"end_time": 6,
"start_time": 0,
"value": 2
}
]
},
"time_units": "hours",
"variable_units": {
"air_temperature": "Celcius",
"light_illuminance": "percent_relative",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml"
}
},
{
"cycles": 7,
"time_units" : "hours",
"variable_units": {"air_temperature": "Celcius",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml",
"light_illuminance": "percent_relative"},
"name": "late",
"step": {
"air_temperature": [{"start_time": 0, "end_time": 6, "value": 20},
{"start_time": 6, "end_time": 18, "value": 23},
{"start_time": 18, "end_time": 24, "value": 19}],
"nutrient_flora_duo_a": [{"start_time": 0, "end_time": 6, "value": 5},
{"start_time": 6, "end_time": 18, "value": 2},
{"start_time": 18, "end_time": 24, "value": 5}],
"nutrient_flora_duo_b": [{"start_time": 0, "end_time": 6, "value": 2}],
"light_illuminance": [{"start_time": 0, "end_time": 6, "value": 4},
{"start_time": 18, "end_time": 24, "value": 3}]
},
}
]
}
"air_temperature": [
{
"end_time": 6,
"start_time": 0,
"value": 20
},
{
"end_time": 18,
"start_time": 6,
"value": 23
},
{
"end_time": 24,
"start_time": 18,
"value": 19
}
],
"light_illuminance": [
{
"end_time": 6,
"start_time": 0,
"value": 4
},
{
"end_time": 24,
"start_time": 18,
"value": 3
}
],
"nutrient_flora_duo_a": [
{
"end_time": 6,
"start_time": 0,
"value": 5
},
{
"end_time": 18,
"start_time": 6,
"value": 2
},
{
"end_time": 24,
"start_time": 18,
"value": 5
}
],
"nutrient_flora_duo_b": [
{
"end_time": 6,
"start_time": 0,
"value": 2
}
]
},
"time_units": "hours",
"variable_units": {
"air_temperature": "Celcius",
"light_illuminance": "percent_relative",
"nutrient_flora_duo_a": "ml",
"nutrient_flora_duo_b": "ml"
}
}
],
"plant_type": [
"lettuce",
"green"
],
"rating": 20,
"seeds": [
"green_lettuce_seed",
"romaine_lettuce_seed"
],
"version": "1.0"
}
2 changes: 1 addition & 1 deletion doc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Now that openag_brain is in the catkin_build space, you can run the
install script::

cd ~/catkin_ws/src/openag_brain
./scripts/install_dev
./scripts/developer_setup

This will set up a full development environment for openag_brain and ROS.

Expand Down
Loading

0 comments on commit 88b2ba0

Please sign in to comment.