ConstructionBots.jl

ConstructionBots.jl is an open-source multi-robot manufacturing simulator and is designed to test algorithms for multi-robot assembly planning. This system approaches multi-robot assembly planning from a higher level of abstraction and addresses task planning and transit planning but abstracts away the kino-dynamic details of piecing together assemblies. Problems addressed and simulated:

  • Trasport Team configuration: How many robots are needed and how should robots be positioned when transporting a particular payload?
  • Spatial layout of the construction site: Where will each assembly be built, and where will the components of those assemblies be delivered?
  • Sequential task allocation and team forming: Which robots will collect and deliver which payloads? Wince there are generally far more payloads than robots, individual robots generally have to transport multiple payloads in sequence.
  • Collision avoidance with heterogeneous agent geometry and dynamics: How must laden and unloaden robots and robot teams move, subject to motion constraints that depend on the payload size and team configuration, to avoid collision with other robots and the active construction sites in the environment?

ConstructionBots ueses LEGO models to evaluate algorithms. LEGO models offer a convenient framework for defining large assemblies that are often composed of smaller assemblies in addition to individual parts. ConstructionBots uses assemblies that are defined using the LDraw file specification, an open-source tool for describing LEGO bricks and models.

Hosted Demos to View the Functionality of ConstructionBots

ProjectAllocation AlgorithmRVODispersionTangent BugVisualization
TractorGreedyYesYesYesLink
TractorMILPYesYesYesLink
AT-TE WalkerMILP + GreedyYesYesYesLink
X-WingGreedyNoNoNoLink
Saturn VGreedyYesYesYesLink

Saturn V (RVO + Dispersion + Tangent Bug) Video

Saturn V demo

Manual Outline

Installation

ConstructionBots

To interact with ConstrucitonBots, it is recommended you clone this repository and instantiate the environment.

git clone https://github.com/sisl/ConstructionBots.jl.git
cd ConstructionBots.jl
julia
julia> ] activate .
pkg> instantiate
pkg> build

LDraw Parts Library

Individual part geometry is needed for all features. The parts library can be downloaded from LDraw™ Parts Library. Place the unzipped library in your desired path. The default path assumed by LDrawParser is joinpath(homedir(), "Documents/ldraw"). It is recommended to download the complete library (~80 MB zipped, ~450 MB unzipped). If you did not place the parts library in the default path, you can change the path LDrawParser uses by the set_part_library_dir! command.

RVO

The RVO2 library is used for collision avoidance. ConstructionBots uses a Python API to interact with RVO2 library. The modified version of RVO2 that integrates dynamic priorities can be found at https://github.com/sisl/Python-RVO2.

To install the RVO2 library:

conda create -n lego_rvo2 python=3.7 anaconda
conda activate lego_rvo2
conda install pip
pip install cython==0.29.36
git clone https://github.com/sisl/Python-RVO2.git
cd Python-RVO2
python setup.py build
python setup.py install

Once you have the RVO2 library built, you need to set the path to the appropriate environment for PyCall to find the RVO2 library. In the Julia REPL, run the following:

julia> ENV["PYTHON"] = "path/to/lego_rvo2/bin/python3.7" # e.g. ~/miniconda3/envs/lego_rvo2/bin/python3.7
julia> using Pkg
julia> Pkg.build("PyCall")

Restart Julia and run the following to test the installation of the RVO2 library:

julia> using PyCall
julia> rvo = pyimport("rvo2")

Note: In the current build of ConstructionBots, this step is still required even if you do not plan to use RVO.

Usage

This repository comes with demos to demonstrate the functionality of ConstructionBots. To run the demos, run the following in the Julia REPL:

julia> include("scripts/demos.jl")

The default demo is the a Tractor based on LEGO model 10708, Green Creativity Box. The tractor model has a total of 20 individual pieces, which are organized into one final assembly (the tractor) and seven subassemblies. The demo is configured to use 10 robots to assemble the tractor. The collision avoidance algorithms are not used and it should open an interative visualization of the assembly process in your brower similar to Tractor Demo. The demo can be configured by changing the parameters in demos.jl.

If the demo setting update_anim_at_every_step is not set to true, then the animation will only update at the completion of nodes in the schedule. This setting results in faster processing times for the animation, but results in entities taking straight paths between updates. Therefore, it appears that collisions occur between entities. If collision avoidance is enabled and you want to see the collision avoidance in action (with no missed steps), set update_anim_at_every_step to true. Changing this setting increases processing time quite a bit.

Citation

Under review

arXiv paper

@article{Brown2023Assembly},
title = {Large-Scale Multi-Robot Assembly Planning for Autonomous Manufacturing},
author = {Kyle Brown and Dylan M. Asmar and Mac Schwager and Mykel J. Kochenderfer},
journal = {arXiv preprint arXiv:2311.00192},
year = {2023}

Functions

ConstructionBots.run_lego_demoMethod
run_lego_demo(; kwargs...)

Run the lego demo.

Keyword arguments:

  • ldraw_file::String: ldraw file
  • project_name::String: project name (default: ldraw_file)
  • model_scale::Float64: scale of the model (default: 0.008)
  • num_robots::Int: number of robots to use (default: 12)
  • robot_scale::Float64: scale of the robots (default: 0.7 * model_scale)
  • robot_height::Float64: height of the robots (default: 10 * robot_scale)
  • robot_radius::Float64: radius of the robots (default: 25 * robot_scale)
  • num_object_layers::Int: number of layers to stack the legos (default: 1)
  • max_steps::Int: maximum number of steps to run the simulation (default: 100000)
  • staging_buffer_factor::Float64: factor to multiply the largest transport unit radius by to get the staging buffer (default: 1.2)
  • build_step_buffer_factor::Float64: factor to multiply the robot radius by to get the build step buffer (default: 0.5)
  • base_results_path::String: base path to save results to
  • results_path::String: folder name to save the results to (inside baseresultspath)
  • assignment_mode::Symbol: assignment mode to use (default: :greedy, options: :greedy, :milp, :milpwgreedywarmstart)
  • open_animation_at_end::Bool: open the animation in the browser at the end of the simulation (default: false)
  • save_animation::Bool: save the animation at the end of the simulation (default: false)
  • save_animation_along_the_way::Bool: save the animation at periodic intervals during the simulation (default: false)
  • anim_active_agents::Bool: animate which agents are active (green circles) (default: false)
  • anim_active_areas::Bool: animate which areas are active (purple circles) (default: false)
  • process_updates_interval::Int: the interval to process animation updates (default: 25)
  • block_save_anim::Bool: whether to save the animation in blocks instead of incrementally. false = incrementall, true = save in blocks (default: false)
  • update_anim_at_every_step::Bool: whether to update the animation at every step (default: false)
  • save_anim_interval::Int: the interval of number of updates to save the animation if save_animation_along_the_way=true (default: 500)
  • rvo_flag::Bool: whether to use RVO (default: true)
  • tangent_bug_flag::Bool: whether to use tangent bug (default: true)
  • dispersion_flag::Bool: whether to use dispersion (default: true)
  • overwrite_results::Bool: whether to overwrite the stats.toml file or create a new one with a date-time filename (default: true)
  • write_results::Bool: whether to write the results to disk (default: true)
  • max_num_iters_no_progress::Int: maximum number of iterations to run without progress (default: 10000)
  • sim_batch_size::Int: number of steps to run in a simulation before clearing some memory (default: 50)
  • log_level::Logging.LogLevel: log level to use (default: Logging.Warn)
  • milp_optimizer::Symbol: optimizer to use for the MILP (default: :highs, options: :gurobi, :glpk)
  • milp_optimizer_attribute_dict::Dict: dictionary of attributes to set on the optimizer (default: Dict())
  • optimizer_time_limit::Int: time limit for the optimizer (default: 600)
  • look_for_previous_milp_solution::Bool: whether to look for a previous MILP solution (default: false)
  • save_milp_solution::Bool: whether to save the MILP solution (default: false)
  • previous_found_optimizer_time::Int: time limit for the optimizer when looking for a previous solution (default: 30)
  • stop_after_task_assignment::Bool: whether to stop after task assignment (default: false)
  • ignore_rot_matrix_warning::Bool: whether to ignore the rotation matrix warning (default: true)
  • rng::Random.AbstractRNG: random number generator to use (default: MersenneTwister(1))
source
ConstructionBots.get_project_paramsFunction
get_project_params(project::Int)
get_project_params(project::Symbol)

Returns the parameters for the project with the given number or symbol. Returns a Dict with the following fields:

  • project_name (String): The name of the project.
  • file_name (String): The name of the LDraw file.
  • model_scale (Float64): The default scale of the model.
  • num_robots (Int): The default number of robots to use.
source