interaction.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2014, SRI International
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of Willow Garage nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *********************************************************************/
00034 
00035 /* Author: Acorn Pooley */
00036 
00037 #ifndef MOVEIT_ROBOT_INTERACTION_INTERACTION_
00038 #define MOVEIT_ROBOT_INTERACTION_INTERACTION_
00039 
00040 #include <visualization_msgs/InteractiveMarkerFeedback.h>
00041 #include <visualization_msgs/InteractiveMarker.h>
00042 #include <interactive_markers/menu_handler.h>
00043 #include <moveit/robot_state/robot_state.h>
00044 #include <boost/function.hpp>
00045 #include <boost/thread.hpp>
00046 #include <tf/tf.h>
00047 
00048 namespace moveit
00049 {
00050 namespace core
00051 {
00052 class RobotState;
00053 }
00054 }
00055 
00056 namespace robot_interaction
00057 {
00058 
00059 namespace InteractionStyle
00060 {
00063   enum InteractionStyle
00064   {
00065     POSITION_ARROWS = 1,      // arrows to change position
00066     ORIENTATION_CIRCLES = 2,  // circles to change orientation
00067     POSITION_SPHERE = 4,      // sphere: drag to change position
00068     ORIENTATION_SPHERE = 8,   // sphere: drag to change orientation
00069     POSITION_EEF = 16,        // drag end effector to change position
00070     ORIENTATION_EEF = 32,     // drag end effector to change orientation
00071     FIXED = 64,               // keep arrow and circle axis fixed
00072 
00073     POSITION = POSITION_ARROWS |
00074                POSITION_SPHERE |
00075                POSITION_EEF,
00076     ORIENTATION = ORIENTATION_CIRCLES |
00077                   ORIENTATION_SPHERE |
00078                   ORIENTATION_EEF,
00079     SIX_DOF = POSITION |
00080            ORIENTATION,
00081     SIX_DOF_SPHERE = POSITION_SPHERE |
00082                   ORIENTATION_SPHERE,
00083     POSITION_NOSPHERE = POSITION_ARROWS |
00084                         POSITION_EEF,
00085     ORIENTATION_NOSPHERE = ORIENTATION_CIRCLES |
00086                            ORIENTATION_EEF,
00087     SIX_DOF_NOSPHERE = POSITION_NOSPHERE |
00088                     ORIENTATION_NOSPHERE
00089   };
00090 }
00091 
00099 typedef boost::function<bool(
00100           const robot_state::RobotState& state,
00101           visualization_msgs::InteractiveMarker& marker)>
00102                                                 InteractiveMarkerConstructorFn;
00103 
00115 typedef boost::function<bool(
00116     robot_state::RobotState& state,
00117     const visualization_msgs::InteractiveMarkerFeedbackConstPtr & feedback)>
00118                                                 ProcessFeedbackFn;
00119 
00129 typedef boost::function<bool(
00130           const robot_state::RobotState&,
00131           geometry_msgs::Pose&)>
00132                                                 InteractiveMarkerUpdateFn;
00133 
00136 struct GenericInteraction
00137 {
00138   // Callback to construct interactive marker.
00139   // See comment on typedef above.
00140   InteractiveMarkerConstructorFn construct_marker;
00141 
00142   // Callback to handle interactive marker feedback messages.
00143   // See comment on typedef above.
00144   ProcessFeedbackFn process_feedback;
00145 
00146   // Callback to update marker pose when RobotState changes.
00147   // See comment on typedef above.
00148   InteractiveMarkerUpdateFn update_pose;
00149 
00150   // Suffix added to name of markers.
00151   // Automatically generated.
00152   std::string marker_name_suffix;
00153 };
00154 
00157 struct EndEffectorInteraction
00158 {
00160   std::string parent_group;
00161 
00163   std::string parent_link;
00164 
00166   std::string eef_group;
00167 
00169   InteractionStyle::InteractionStyle interaction;
00170 
00172   double size;
00173 
00174 };
00175 
00178 struct JointInteraction
00179 {
00181   std::string connecting_link;
00182 
00184   std::string parent_frame;
00185 
00187   std::string joint_name;
00188 
00190   unsigned int dof;
00191 
00193   double size;
00194 };
00195 
00196 }
00197 
00198 #endif


robot_interaction
Author(s): Ioan Sucan
autogenerated on Wed Aug 26 2015 12:44:19