00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2012, Southwest Research Institute 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 are met: 00009 * 00010 * * Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * * Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * * Neither the name of the Southwest Research Institute, nor the names 00016 * of its contributors may be used to endorse or promote products derived 00017 * from this software without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00020 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00022 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00023 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00024 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00025 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00026 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00027 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00029 * POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00032 #include "ros/ros.h" 00033 #include "kinematics_msgs/GetPositionIK.h" 00034 #include "geometry_msgs/PoseStamped.h" 00035 /* 00036 # Service Client(s) 00037 from kinematics_msgs.srv import GetPositionIK 00038 from kinematics_msgs.msg import PositionIKRequest 00039 from kinematics_msgs.srv import GetKinematicSolverInfo 00040 from kinematics_msgs.msg import KinematicSolverInfo 00041 from arm_navigation_msgs.msg import RobotState, ArmNavigationErrorCodes 00042 from arm_navigation_msgs.srv import GetRobotState 00043 00044 # Generic message structures 00045 from geometry_msgs.msg import PoseStamped 00046 */ 00047 00048 double const PI = 3.14159; 00049 00050 double const trans_min = -2.0; 00051 double const trans_max = 2.0; 00052 double const trans_incr = 0.1; 00053 00054 double const x_min = trans_min; 00055 double const x_max = trans_max; 00056 double const y_min = trans_min; 00057 double const y_max = trans_max; 00058 double const z_min = trans_min; 00059 const double z_max = trans_max; 00060 00061 00062 const double orient_min = -PI; 00063 const double orient_max = PI; 00064 const double orient_incr = 0.1; 00065 00066 const double roll_min = orient_min; 00067 const double roll_max = orient_max; 00068 const double pitch_min = orient_min; 00069 const double pitch_max = orient_max; 00070 const double yaw_min = orient_min; 00071 const double yaw_max = orient_max; 00072 00073 using namespace geometry_msgs; 00074 00075 00076 void evaluate_workspace() 00077 { 00078 JointTrajPtMessage jMsg; 00079 SimpleMessage msg; 00080 SimpleMessage reply; 00081 00082 ROS_INFO("Joint trajectory downloader: entering stopping state"); 00083 jMsg.point_.setSequence(SpecialSeqValues::STOP_TRAJECTORY); 00084 jMsg.toRequest(msg); 00085 ROS_DEBUG("Sending stop command"); 00086 this->robot_->sendAndReceiveMsg(msg, reply); 00087 ROS_DEBUG("Stop command sent"); 00088 } 00089 00090 void get_ik(PoseStamped & pose) 00091 { 00092 00093 } 00094 00095 void get_robot_state() 00096 { 00097 00098 } 00099 00100 int main(int argc, char** argv) 00101 { 00102 const unsigned int IP_ARG_IDX = 1; 00103 ros::init(argc, argv, "joint_trajectory_handler"); 00104 00105 if(argc != 1) //Only one argument, the robot IP address is accepted 00106 { 00107 ROS_INFO("Motion download interface connecting to IP address: %s", argv[IP_ARG_IDX]); 00108 industrial::tcp_client::TcpClient robot; 00109 ros::NodeHandle node; 00110 00111 robot.init(argv[IP_ARG_IDX], StandardSocketPorts::MOTION); 00112 motoman::joint_trajectory_downloader::JointTrajectoryDownloader jtHandler(node, &robot); 00113 00114 ros::spin(); 00115 } 00116 else 00117 { 00118 ROS_ERROR("Missing command line arguments, usage: motion_download_interface <robot ip address>"); 00119 } 00120 00121 return 0; 00122 } 00123