How to use ROSARIA with ActivMedia/MobileRobots/Adept robots

Description: This tutorial describes how to get started using ROSARIA with ActivMedia/MobileRobots/Adept robots (supported with Aria library). Using an iPhone's inertial sensing like a joystick to drive the robot is demonstrated.

Keywords: Aria, Pioneer, ActivMedia, MobileRobots, Adept

Tutorial Level: BEGINNER

Getting ROSARIA

A rosinstall file, covering all the dependencies for running this tutorial follows (pioneer-joy-iphone.rosinstall):

 - hg:
     uri: https://amor-ros-pkg.googlecode.com/hg/
     local-name: pioneer/amor-ros-pkg
 - svn:
     local-name: pioneer/joy
     uri: https://code.ros.org/svn/ros-pkg/stacks/joystick_drivers/trunk/joy
 - svn:
     local-name: pioneer/joystick_remapper
     uri: http://ua-ros-pkg.googlecode.com/svn/trunk/arrg/ua_drivers/joystick_remapper
 - svn:
     local-name: pioneer/teleop_base 
     uri: https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/teleop_base
 - svn:
     local-name: pioneer/control_toolbox
     uri: https://code.ros.org/svn/wg-ros-pkg/stacks/pr2_controllers/branches/pr2_controllers-1.4/control_toolbox

Note that individual dependencies are discussed below, and may have different local-names.

ROSARIA resides in the amor-ros-pkg source code repository at Google Code, using Mercurial for version control. The URI for this repository is https://amor-ros-pkg.googlecode.com/hg/ and may be cloned (copied or forked) with the following Mercurial (hg) command:

I usually use rosinstall to get additional repositories, so here is amor-ros-pkg.rosinstall file:

- hg:
    uri: https://amor-ros-pkg.googlecode.com/hg/
    local-name: amor-ros-pkg

Same can be obtained using roslocate:

$ roslocate rosinstall ROSARIA
- hg: {local-name: amor-ros-pkg, uri: 'https://amor-ros-pkg.googlecode.com/hg/'}

When installing other repositories, I prefer having them on top of recommended ROS version (Desktop-Full diamondback at the time of writing this tutorial). Since I have diamondback in ~/Code/ros/diamondback I use rosinstall as follows:

$ rosinstall ~/Code/ros/repos-diamondback ~/Code/ros/diamondback http://amor-ros-pkg.googlecode.com/files/amor-ros-pkg.rosinstall

After getting packages, compile them:

$ rosmake ROSARIA

Robot teleoperation

ROSARIA listens for geometry_msgs/Twist messages at cmd_vel topic. teleop_base produces that type of robot controlling messages from keyboard or joystick input. We'll use teleop_base in this tutorial (resides in wg-ros-pkg), so we'll need to install it.

Getting teleop_base

Warning: This Section is Deprecated for Electric

teleop_base is deprecated in ROS Electric, this won't work.

teleop_base needs additional package from wg-ros-pkg, control_toolbox, and one form ros-pkg, joy. Here is a convenient wg_teleop.rosinstall file:

- svn:
    local-name: wg-ros-pkg/sandbox/teleop_base
    uri: https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/teleop_base
- svn:
    local-name: wg-ros-pkg/pr2_controllers/control_toolbox
    uri: https://code.ros.org/svn/wg-ros-pkg/stacks/pr2_controllers/branches/pr2_controllers-1.4/control_toolbox
- svn:
    local-name: ros-pkg/joystick_drivers/joy
    uri: https://code.ros.org/svn/ros-pkg/stacks/joystick_drivers/trunk/joy

From here, we simply add those packages to our repos-diamondback:

$ rosinstall ~/Code/ros/repos-diamondback wg_teleop.rosinstall

And then compile them:

$ rosmake teleop_base

Putting it all together

We prepared pioneer-joystick.launch file.

<launch>
  <node name="RosAria" pkg="ROSARIA" type="RosAria">
    <param name="port" value="/dev/ttyUSB0" />
  </node>
  <group ns="RosAria">
    <node name="RumblePad2" pkg="joy" type="joy_node">
      <remap from="joy" to="rumblepad" />
      <param name="dev" type="str" value="/dev/input/js2" />
    </node>
    <node pkg="joystick_remapper" type="joystick_remapper.py" name="logitech_to_ps3" >
      <remap from="joy_source" to="rumblepad" />
      <remap from="joy_dest" to="joy" />
      <param name="button_mapping" type="str" value="=" />
      <param name="axis_mapping" type="str" value="0 3 2 1 4 5" />
    </node>
    <node name="teleop_base" pkg="teleop_base" type="teleop_base" />
  </group>
</launch>

This rosaunch file is tailored for Logitech RumblePad2 and, in addition to above mentioned, also uses joystick_remapper package:

- svn:
    local-name: ua_drivers/joystick_remapper
    uri: http://ua-ros-pkg.googlecode.com/svn/trunk/arrg/ua_drivers/joystick_remapper

If you don't have RumblePad2 or don't need the remapping, simply delete that part of the launch file, and remove remapping from joy_node and launch.

$ roslaunch pioneer-joystick.launch

Using iPhone/iPad as a joystick

Approach described here uses accelerometer-simulator. Having accelerometer-simulator installed and running (sending data to your ROS machine) on your iOS device, you need to run pyoj node. Here is a convenient pioneer-iPhone.launch file.

<launch>
  <node name="RosAria" pkg="ROSARIA" type="RosAria">
    <param name="port" value="/dev/ttyS0" />
  </node>
  <group ns="RosAria">
    <node name="iPhone" pkg="pyoj" type="pyoj.py" />
    <node name="teleop_base" pkg="teleop_base" type="teleop_base" />
  </group>
</launch>

A demo is shown in the following YouTube video:

Wiki: ROSARIA/Tutorials/How to use ROSARIA (last edited 2012-03-27 08:16:44 by SreckoJuricKavelj)