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 namespace InteractionStyle
00059 {
00062 enum InteractionStyle
00063 {
00064   POSITION_ARROWS = 1,      // arrows to change position
00065   ORIENTATION_CIRCLES = 2,  // circles to change orientation
00066   POSITION_SPHERE = 4,      // sphere: drag to change position
00067   ORIENTATION_SPHERE = 8,   // sphere: drag to change orientation
00068   POSITION_EEF = 16,        // drag end effector to change position
00069   ORIENTATION_EEF = 32,     // drag end effector to change orientation
00070   FIXED = 64,               // keep arrow and circle axis fixed
00071 
00072   POSITION = POSITION_ARROWS | POSITION_SPHERE | POSITION_EEF,
00073   ORIENTATION = ORIENTATION_CIRCLES | ORIENTATION_SPHERE | ORIENTATION_EEF,
00074   SIX_DOF = POSITION | ORIENTATION,
00075   SIX_DOF_SPHERE = POSITION_SPHERE | ORIENTATION_SPHERE,
00076   POSITION_NOSPHERE = POSITION_ARROWS | POSITION_EEF,
00077   ORIENTATION_NOSPHERE = ORIENTATION_CIRCLES | ORIENTATION_EEF,
00078   SIX_DOF_NOSPHERE = POSITION_NOSPHERE | ORIENTATION_NOSPHERE
00079 };
00080 }
00081 
00089 typedef boost::function<bool(const robot_state::RobotState& state, visualization_msgs::InteractiveMarker& marker)>
00090     InteractiveMarkerConstructorFn;
00091 
00103 typedef boost::function<bool(robot_state::RobotState& state,
00104                              const visualization_msgs::InteractiveMarkerFeedbackConstPtr& feedback)>
00105     ProcessFeedbackFn;
00106 
00116 typedef boost::function<bool(const robot_state::RobotState&, geometry_msgs::Pose&)> InteractiveMarkerUpdateFn;
00117 
00120 struct GenericInteraction
00121 {
00122   // Callback to construct interactive marker.
00123   // See comment on typedef above.
00124   InteractiveMarkerConstructorFn construct_marker;
00125 
00126   // Callback to handle interactive marker feedback messages.
00127   // See comment on typedef above.
00128   ProcessFeedbackFn process_feedback;
00129 
00130   // Callback to update marker pose when RobotState changes.
00131   // See comment on typedef above.
00132   InteractiveMarkerUpdateFn update_pose;
00133 
00134   // Suffix added to name of markers.
00135   // Automatically generated.
00136   std::string marker_name_suffix;
00137 };
00138 
00141 struct EndEffectorInteraction
00142 {
00144   std::string parent_group;
00145 
00147   std::string parent_link;
00148 
00150   std::string eef_group;
00151 
00153   InteractionStyle::InteractionStyle interaction;
00154 
00156   double size;
00157 };
00158 
00161 struct JointInteraction
00162 {
00164   std::string connecting_link;
00165 
00167   std::string parent_frame;
00168 
00170   std::string joint_name;
00171 
00173   unsigned int dof;
00174 
00176   double size;
00177 };
00178 }
00179 
00180 #endif


robot_interaction
Author(s): Ioan Sucan
autogenerated on Mon Jul 24 2017 02:21:55