Skip to content
Snippets Groups Projects
user avatar
Fabio Navarrete authored
8b52e2aa
History

GarbageBot

Installation

Follow the instructions from the Workstation Setup :

  1. Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
  1. Setup your keys
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
  1. Verify Latest Debians
sudo apt-get update
  1. Install ROS Indigo Desktop Full
sudo apt-get install ros-indigo-desktop-full
  1. Initialize rosdep
sudo rosdep init
rosdep update
  1. Install rosinstall
sudo apt-get install python-rosinstall
  1. Create ROS Workspace
mkdir -p ros/src
  1. Source ROS Setup
source /opt/ros/indigo/setup.bash
  1. Build and Install
cd ros
catkin_make
catkin_make install
  1. Install SDK Dependencies
sudo apt-get update
sudo apt-get install git-core python-argparse python-wstool python-vcstools python-rosdep ros-indigo-control-msgs ros-indigo-joystick-drivers
  1. Install Baxter SDK
cd src
wstool init .
wstool merge https://raw.githubusercontent.com/RethinkRobotics/baxter/master/baxter_sdk.rosinstall
wstool update
  1. Source ROS Setup
source /opt/ros/indigo/setup.bash
  1. Build and Install
cd ..
catkin_make
catkin_make install
  1. Download baxter script
wget https://github.com/RethinkRobotics/baxter/raw/master/baxter.sh
chmod u+x baxter.sh
  1. Simulator Prerequisites
sudo apt-get install gazebo2 ros-indigo-qt-build ros-indigo-driver-common ros-indigo-gazebo-ros-control ros-indigo-gazebo-ros-pkgs ros-indigo-ros-control ros-indigo-control-toolbox ros-indigo-realtime-tools ros-indigo-ros-controllers ros-indigo-xacro python-wstool ros-indigo-tf-conversions ros-indigo-kdl-parser

Follow the instructions from the Simulator installation :

  1. Install baxter_simulator
cd src
wstool init .
wstool merge https://raw.githubusercontent.com/RethinkRobotics/baxter_simulator/master/baxter_simulator.rosinstall
wstool update
  1. Build Source
source /opt/ros/indigo/setup.bash
cd ..
catkin_make

Clone our project :

  1. Clone GarbageBot
cd src
git clone https://github.com/Ardillen66/GarbageBot.git
cd ..
catkin_make

Follow the instructions from the Moveit tutorial :

  1. MoveIt Prerequisites
sudo apt-get install ros-indigo-moveit
sudo apt-get install ros-indigo-moveit-full-pr2
sudo apt-get install ros-indigo-moveit-full
  1. Setup environment
source /opt/ros/indigo/setup.bash
  1. Install MoveIt
cd src
git clone https://github.com/ros-planning/moveit_robots.git
cd ..
catkin_make

Run the environment

Open a terminal in the ROS workspace and connect to the Simulator:

./baxter.sh sim

Every command to interact with the simulator must be in such a shell.

To launch Gazebo with the simulator:

roslaunch baxter_gazebo baxter_world.launch

You should wait until the following message appears:

Gravity compensation was turned off

Enable the robot

The robot must be enabled to be able to move its arms, use its sensors etc. You can either enable the robot directly, by running the following command in the terminal:

rosrun baxter_tools enable_robot.py -e

Or, you can enable it programmatically, by for example running the following python commands:

import baxter_interface
baxter_interface.RobotEnable().enable()

Run an example

Open another simulator shell, and type:

rosrun garbage_bot test.py

This is the same as Running

python src/Garbagebot/src/test/test.py

ROS packages are defined by both package.xml and CMakeLists.txt in our project folder. The python binding is done in setup.py.

Try playing with MoveIt

First of all, you need to enable the robot. Then you need a joint trajectory controller. Open a separate terminal, and run :

rosrun baxter_interface joint_trajectory_action_server.py

You can interact directly with the robot using the Rviz editor. In yet another terminal, run:

roslaunch baxter_moveit_config baxter_grippers.launch

You can move the robot's arms, and click on execute to see the arms move to the desired position.

Programmatically, take a look at the python interface tutorial.

You also need to run the joint_trajectory_action_server. However, with that alone, you get a time_out when running the moveit_robots_test.py code. One way to fix this (I still don't know if its the right way) is to run, in a separate terminal:

rosrun moveit_ros_move_group move_group

If you get an error looking like

Robot semantic description not found. Did you forget to define or remap '/robot_description_semantic'? baxter moveit

try opening MoveIt with Rviz first, then close it and finally run your code. The semantic file is supposed to be created dynamically, but apparently this is only the case for the graphical interface.

If you get a boost error like this:

'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injectorboost::lock_error >'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument

Ignore it for now, your whole script runs anyway and I could not find a fix yet (and btw, just ignore it seems to be the main proposed solution).