/bwi

ROS packages for building wide intelligence project, University of Texas at Austin

Primary LanguagePython

bwi

The Building Wide Intelligence (BWI) is a project of the University of Texas at Austin to develop fully autonomous mobile robots that can become a permanent part of a building’s environment. The BWI project provides ROS packages, which are maintained on Github.

Branches

The main branch is master-bu, and the master-ut branch is a copy of forked version from UT people.

BWI Repository Hierarchy

One of the repositories, bwi, contains top-level ROS packages for the BWI project so that the repository can maintain packages contained in various released BWI repositories, which may depend on other packages at the same or lower levels.

From top to bottom, the released repositories are:

System Specification

Ubuntu 18.04
ROS version: melodic
Python version: 2.7 (ROS melodic does not support python 3, however, you can use python 3 code-base on python 2)

Installation

You can find the documentation of installation maintained for the AIR Lab here.

From Source

You can install all the BWI components normally built from source on either ROS Indigo, Kinetic, or Melodic. For the V4 bots, use Melodic.

First, install ROS Indigo, Kinetic, or Melodic. The Kinetic version is only supported on Ubuntu Xenial, and is only partially functional.

Then, make sure the ROS_DISTRO environment variable is set correctly:

echo $ROS_DISTRO

It may already be. If not, issue the appropriate one of these two shell commands:

$ export ROS_DISTRO=kinetic

or

$ export ROS_DISTRO=melodic

Next, clone the source repositories:

$ source /opt/ros/$ROS_DISTRO/setup.bash
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws
$ wstool init src https://raw.githubusercontent.com/bu-air-lab/bwi/master-bu/rosinstall/melodic.rosinstall

Install all dependencies:

$ rosdep update
$ rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y

If you are setting up a workspace on a BWIbot V4 in Anna Hiss Gym, continue from here with the "Special Installation Instructions for Version 4 Robots" below.

Then, build everything. On a slow computer:

$ catkin build -j2 
$ source devel/setup.bash

Or on a fast computer:

$ catkin build -j6 
$ source devel/setup.bash

Or you can adjust the job limit as you see fit.

Note that the catkin build command from the python-catkin-tools package is required for building on ROS Kinetic and Melodic. On ROS Indigo, you can still use catkin_make instead, although the newer build tool is recommended.

To use this code on the Version 3 Segway Robot, one must also define some enviroment variables.

echo "export SEGWAY_INTERFACE_ADDRESS=10.66.171.1" >> ~/.bashrc
echo "export SEGWAY_IP_ADDRESS=10.66.171.5" >> ~/.bashrc
echo "export SEGWAY_IP_PORT_NUM=8080" >> ~/.bashrc
echo "export SEGWAY_BASE_PLATFORM=RMP_110" >> ~/.bashrc
echo "export SEGWAY_PLATFORM_NAME=RMP_110" >> ~/.bashrc

##Usage

Navigation

To launch bwi and all packages required for navigation

$ roslaunch bwi_launch segbot_bu.launch

If you need to drive the segbot with a controller use the bwi_joystick_teleop package. Double check that the joystick is in X mode and not D mode or it will not work as expected. You can check this by looking at the physical switch on the joystick.

$ roslaunch bwi_joystick_teleop joystick_teleop.launch

Making a map with the segbot

You'll need to turn on the base segway drivers followed by gmapping and rviz.

$ roslaunch segbot_navigation robot_with_gmapping_v3.launch
$ roslaunch bwi_joystick_teleop joystick_teleop.launch

You can see your map being created in real time by selecting the map topic in rviz. When you are done you can save your map with the map_server package.

$ rosrun map_server map_saver -f ~/<map_name>

That will save a map in your selected directory.

Task Planner

Semantic map

To label the map, you can use the logical marker tool:

$ rosrun bwi_planning_common logical_marker _map_data:=~/<map_name> _data_directory:=~/<map_data_directoy>

Current map

Visit doors

You can let the robot navigate between various doors.

$ rosrun bwi_tasks visit_door_list

Special Installation Instructions for Version 4 Robots:

This instruction is not related to our robot.

The V4 bots at AHG use some additional branches of the utexas-bwi repo. To install these, run the following commands from your ~/catkin_ws directory (they will change directories):

$ roscd bwi_common && git fetch && git checkout architecture-update
$ git submodule init
$ git submodule update

$ cd ~/catkin_ws/src && git clone --branch ahg2s_map https://github.com/utexas-bwi/ahg_common.git

Then build everything from the ~/catkin_ws directory:

$ cd ~/catkin_ws
$ catkin build -j6

The V4 base uses slightly different values for some environment variables. It's important to export them into your environment after sourcing the workspace. To automate that, add the convenience function "sws" to the bottom of your .bashrc file found at ~/.bashrc.

sws() {
  source ~/catkin_ws/devel/setup.bash
  export SEGWAY_INTERFACE_ADDRESS=10.66.171.1
  export SEGWAY_IP_ADDRESS=10.66.171.5
  export SEGWAY_IP_PORT_NUM=8080
  export SEGWAY_BASE_PLATFORM=RMP_110
  export SEGWAY_PLATFORM_NAME=RMP_110
}
sws

After building your workspace or packages, instead of using "source devel/setup.bash" , simply call the function above by typing:

$ sws

Next, update pyYAML:

$ pip install -U pyYAML

Then you will need to create a password for postgres. To do so, run the script below and follow the promts to enter a password that is not empty:

$ ./src/bwi_common/knowledge_representation/scripts/configure_postgresql.sh

Finally, run the command prepare_knowledge_bwi_ahg:

$ prepare_knowledge_bwi_ahg

At this point, you should be able to run the BWIbot V4 visit doors demo in Anna Hiss Gym. See the demo instructions in this directory.