Skip to content

Commit

Permalink
refactor for correct import as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
ackhoury committed Jun 5, 2019
1 parent 894ca1b commit e1d962f
Show file tree
Hide file tree
Showing 335 changed files with 87 additions and 189 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
script:
# install the package and test
- pip install -e .[tests]
- ./scripts/build_exploration
- ./bc_exploration/build.sh
- py.test --pep8 -m pep8 -n8
- py.test -n8
- ./scripts/test_pylint
- ./test_pylint
20 changes: 0 additions & 20 deletions Pipfile

This file was deleted.

37 changes: 0 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,3 @@ Frontier-based exploration implemented with a few different behavioral modes, ea

Includes integration with online mapping.
Includes benchmarking framework / benchmarks


line count breakdown:
```
166 ../benchmarks/benchmarks.py
145 ../mapping/costmap.py
188 ../mapping/log_odds_mapper.py
38 ../mapping/test_costmap.py
45 ../mapping/test_log_odds_mapper.py
39 ../utilities/test_util.py
37 ../utilities/paths.py
76 ../utilities/visualization.py
39 ../utilities/map_transformations.py
209 ../utilities/util.py
49 ../setup.py
288 ../sensors/sensors.py
130 ../sensors/sensor_util.py
23 ../sensors/test_sensor_util.py
220 ../envs/grid_world.py
245 ../envs/map_maker.py
247 ../envs/test_grid_world.py
105 ../footprints/footprint_points.py
311 ../footprints/footprints.py
63 ../footprints/test_footprints.py
57 ../footprints/collision_cpp.py
180 ../planners/astar_cpp.py
209 ../planners/test_astar_cpp.py
75 ../agents/test_frontier_agent.py
34 ../agents/agent.py
459 ../agents/frontier_agent.py
27 ../algorithms/test_frontier_based_exploration.py
270 ../algorithms/frontier_based_exploration.py
37 ../misc/bc_linters/check_illegal_constructs.py
373 ../misc/bc_linters/docstring_checker.py
93 ../misc/bc_linters/check_illegal_imports.py
4477 total
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from functools import partial
from matplotlib import pyplot as plt

from agents.agent import Agent
from mapping.costmap import Costmap
from planners.astar_cpp import oriented_astar, get_astar_angles
from utilities.util import wrap_angles, which_coords_in_bounds, xy_to_rc, rc_to_xy
from bc_exploration.agents.agent import Agent
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.planners.astar_cpp import oriented_astar, get_astar_angles
from bc_exploration.utilities.util import wrap_angles, which_coords_in_bounds, xy_to_rc, rc_to_xy


def extract_frontiers(occupancy_map, approx=True, approx_iters=2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import numpy as np
from matplotlib import pyplot as plt

from agents.frontier_agent import extract_frontiers
from algorithms.frontier_based_exploration import create_frontier_agent_from_params, visualize
from mapping.costmap import Costmap
from utilities.paths import get_exploration_dir
from utilities.util import xy_to_rc, which_coords_in_bounds, load_occupancy_map_data
from utilities.visualization import draw_footprint_path
from bc_exploration.agents.frontier_agent import extract_frontiers
from bc_exploration.algorithms.frontier_based_exploration import create_frontier_agent_from_params, visualize
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.utilities.paths import get_exploration_dir
from bc_exploration.utilities.util import xy_to_rc, which_coords_in_bounds, load_occupancy_map_data
from bc_exploration.utilities.visualization import draw_footprint_path


def test_extract_frontiers(debug=False):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
import cv2
import numpy as np
import yaml
from agents.frontier_agent import FrontierAgent
from envs.grid_world import GridWorld
from footprints.footprint_points import get_tricky_circular_footprint, get_tricky_oval_footprint, get_jackal_footprint
from footprints.footprints import CustomFootprint
from mapping.costmap import Costmap
from mapping.log_odds_mapper import LogOddsMapper
from sensors.sensors import Lidar
from utilities.paths import get_maps_dir, get_exploration_dir
from utilities.util import xy_to_rc, which_coords_in_bounds, scan_to_points
from utilities.visualization import draw_footprint_path, draw_frontiers, draw_scan_ranges

from bc_exploration.agents.frontier_agent import FrontierAgent
from bc_exploration.envs.grid_world import GridWorld
from bc_exploration.footprints.footprint_points import get_tricky_circular_footprint, get_tricky_oval_footprint, get_jackal_footprint
from bc_exploration.footprints.footprints import CustomFootprint
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.mapping.log_odds_mapper import LogOddsMapper
from bc_exploration.sensors.sensors import Lidar
from bc_exploration.utilities.paths import get_maps_dir, get_exploration_dir
from bc_exploration.utilities.util import xy_to_rc, which_coords_in_bounds, scan_to_points
from bc_exploration.utilities.visualization import draw_footprint_path, draw_frontiers, draw_scan_ranges


def create_frontier_agent_from_params(params_filename):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import os
import numpy as np
from algorithms.frontier_based_exploration import run_frontier_exploration
from utilities.paths import get_maps_dir, get_exploration_dir
from bc_exploration.algorithms.frontier_based_exploration import run_frontier_exploration
from bc_exploration.utilities.paths import get_maps_dir, get_exploration_dir


def test_frontier_based_exploration():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import numpy as np
import pickle

from algorithms.frontier_based_exploration import run_frontier_exploration
from utilities.paths import get_maps_dir, get_exploration_dir
from bc_exploration.algorithms.frontier_based_exploration import run_frontier_exploration
from bc_exploration.utilities.paths import get_maps_dir, get_exploration_dir


def make_results(result_keys, results):
Expand Down
8 changes: 4 additions & 4 deletions scripts/build_exploration → bc_exploration/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"


rm -rf $DIR/../cpp/build
rm -rf $DIR/../cpp/bin
mkdir $DIR/../cpp/build
rm -rf $DIR/cpp/build
rm -rf $DIR/cpp/bin
mkdir $DIR/cpp/build

cd $DIR/../cpp/build/ &&
cd $DIR/cpp/build/ &&
cmake .. &&
make &&
cd -
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions envs/grid_world.py → bc_exploration/envs/grid_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import cv2
import numpy as np
from mapping.costmap import Costmap
from utilities.util import wrap_angles, compute_connected_pixels
from utilities.util import xy_to_rc
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.utilities.util import wrap_angles, compute_connected_pixels
from bc_exploration.utilities.util import xy_to_rc


class GridWorld:
Expand Down
2 changes: 1 addition & 1 deletion envs/map_maker.py → bc_exploration/envs/map_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# for Python3
from tkinter import Canvas, Tk, Label, Entry, LEFT, X, Button

from utilities.paths import get_maps_dir
from bc_exploration.utilities.paths import get_maps_dir


class Cell:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import os

import numpy as np
from envs.grid_world import GridWorld
from footprints.footprints import CustomFootprint
from mapping.costmap import Costmap
from sensors.sensors import Neighborhood
from utilities.paths import get_maps_dir
from bc_exploration.envs.grid_world import GridWorld
from bc_exploration.footprints.footprints import CustomFootprint
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.sensors.sensors import Neighborhood
from bc_exploration.utilities.paths import get_maps_dir


def test_creation():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import ctypes
import numpy as np

from utilities.paths import get_exploration_so_path
from utilities.util import xy_to_rc
from bc_exploration.utilities.paths import get_exploration_so_path
from bc_exploration.utilities.util import xy_to_rc

int_1d_type = np.ctypeslib.ndpointer(dtype=np.int32, ndim=1, flags='C_CONTIGUOUS')
int_2d_type = np.ctypeslib.ndpointer(dtype=np.int32, ndim=2, flags='C_CONTIGUOUS')
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import cv2
import matplotlib.pyplot as plt
import numpy as np
from footprints.collision_cpp import check_for_collision
from mapping.costmap import Costmap
from utilities.util import rc_to_xy, get_rotation_matrix_2d
from utilities.util import which_coords_in_bounds, compute_circumscribed_radius, \
from bc_exploration.footprints.collision_cpp import check_for_collision
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.utilities.util import rc_to_xy, get_rotation_matrix_2d
from bc_exploration.utilities.util import which_coords_in_bounds, compute_circumscribed_radius, \
clip_range, xy_to_rc


Expand Down Expand Up @@ -185,7 +185,7 @@ def check_for_collision(self, state, occupancy_map, unexplored_is_occupied=False
is_colliding = np.any(footprint_mask == ego_map)

if debug:
plt.imshow(footprint_mask - .1*ego_map)
plt.imshow(footprint_mask - 0.1 * ego_map)
plt.show()

return is_colliding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import numpy as np

from footprints.footprint_points import get_tricky_oval_footprint, get_tricky_circular_footprint
from footprints.footprints import CustomFootprint
from mapping.costmap import Costmap
from utilities.util import rc_to_xy, load_occupancy_map_data
from bc_exploration.footprints.footprint_points import get_tricky_oval_footprint, get_tricky_circular_footprint
from bc_exploration.footprints.footprints import CustomFootprint
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.utilities.util import rc_to_xy, load_occupancy_map_data


def test_custom_footprint(debug=False):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions mapping/costmap.py → bc_exploration/mapping/costmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import cv2
import numpy as np

from utilities.paths import get_exploration_dir
from utilities.util import which_coords_in_bounds
from bc_exploration.utilities.paths import get_exploration_dir
from bc_exploration.utilities.util import which_coords_in_bounds


class Costmap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import numpy as np
from matplotlib import pyplot as plt

from sensors.sensor_util import bresenham2d_with_intensities
from utilities.util import xy_to_rc, which_coords_in_bounds, wrap_angles, scan_to_points
from bc_exploration.sensors.sensor_util import bresenham2d_with_intensities
from bc_exploration.utilities.util import xy_to_rc, which_coords_in_bounds, wrap_angles, scan_to_points


class LogOddsMapper:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function, absolute_import, division

import numpy as np
from mapping.costmap import Costmap
from bc_exploration.mapping.costmap import Costmap


def test_creation():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import print_function, absolute_import, division

import numpy as np
from mapping.costmap import Costmap
from mapping.log_odds_mapper import LogOddsMapper
from bc_exploration.mapping.costmap import Costmap
from bc_exploration.mapping.log_odds_mapper import LogOddsMapper


def test_update():
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit e1d962f

Please sign in to comment.