00001 #include <ros/ros.h> 00002 #include <kinematics_msgs/GetKinematicSolverInfo.h> 00003 int main(int argc, char **argv){ 00004 ros::init (argc, argv, "get_ik_solver_info"); 00005 ros::NodeHandle rh; 00006 ros::service::waitForService("rosie_right_arm_kinematics/get_ik_solver_info"); 00007 ros::ServiceClient query_client = rh.serviceClient<kinematics_msgs::GetKinematicSolverInfo>("rosie_right_arm_kinematics/get_ik_solver_info"); 00008 00009 // define the service messages 00010 kinematics_msgs::GetKinematicSolverInfo::Request request; 00011 kinematics_msgs::GetKinematicSolverInfo::Response response; 00012 00013 if(query_client.call(request,response)) 00014 { 00015 for(unsigned int i=0; i< response.kinematic_solver_info.joint_names.size(); i++) 00016 { 00017 ROS_INFO("Joint: %d %s",i,response.kinematic_solver_info.joint_names[i].c_str()); 00018 } 00019 } 00020 else 00021 { 00022 ROS_ERROR("Could not call query service"); 00023 } 00024 ros::shutdown(); 00025 } 00026 00027