예제 #1
0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import random
import time

import interface
import util
import shelf_stow_locator
import grab
import arm_control_wrapper

(logdebug, loginfo, logwarn, logerr) = util.get_loggers("VisibleGreedyStowing")


class ItemChoiceMode:
    RANDOM, SMALLEST, LARGEST, VISIBLE = range(4)


CHOICE_MODE = ItemChoiceMode.VISIBLE


class VisibleGreedyStowing(interface.StowProcessStrategy):
    """VisibleGreedyStowing scans the tote and takes the item with the
    highest score to the shelf."""
    def execute(self):
        # get a stratey to determine free space
        stow_strategy = shelf_stow_locator.select_tote2bin_strategy(
예제 #2
0
# See the License for the specific language governing permissions and
# limitations under the License.

import random

import interface
import util
import shelf_stow_locator
import grab
from grab.vacuum_imgproc import gaussian_interpolation,
import arm_control_wrapper

import conv_bin_coord


(logdebug, loginfo, logwarn, logerr) = util.get_loggers("SmallBinFirstStowing")


class SmallBinFirstStowing(interface.StowProcessStrategy):
    """VisibleGreedyStowing scans the tote and takes the item with the
    highest score to the shelf."""
    def execute(self):
        super(SmallBinFirstStowing, self).calibrate()

        # get a stratey to determine free space
        stow_strategy = shelf_stow_locator.select_strategy(self.pos_info)
        loginfo("ShelfStowLocatorStrategy: %s" % stow_strategy)

        try_count = 0
        items_in_tote = self.pos_info.tote[:]
        while items_in_tote and try_count < 20:
예제 #3
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import rospy

import shelf_stow_locator
import arm_control_wrapper
import grab
import util

import interface

(logdebug, loginfo, logwarn,
 logerr) = util.get_loggers("MoveUntilGrabbablePicking")


class GrabResult:
    SUCCESS, CANNOT_GRAB, FAILED_GRAB = range(3)


class MoveUntilGrabbablePicking(interface.GetItemFromBinStrategy):
    # MoveUntilGrabbablePicking moves items that are obstacles to a different
    # bin until the difficulty to grab the target item is low enough.
    def __init__(self, pos_info):
        self.pos_info = pos_info

    def get_max_tries(self, item, strategy):
        # number of attempts to take an item using grab_from_shelf
        if isinstance(strategy, grab.vacuum.VacuumGrabbing):
예제 #4
0
# See the License for the specific language governing permissions and
# limitations under the License.

import time
import threading

import rospy
import actionlib
from actionlib_msgs.msg import GoalStatus

from apc2016.msg import CalibrationAction, CalibrationGoal
from apc2016.srv import Success, CalibrationUpdate

import util

(logdebug, loginfo, logwarn, logerr) = util.get_loggers("PickProcessStrategy")


class PickProcessStrategy(object):
    def __init__(self, pos_info):
        self.pos_info = pos_info
        self.start = time.time()
        cd = threading.Thread(target=self.countdown)
        cd.daemon = True
        cd.start()

    def countdown(self):
        while True:
            time.sleep(10)
            elapsed = util.get_elapsed_time(self.start)
            loginfo("elapsed time: %s" % elapsed)
예제 #5
0
# limitations under the License.

import rospy

import interface
import get_item

import shelf_stow_locator
import tote_stow_locator
import arm_control_wrapper
import grab
import util

import time

(logdebug, loginfo, logwarn, logerr) = util.get_loggers("MoveUntilGrabbablePicking")

class DifficultyOrderPicking(interface.PickProcessStrategy):

    def execute(self, items):
        # get the strategy for how to prepare the actual pick
        get_item_strategy = get_item.select_strategy(self.pos_info)
        loginfo("GetItemFromBinStrategy: %s" % get_item_strategy)

        # get the strategy for where to store items
        target_locator = tote_stow_locator.select_strategy(self.pos_info)
        loginfo("ToteStowLocatorStrategy: %s" % target_locator)
        
        calib_ok = super(DifficultyOrderPicking, self).calibrate()
        if not calib_ok:
            logerr("calibration failed")
예제 #6
0
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import json
from collections import OrderedDict

import util

(logdebug, loginfo, logwarn, logerr) = util.get_loggers("ItemLocations")


class ItemLocations:
    allowed_items = set([
        "i_am_a_bunny_book", "laugh_out_loud_joke_book", "rawlings_baseball",
        "folgers_classic_roast_coffee", "scotch_bubble_mailer",
        "elmers_washable_no_run_school_glue", "hanes_tube_socks",
        "womens_knit_gloves", "cloud_b_plush_bear",
        "kyjen_squeakin_eggs_plush_puppies", "creativity_chenille_stems",
        "oral_b_toothbrush_red", "cool_shot_glue_sticks",
        "dr_browns_bottle_brush", "fiskars_scissors_red",
        "platinum_pets_dog_bowl", "fitness_gear_3lb_dumbbell",
        "rolodex_jumbo_pencil_cup", "expo_dry_erase_board_eraser",
        "kleenex_tissue_box", "crayola_24_ct", "dove_beauty_bar",
        "staples_index_cards", "up_glucose_bottle", "dasani_water_bottle",