door_functions.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2008, Willow Garage, Inc.
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 #ifndef DOOR_FUNCTIONS_H
00036 #define DOOR_FUNCTIONS_H
00037 
00038 #include <door_msgs/Door.h>
00039 #include <door_msgs/DoorCmd.h>
00040 #include <tf/tf.h>
00041 #include <string.h>
00042 #include <kdl/frames.hpp>
00043 
00044 namespace pr2_doors_common{
00045 
00047   tf::Stamped<tf::Pose> getRobotPose(const door_msgs::Door& door, double dist);
00048   tf::Stamped<tf::Pose> getGripperPose(const door_msgs::Door& door, double angle, double dist);
00049   tf::Stamped<tf::Pose> getGripperPose(const door_msgs::Door& door, double angle, double dist, int side);
00050   tf::Stamped<tf::Pose> getHandlePose(const door_msgs::Door& door, int side=1);
00051   double getNearestDoorAngle(const tf::Pose& robot_pose, const door_msgs::Door& door, double robot_dist, double touch_dist);
00052 
00054   double getDoorAngle(const door_msgs::Door& door);
00055   double getVectorAngle(const KDL::Vector& v1, const KDL::Vector& v2);
00056   KDL::Vector getDoorNormal(const door_msgs::Door& door);
00057   KDL::Vector getFrameNormal(const door_msgs::Door& door);
00058   double getFrameAngle(const door_msgs::Door& door);
00059   double getDoorDir(const door_msgs::Door& d);
00060   double getHandleDir(const door_msgs::Door& d);
00061 
00062 
00064     bool transformTo(const tf::Transformer& tf, const std::string& goal_frame, const door_msgs::Door& door_in, 
00065                      door_msgs::Door& door_out, const std::string& fixed_frame="odom_combined");
00066     bool transformPointTo(const tf::Transformer& tf, const std::string& source_frame, const std::string& goal_frame, const ros::Time& time_source,
00067                           const geometry_msgs::Point32& point_in, geometry_msgs::Point32& point_out, const std::string& fixed_frame, const ros::Time& time_goal);
00068     bool transformVectorTo(const tf::Transformer& tf, const std::string& source_frame, const std::string& goal_frame, const ros::Time& time_source,
00069                            const geometry_msgs::Vector3& point_in, geometry_msgs::Vector3& point_out, const std::string& fixed_frame, const ros::Time& time_goal);
00070 
00071     std::ostream& operator<< (std::ostream& os, const door_msgs::Door& d);
00072     std::vector<geometry_msgs::Point> getPolygon(const door_msgs::Door& door, const double &door_thickness);
00073     door_msgs::Door rotateDoor(const door_msgs::Door& door, const double &angle);
00074     geometry_msgs::Point32 getHingeAxisPoint(const door_msgs::Door& door);
00075     geometry_msgs::Point32 getEdgePoint(const door_msgs::Door& door);
00076 
00077 }
00078 #endif


pr2_doors_common
Author(s): Wim Meeussen
autogenerated on Wed Dec 11 2013 14:16:50