🚧 work in progress
I was wondering how complicated would it be to generate random test environments for agricultural robots. Turned out with great tools like the Blender python API, and Ignition Gazebo it can be a fun and straightforward process 🎉
This repo contains:
- Blender script that generates individual tomato crops
- Jupyter notebook for building the SDF models and the world description
- ROS node that visualizes the ground truth data in RViz
- Dockerfile for running the simulations
- Example worlds generated with this tool
- The generated results are reproducible by specifying the seed value
- Each model has a markers.json listing the position of the fruits relative to the crop
- Also, the world folder has a markers.json listing all the plant and fruit positions relative to the world origin
requires ROS Noetic and Ignition Dome
git clone https://github.com/azazdeaz/fields-ignition.git
in the src folderrosdep install --from-paths src --ignore-src -r -y
in the workspace folder- and build with
catkin_make
- run an example world:
roslaunch fields_ignition field.launch world_dir:=$(rospack find fields_ignition)/generated_examples/tomato_field
- visualize the ground truth data with rviz:
roslaunch fields_ignition ground_truth.launch world_dir:=$(rospack find fields_ignition)/generated_examples/tomato_field
- start the notebook
rosrun fields_ignition tomato_gen_notebook
- modify the parameters in the second cell and run the notebook
# build the container
docker build -t ros-tomatoes .
# run the simulator with Docker:
xhost +
docker run -it \
-e WORLD_DIR=/catkin_ws/src/fields_ignition/generated_examples/tomato_field \
-e DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-e XAUTHORITY=$XAUTH \
-v "$XAUTH:$XAUTH" \
-v "/tmp/.X11-unix:/tmp/.X11-unix" \
-v "/etc/localtime:/etc/localtime:ro" \
-v "/dev/input:/dev/input" \
--network host \
--rm \
--privileged \
--runtime=nvidia \
--security-opt seccomp=unconfined \
--name tomato_field \
ros-tomatoes
Note: to start a less resource heavy simulation change the
WORLD_DIR
env to/catkin_ws/src/fields_ignition/generated_examples/tomato_field_mini