Note: This tutorial assumes that you have completed the previous tutorials: How to use ROSARIA. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
iPhone Teleop With ROSARIA
Description:Keywords: BeginnerCategory
Tutorial Level:
Contents
Note, teleop_base was deprecated in ROS electric, so it cannot be used in Fuerte or later.
Robot teleoperation using teleop_base
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 in Electric, Fuerte or any later version.
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: