当前位置: 首页>>代码示例>>C++>>正文


C++ TrajClient::waitForServer方法代码示例

本文整理汇总了C++中TrajClient::waitForServer方法的典型用法代码示例。如果您正苦于以下问题:C++ TrajClient::waitForServer方法的具体用法?C++ TrajClient::waitForServer怎么用?C++ TrajClient::waitForServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TrajClient的用法示例。


在下文中一共展示了TrajClient::waitForServer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RobotArm

  //! Initialize the action client and wait for action server to come up
  RobotArm() 
  {
    // tell the action client that we want to spin a thread by default
    traj_client_r_ = new TrajClient("r_arm_controller/joint_trajectory_action", true);
    traj_client_l_ = new TrajClient("l_arm_controller/joint_trajectory_action", true);

    // wait for action server to come up
    while(!traj_client_l_->waitForServer(ros::Duration(5.0))){
      ROS_INFO("Waiting for the joint_trajectory_action server");
    }
    // wait for action server to come up
    while(!traj_client_r_->waitForServer(ros::Duration(5.0))){
      ROS_INFO("Waiting for the joint_trajectory_action server");
    }
  }
开发者ID:PR2,项目名称:pr2_props,代码行数:16,代码来源:repeat_high_five.cpp

示例2: IKTrajectoryExecutor

  IKTrajectoryExecutor()
  {

    //tell the joint trajectory action client that we want 
    //to spin a thread by default
    action_client = new TrajClient("joint_trajectory_action", true);

    //wait for the action server to come up
    while(ros::ok() && !action_client->waitForServer(ros::Duration(5.0)))
    {
      ROS_INFO("Waiting for the joint_trajectory_action action server to come up");
    }

    //register a service to input desired Cartesian trajectories
    service = node.advertiseService("execute_cartesian_ik_trajectory", 
        &IKTrajectoryExecutor::execute_cartesian_ik_trajectory, this);

    //have to specify the order of the joints we're sending in our 
    //joint trajectory goal, even if they're already on the param server
    goal.trajectory.joint_names.push_back("shoulder_pan_joint");
    goal.trajectory.joint_names.push_back("shoulder_lift_joint");
    goal.trajectory.joint_names.push_back("elbow_joint");
    goal.trajectory.joint_names.push_back("wrist_1_joint");
    goal.trajectory.joint_names.push_back("wrist_2_joint");
    goal.trajectory.joint_names.push_back("wrist_3_joint");

  }
开发者ID:saszaz,项目名称:boeing-project,代码行数:27,代码来源:ik_trajectory.cpp

示例3: IKTrajectoryExecutor

  IKTrajectoryExecutor(){

    //create a client function for the IK service
    ik_client = node.serviceClient<kinematics_msgs::GetPositionIK>
      (ARM_IK_NAME, true);    

    //wait for the various services to be ready
    ROS_INFO("Waiting for services to be ready");
    ros::service::waitForService(ARM_IK_NAME);
    ROS_INFO("Services ready");

    //tell the joint trajectory action client that we want 
    //to spin a thread by default
    action_client = new TrajClient("l_arm_controller/joint_trajectory_action", true);

    //wait for the action server to come up
    while(ros::ok() && !action_client->waitForServer(ros::Duration(5.0))){
      ROS_INFO("Waiting for the joint_trajectory_action action server to come up");
    }

    //register a service to input desired Cartesian trajectories
    service = node.advertiseService("left_execute_cartesian_ik_trajectory", 
        &IKTrajectoryExecutor::execute_cartesian_ik_trajectory, this);

    //have to specify the order of the joints we're sending in our 
    //joint trajectory goal, even if they're already on the param server
    goal.trajectory.joint_names.push_back("l_shoulder_pan_joint");
    goal.trajectory.joint_names.push_back("l_shoulder_lift_joint");
    goal.trajectory.joint_names.push_back("l_upper_arm_roll_joint");
    goal.trajectory.joint_names.push_back("l_elbow_flex_joint");
    goal.trajectory.joint_names.push_back("l_forearm_roll_joint");
    goal.trajectory.joint_names.push_back("l_wrist_flex_joint");
    goal.trajectory.joint_names.push_back("l_wrist_roll_joint");

  }
开发者ID:ashokzg,项目名称:cpb,代码行数:35,代码来源:left_ik_trajectory_tutorial.cpp

示例4: TrajClient

	// Initialize the action client and wait for the action server to come up
	RobotArm()
	{
		// tell the action client that we want to spin a thread by default
		traj_client_elbow_flex_ = new TrajClient("r_elbow_flex_controller/follow_joint_trajectory", true);
		traj_client_torso_ = new TrajClient("/torso_lift_controller/follow_joint_trajectory", true);
		
		// wait for action server to come up
		while (!traj_client_elbow_flex_->waitForServer(ros::Duration(5.0)))
		{
			ROS_INFO("Waiting for the r_elbow_flex_controller/follow_joint_trajectory server");
		}

		while (!traj_client_torso_->waitForServer(ros::Duration(5.0)))
		{
			ROS_INFO("Waiting for the r_elbow_flex_controller/follow_joint_trajectory server");
		}
		ROS_INFO("Works for now");
	}	
开发者ID:cristiiacob,项目名称:kdl_training,代码行数:19,代码来源:r_arm_test.cpp

示例5: TrajClient

   //! Initialize the action client and wait for action server to come up
	MoveInJoints() 
	{
		// tell the action client that we want to spin a thread by default
		traj_client_ = new TrajClient("/move_iri_wam", true);
		
		// wait for action server to come up
		while(!traj_client_->waitForServer(ros::Duration(5.0))){
		ROS_INFO("Waiting for the move_iri_wam server");
		}
	}
开发者ID:quimnuss,项目名称:ros_iri_wam,代码行数:11,代码来源:move_in_joints.cpp

示例6: RobotArm

        //! Initialize the action client and wait for action server to come up
        RobotArm():srv_name_("/iri_wam/iri_wam_controller/joints_move") {
            client = n.serviceClient<iri_common_drivers_msgs::QueryJointsMovement>(this->srv_name_.c_str());
            // tell the action client that we want to spin a thread by default
            traj_client_ = new TrajClient("/iri_wam/iri_wam_controller/follow_joint_trajectory", true);

            // wait for action server to come up
            while(!traj_client_->waitForServer(ros::Duration(5.0))){
                ROS_INFO("Waiting for the joint_trajectory_action server");
            }
        }
开发者ID:NicolaCovallero,项目名称:promps,代码行数:11,代码来源:test2.cpp

示例7: RobotArm

  //! Initialize the action client and wait for action server to come up
  RobotArm() 
  {
    // tell the action client that we want to spin a thread by default
    traj_client_ = new TrajClient("/wam_wrapper/DMPTracker", true);

    //initialize the topic to send new goals
    
    pub = nh.advertise<trajectory_msgs::JointTrajectoryPoint>("/wam_wrapper/DMPTrackerNewGoal", 1);

    // wait for action server to come up
    while(!traj_client_->waitForServer(ros::Duration(5.0))){
      ROS_INFO("Waiting for the joint_trajectory_action server");
    }
  }
开发者ID:quimnuss,项目名称:ros_iri_wam,代码行数:15,代码来源:dmp_simple_trajectory.cpp

示例8: init

  void init (ros::NodeHandle* nh) {

    ik_client = nh->serviceClient<moveit_msgs::GetPositionIK>
      (ARM_IK_NAME, true);    

    ROS_INFO("Waiting for services to be ready");
    ros::service::waitForService(ARM_IK_NAME);
    ROS_INFO("Services ready");

//    action_client = new TrajClient("joint_trajectory_action", true);
    action_client = new TrajClient("follow_joint_trajectory", true);

    while(ros::ok() && !action_client->waitForServer(ros::Duration(5.0)))
    {
      ROS_INFO("Waiting for the joint_trajectory_action action server to come up");
    }

 //   service = node.advertiseService("execute_cartesian_ik_trajectory", 
 //       &IKTrajectoryExecutor::execute_cartesian_ik_trajectory, this);

    const std::string input_topic = "execute_cartesian_ik_trajectory";

    joint_states_sub = nh->subscribe( "joint_states", 1, 
        &IKTrajectoryExecutor::set_current_joint_angles, this);

    ros::Duration(1.0).sleep();    

    trajectory_sub = nh->subscribe( input_topic, 1, 
        &IKTrajectoryExecutor::execute_cartesian_ik_trajectory, this);

    ros::spinOnce();

    goal.trajectory.joint_names.push_back("shoulder_pan_joint");
    goal.trajectory.joint_names.push_back("shoulder_lift_joint");
    goal.trajectory.joint_names.push_back("elbow_joint");
    goal.trajectory.joint_names.push_back("wrist_1_joint");
    goal.trajectory.joint_names.push_back("wrist_2_joint");
    goal.trajectory.joint_names.push_back("wrist_3_joint");

  }
开发者ID:saszaz,项目名称:boeing-project,代码行数:40,代码来源:service_ik_trajectory.cpp


注:本文中的TrajClient::waitForServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。