# Example dynamic_logistics_warehouse
-----------------------------------------------
* Terminal 1 : 

```bash

roslaunch mir_gazebo mir_empty_world.launch \
world_name:=$(rospack find dynamic_logistics_warehouse)/worlds/warehouse.world robot_x:=9.0 robot_y:=25.0 2> >(grep -v TF_REPEATED_DATA buffer_core)

```

* Terminal 2 : 
```bash
### mapping:
roslaunch mir_navigation hector_mapping.launch
```

```bash
### localization:
roslaunch mir_navigation amcl.launch initial_pose_x:=0.00 initial_pose_y:=0.00 \ initial_pose_a:=0.0 2> >(grep -v TF_REPEATED_DATA buffer_core)

```
* Terminal 3 : 

```bash

rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz 2> >(grep -v TF_REPEATED_DATA buffer_core)

```
* Terminal 4 : 

```bash
# navigation:
roslaunch mir_navigation start_planner.launch \
map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/warehouse.yaml \
empty_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/map_empty.yaml \
virtual_walls_map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/virtual_walls.yaml \
with_virtual_walls:=true \
preferred_zones_map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/preferred_zones.yaml \
with_preferred_zones:=true \
unpreferred_zones_map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/unpreferred_zones.yaml \
with_unpreferred_zones:=true \
critical_zones_map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/critical_zones.yaml \
with_critical_zones:=true \
direction_zones_map_file:=$(rospack find dynamic_logistics_warehouse)/maps/warehouse/direction_zones.yaml \
with_direction_zones:=true 2> >(grep -v TF_REPEATED_DATA buffer_core)
```
```bash
roslaunch mir_navigation move_base.xml with_virtual_walls:=false
```

# Default 

```bash
### gazebo:
roslaunch mir_gazebo mir_maze_world.launch 2> >(grep -v TF_REPEATED_DATA buffer_core)
rosservice call /gazebo/unpause_physics   # or click the "start" button in the Gazebo GUI

### localization:
roslaunch mir_navigation amcl.launch initial_pose_x:=10.0 initial_pose_y:=10.0  2> >(grep -v TF_REPEATED_DATA buffer_core)
# or alternatively: roslaunch mir_gazebo fake_localization.launch delta_x:=-10.0 delta_y:=-10.0

# navigation:
roslaunch mir_navigation start_planner.launch \
    map_file:=$(rospack find mir_gazebo)/maps/maze.yaml 

roslaunch mir_navigation start_planner.launch \
map_file:=$(rospack find mir_gazebo)/maps/warehouse/maze.yaml \
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/warehouse/virtual_walls.yaml \
with_virtual_walls:=true \
preferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/preferred_zones.yaml \
with_preferred_zones:=true \
unpreferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/unpreferred_zones.yaml \
with_unpreferred_zones:=true \
critical_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/critical_zones.yaml \
with_critical_zones:=true \
direction_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/direction_zones.yaml \
with_direction_zones:=true 2> >(grep -v TF_REPEATED_DATA buffer_core)

# rviz
rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz 2> >(grep -v TF_REPEATED_DATA buffer_core)
```

# Multilpe mir
# start Gazebo + first MiR
roslaunch mir_gazebo mir_maze_world.launch tf_prefix:=mir

# first MiR: start localization, navigation + rviz
roslaunch mir_navigation amcl.launch initial_pose_x:=10.0 initial_pose_y:=10.0 tf_prefix:=mir

roslaunch mir_navigation start_planner.launch \
map_file:=$(rospack find mir_gazebo)/maps/warehouse/maze.yaml \
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/warehouse/virtual_walls.yaml \
with_virtual_walls:=true \
preferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/preferred_zones.yaml \
with_preferred_zones:=true \
unpreferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/unpreferred_zones.yaml \
with_unpreferred_zones:=true \
critical_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/critical_zones.yaml \
with_critical_zones:=true \
direction_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/direction_zones.yaml \
with_direction_zones:=true prefix:=mir/ 2> >(grep -v TF_REPEATED_DATA buffer_core)

ROS_NAMESPACE=mir rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz 2> >(grep -v TF_REPEATED_DATA buffer_core)

# spawn second MiR into Gazebo
roslaunch mir_gazebo mir_gazebo_common.launch robot_x:=-2 robot_y:=-2 tf_prefix:=mir2 model_name:=mir2 __ns:=mir2

# second MiR: start localization, navigation + rviz
roslaunch mir_navigation amcl.launch initial_pose_x:=8.0 initial_pose_y:=8.0 tf_prefix:=mir2

roslaunch mir_navigation start_planner.launch \
map_file:=$(rospack find mir_gazebo)/maps/warehouse/maze.yaml \
virtual_walls_map_file:=$(rospack find mir_gazebo)/maps/warehouse/virtual_walls.yaml \
with_virtual_walls:=true \
preferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/preferred_zones.yaml \
with_preferred_zones:=true \
unpreferred_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/unpreferred_zones.yaml \
with_unpreferred_zones:=true \
critical_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/critical_zones.yaml \
with_critical_zones:=true \
direction_zones_map_file:=$(rospack find mir_gazebo)/maps/warehouse/direction_zones.yaml \
with_direction_zones:=true prefix:=mir2/ 2> >(grep -v TF_REPEATED_DATA buffer_core)

ROS_NAMESPACE=mir2 rviz -d $(rospack find mir_navigation)/rviz/navigation.rviz 2> >(grep -v TF_REPEATED_DATA buffer_core)