• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ spinner函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中spinner函数的典型用法代码示例。如果您正苦于以下问题:C++ spinner函数的具体用法?C++ spinner怎么用?C++ spinner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: main

int main(int argc, char** argv)
{
  ros::init(argc, argv, "SHORT_NAME");
  ROS_INFO_STREAM_NAMED("main", "Starting CLASS_NAME...");

  // Allow the action server to recieve and send ros messages
  ros::AsyncSpinner spinner(2);
  spinner.start();

  // Check for verbose flag
  bool verbose = false;
  if (argc > 1)
  {
    for (int i = 0; i < argc; ++i)
    {
      if (strcmp(argv[i], "--verbose") == 0)
      {
        ROS_INFO_STREAM_NAMED("main","Running in VERBOSE mode (slower)");
        verbose = true;
        continue;
      }
    }
  }

  PACKAGE_NAME::CLASS_NAME server();

  ROS_INFO_STREAM_NAMED("main", "Shutting down.");
  ros::shutdown();

  return 0;
}
开发者ID:davetcoleman,项目名称:unix_settings,代码行数:31,代码来源:ros.cpp


示例2: main

int main(int argc, char **argv)
{
  ros::init(argc, argv, PLANNER_NODE_NAME);
  
  bool debug = false;
  for (int i = 1 ; i < argc ; ++i)
    if (strncmp(argv[i], "--debug", 7) == 0)
      debug = true;
  
  ros::AsyncSpinner spinner(1);
  spinner.start();
  
  boost::shared_ptr<tf::TransformListener> tf(new tf::TransformListener());
  planning_scene_monitor::PlanningSceneMonitor psm(ROBOT_DESCRIPTION, tf);
  if (psm.getPlanningScene())
  {
    psm.startWorldGeometryMonitor();
    psm.startSceneMonitor();
    psm.startStateMonitor();
    
    OMPLPlannerService pservice(psm, debug);
    pservice.status();
    ros::waitForShutdown();
  }
  else
    ROS_ERROR("Planning scene not configured");  
  
  return 0;
}
开发者ID:ngtienthanh,项目名称:crops-moveit,代码行数:29,代码来源:ompl_planner.cpp


示例3: main

int main(int argc, char** argv)
{
  // Init the ROS node
  ros::init(argc, argv, "omnirob_robin_lwa_interface");

  ros::NodeHandle n;
  ros::Rate loop_rate(100);	// 100 Hz => consistent to sampleTime
  ros::AsyncSpinner spinner(4); // Use 4 threads

  //MyRobot omniRob;
  controller_manager::ControllerManager cm(&omniRob);
  ros::Duration sampleTime(0.01);
  ros::Publisher trajectoryPoint_pub = n.advertise<std_msgs::Float64MultiArray>("lwa/control/commanded_joint_state", 1000);
  ros::Subscriber jointState_sub = n.subscribe("lwa/state/joint_state", 1000, jointState_callback);

  std_msgs::Float64MultiArray trajPoint;

  spinner.start();

  while (ros::ok())
  {
     //omniRob.read();  // automated subscription
     cm.update(ros::Time::now(), sampleTime);
     omniRob.write(trajectoryPoint_pub, trajPoint);
     ROS_INFO("omnirob LWA3 OK...");

     //ros::spinOnce();
     //ros::waitForShutdown();
     loop_rate.sleep();
     //spinner.stop();
  }
  return 0;
}
开发者ID:tschoiss,项目名称:omnirob_robin,代码行数:33,代码来源:omnirob_robin_lwa_interface.cpp


示例4: main

int main(int argc, char *argv[])
{
  
  mainWorkspace.clear(); 
  std::cout << "Inhaler GUI Version: " << VERSION_NUMBER << " started." << std::endl;
 ros::init (argc, argv, "inhaler_gui_server");
    QApplication app(argc, argv);
    MyWidget widget;
    
    Line l(100,100,210,200);
    lines.push_back (l);
    //ROS subscribing
    ros::NodeHandle n;
    
    ros::Subscriber lineSub = n.subscribe ("inhalerGUI_Line",1000,addLine);
    ros::Subscriber textSub = n.subscribe ("inhalerGUI_Text",1000,addText);
    ros::Subscriber clearSub = n.subscribe ("inhalerGUI_Clear",1000,clearGUI);
    
    
    widget.show();
    
    ros::AsyncSpinner spinner(4); // Use 4 threads
    spinner.start();
    //ros::waitForShutdown();
    app.exec();
    //app.exec();
    
    return 0;
}
开发者ID:90301,项目名称:inhaler_gui,代码行数:29,代码来源:inhaler_gui.cpp


示例5: main

int main(int argc, char **argv)
{
    ros::init (argc, argv, "hsmakata_pick_n_place_demo");
    ros::NodeHandle nh;

    ros::Publisher display_publisher = nh.advertise<moveit_msgs::DisplayTrajectory>("/move_group/display_planned_path", 1, true);

    ros::AsyncSpinner spinner(1);
    spinner.start();

    pub_co = nh.advertise<moveit_msgs::CollisionObject>("collision_object", 10);
    pub_aco = nh.advertise<moveit_msgs::AttachedCollisionObject>("attached_collision_object", 10);
    grasps_marker = nh.advertise<visualization_msgs::MarkerArray>("grasps_marker", 10);

    sub_point = nh.subscribe<visualization_msgs::Marker>("cup_center",1,cb_points);

    moveit::planning_interface::MoveGroup gripper("gripper");
    gripper.setNamedTarget("closed");
    gripper.move();

    moveit::planning_interface::MoveGroup katana("manipulator");
    katana.setNamedTarget("home");
    katana.move();


    ros::spin();


}
开发者ID:informatik-mannheim,项目名称:ros-hydro-hsmakata,代码行数:29,代码来源:hsmakata_pick_n_place.cpp


示例6: main

int main(int argc, char **argv) {
    ros::init (argc, argv, "left_arm_pick_place");
    ros::AsyncSpinner spinner(1);
    spinner.start();


    ros::NodeHandle nh;


    ros::Publisher pub_co = nh.advertise<moveit_msgs::CollisionObject>("collision_object", 10);

    ros::WallDuration(10.0).sleep();


    // moveit::planning_interface::MoveGroup armgroup = group;

    // addCollisionObjects(pub_co);

    // wait a bit for ros things to initialize
    // ros::WallDuration(1.0).sleep();
    // ROS_INFO("I should plan now");
    // pick(group);
    // ROS_INFO("planned");
    //
    positionService = nh.advertiseService("armPosition", &setPosition);

    ros::spin();
    return 0;
    }
开发者ID:GijsWeterings,项目名称:Fedar,代码行数:29,代码来源:arm_pick_place.cpp


示例7: main

int main(int argc, char** argv) {

	MoveKuka kukaObj;

  kukaObj.q.resize(5);
  kukaObj.qArmPosition.resize(5);
  kukaObj.qArmHome.resize(5);
  kukaObj.gripperJointPositions.resize(2);

  kukaObj.gripperJointPositions[0].joint_uri = "gripper_finger_joint_l";
  kukaObj.gripperJointPositions[0].unit = boost::units::to_string(boost::units::si::meters);
        
  kukaObj.gripperJointPositions[1].joint_uri = "gripper_finger_joint_r";
  kukaObj.gripperJointPositions[1].unit = boost::units::to_string(boost::units::si::meters);

  ros::init(argc, argv, "mahni");
  ros::NodeHandle nh;
  ros::Subscriber subArmActionResult = nh.subscribe("arm_1/arm_controller/follow_joint_trajectory/result", 1000, &MoveKuka::ArmResultListener, &kukaObj);
  ros::Subscriber subJointStates = nh.subscribe("joint_states", 1000, &MoveKuka::UpdateRobotPose, &kukaObj);
  
  kukaObj.armTrajectoryPublisher = nh.advertise< control_msgs::FollowJointTrajectoryActionGoal > ("arm_1/arm_controller/follow_joint_trajectory/goal",1);

  kukaObj.gripperPositionPublisher = nh.advertise< brics_actuator::JointPositions > ("arm_1/gripper_controller/position_command", 1);

  ros::ServiceServer serviceGoHome  = nh.advertiseService("move", &MoveKuka::Move, &kukaObj);
  ros::ServiceServer serviceGoRight = nh.advertiseService("go_home", &MoveKuka::GoHome, &kukaObj);
  
	ros::ServiceServer serviceOpenGripper  = nh.advertiseService("open_gripper", &MoveKuka::OpenGripper, &kukaObj);
  ros::ServiceServer serviceCloseGripper = nh.advertiseService("close_gripper", &MoveKuka::CloseGripper, &kukaObj);

  ros::MultiThreadedSpinner spinner(4); // Use 4 threads
  spinner.spin(); // spin() will not return until the node has been shutdown

  return 0;
}
开发者ID:mshayganfar,项目名称:AppraisalGoalManagement,代码行数:35,代码来源:main.cpp


示例8: main

int main(int argc, char** argv)
{
	// init node
	ros::init(argc, argv, "light_controller", ros::init_options::NoSigintHandler);
	signal(SIGINT, sigIntHandler);

	// Override XMLRPC shutdown
	ros::XMLRPCManager::instance()->unbind("shutdown");
	ros::XMLRPCManager::instance()->bind("shutdown", shutdownCallback);

	// create LightControl instance
	LightControl *lightControl = new LightControl();

	ros::AsyncSpinner spinner(1);
  	spinner.start();

  	while (!gShutdownRequest)
  	{
		ros::WallDuration(0.05).sleep();
	}

  	delete lightControl;

  	ros::shutdown();

	return 0;
}
开发者ID:ipa-josh,项目名称:cob_driver,代码行数:27,代码来源:cob_light.cpp


示例9: main

int main(int argc, char **argv) {
	int speed, n, ifd, ofd;
	struct termios term;
	char buf[BUFSIZ];
	struct timespec delay;

	if (argc != 4){
		fprintf(stderr, "usage: binlog <speed> <port> <logfile>\n");
		return 1;
	}

	speed = atoi(argv[1]);
	switch (speed) {
	case 230400:
	case 115200:
	case 57600:
	case 38400:
	case 28800:
	case 19200:
	case 14400:
	case 9600:
	case 4800:
		break;
	default:
		fprintf(stderr, "invalid speed\n");
		return 1;
	}

	if ((ifd = open(argv[2], O_RDWR | O_NONBLOCK | O_NOCTTY, 0644)) == -1)
		err(1, "open");

	if ((ofd = open(argv[3], O_RDWR | O_CREAT | O_APPEND, 0644)) == -1)
		err(1, "open");

	tcgetattr(ifd, &term);
	cfmakeraw(&term);
	cfsetospeed(&term, speed);
	cfsetispeed(&term, speed);
	if (tcsetattr(ifd, TCSANOW | TCSAFLUSH, &term) == -1)
		err(1, "tcsetattr");

	tcflush(ifd, TCIOFLUSH);
	n = 0;
	while (1){
		int l = read(ifd, buf, BUFSIZ);
		if (l > 0)
		    assert(write(ofd, buf, l) > 0);
		/* wait 1,000 uSec */
		delay.tv_sec = 0;
		delay.tv_nsec = 1000000L;
		nanosleep(&delay, NULL);
		memset(buf, 0, BUFSIZ);
		spinner( n++ );
	}
	/* NOTREACHED */
	close(ifd);
	close(ofd);
	return 0;
}
开发者ID:fhgwright,项目名称:gpsd,代码行数:59,代码来源:binlog.c


示例10: ROS_INFO

void WebVideoServer::spin()
{
  server_->run();
  ROS_INFO("Waiting For connections");
  ros::MultiThreadedSpinner spinner(ros_threads_);
  spinner.spin();
  server_->stop();
}
开发者ID:Intermodalics,项目名称:web_video_server,代码行数:8,代码来源:web_video_server.cpp


示例11: main

/* ---[ */
int main (int argc, char* argv[])
{
  ros::init(argc, argv, "haptics_node");
  HapticNode haptics(argv);
  ros::MultiThreadedSpinner spinner(3); // Use 4 threads
  spinner.spin();

  return (0);
}
开发者ID:ChellaVignesh,项目名称:ros_haptics,代码行数:10,代码来源:main.cpp


示例12: t_animate_step

/******
 * Animation callback - called 25 times per second by Usplash 
 * 
 * Param:	struct usplash_theme* theme	- theme being used 
 * 			int pulsating - boolean int
 */
void t_animate_step(struct usplash_theme* theme, int pulsating) {
	current_count = current_count + 1;
	
	// increase test int for slower spinning
	if(current_count == spinner_speed) {
		spinner(theme);
		current_count = 0;	
	}
}
开发者ID:Bobbin007,项目名称:xbmc,代码行数:15,代码来源:xbmc-splash.c


示例13: main

 int main(int argc, char **argv)
 {
   ros::init (argc, argv, "ar_viz_servo");
   ros::AsyncSpinner spinner(1);
   spinner.start();
   VisualServo vizual_servo;
   ros::shutdown();
   return 0;
 }
开发者ID:ktiwari9,项目名称:baxter_barcode_pickup,代码行数:9,代码来源:ar_viz_servo.cpp


示例14: main

int main(int argc, char **argv)
{

  ros::init(argc, argv, "trivia_intialized");
  ros::NodeHandle node_handle;
  ros::AsyncSpinner spinner(1);
  spinner.start();

}
开发者ID:zl87,项目名称:tangy_legacy,代码行数:9,代码来源:trivia_database.cpp


示例15: main

int main(int argc, char** argv){
  thread thr_check(&check);
  ros::init(argc, argv, "speech_recog");
  SpeechRecog SRObject;
  ros::MultiThreadedSpinner spinner(3); // Use 3 threads
  spinner.spin(); 
  //ros::spin();
  return 0;
}
开发者ID:chinjao,项目名称:ros_src,代码行数:9,代码来源:main.cpp


示例16: main

int main(int argc, char** argv)
{
	ros::init(argc, argv, "product_manager");
	ros::NodeHandle node;
	ros::AsyncSpinner spinner(1);
	spinner.start();
	ProductManager productManager(node);
	productManager.run();
	return 0;
}
开发者ID:NilFurquim,项目名称:Collect-Deliver-SoS,代码行数:10,代码来源:product_manager.cpp


示例17: main

int main(int argc, char **argv)
{
  testing::InitGoogleTest(&argc, argv);

  ros::init(argc, argv, "test_ompl_planning", ros::init_options::AnonymousName);
  ros::AsyncSpinner spinner(1);
  spinner.start();

  return RUN_ALL_TESTS();
}
开发者ID:TheDash,项目名称:moveit_pr2,代码行数:10,代码来源:test_path_constrained_plan.cpp


示例18: main

int main(int argc, char **argv)
{
	ros::init (argc, argv, "move_group_tutorial");
	ros::NodeHandle node_handle("~");
	ros::AsyncSpinner spinner(1);
	spinner.start();

	sleep(20.0);

	moveit::planning_interface::MoveGroup group("arm");

	moveit::planning_interface::PlanningSceneInterface planning_scene_interface; 

	ros::Publisher display_publisher = node_handle.advertise<moveit_msgs::DisplayTrajectory>("/move_group/display_planned_path", 1, true);
	moveit_msgs::DisplayTrajectory display_trajectory;

	ROS_INFO("Reference frame: %s", group.getPlanningFrame().c_str());

	ROS_INFO("Reference frame: %s", group.getEndEffectorLink().c_str());

	geometry_msgs::PoseStamped target_pose1;
	
	target_pose1.header.frame_id = "odom";
	target_pose1.pose.position.x = 0.128518;
	target_pose1.pose.position.y = -0.132719;
	target_pose1.pose.position.z = 0.321876;
	target_pose1.pose.orientation.w = 0.0125898;
	target_pose1.pose.orientation.x = 0.184773;
	target_pose1.pose.orientation.y = -0.980428;
	target_pose1.pose.orientation.z = -0.0667877;
		
	group.setPoseTarget(target_pose1);

	moveit::planning_interface::MoveGroup::Plan my_plan;
	bool success = group.plan(my_plan);

	ROS_INFO("Visualizing plan 1 (pose goal) %s",success?"":"FAILED"); 

	sleep(5.0);

	if (1)
	{
		ROS_INFO("Visualizing plan 1 (again)");
		display_trajectory.trajectory_start = my_plan.start_state_;
		display_trajectory.trajectory.push_back(my_plan.trajectory_);
		display_publisher.publish(display_trajectory);
		/* Sleep to give Rviz time to visualize the plan. */
		sleep(5.0);
	}

	ros::shutdown();
	return 0;

	return 0;
}
开发者ID:MauleshSTrivedi,项目名称:phantomx_arm,代码行数:55,代码来源:motionPlan.cpp


示例19: main

int main( int argc, char** argv ) {
  // initialize ROS
  ros::init(argc, argv, "iiwa_hw", ros::init_options::NoSigintHandler);
  
  // ros spinner
  ros::AsyncSpinner spinner(1);
  spinner.start();
  
  // custom signal handlers
  signal(SIGTERM, quitRequested);
  signal(SIGINT, quitRequested);
  signal(SIGHUP, quitRequested);
  
  // construct the lbr iiwa
  ros::NodeHandle iiwa_nh;
  IIWA_HW iiwa_robot(iiwa_nh);
  
  // configuration routines
  iiwa_robot.start();
  
  ros::Time last(ros::Time::now());
  ros::Time now;
  ros::Duration period(1.0);
  
  //the controller manager
  controller_manager::ControllerManager manager(&iiwa_robot, iiwa_nh);
  
  // run as fast as possible
  while( !g_quit ) {
    
    // get the time / period
    now = ros::Time::now();
    period = now - last;
    last = now;
    
    // read current robot position
    iiwa_robot.read(period);
    
    // update the controllers
    manager.update(now, period);
    
    // send command position to the robot
    iiwa_robot.write(period);
    
    // wait for some milliseconds defined in controlFrequency
    iiwa_robot.getRate()->sleep();
  }
  
  std::cerr << "Stopping spinner..." << std::endl;
  spinner.stop();
  
  std::cerr << "Bye!" << std::endl;
  
  return 0;
}
开发者ID:cpaxton,项目名称:iiwa_stack,代码行数:55,代码来源:main.cpp


示例20: main

int main(int argc, char **argv)
{
	ros::init(argc, argv, "lift_torso");

	ros::NodeHandle nh;
	ros::AsyncSpinner spinner(1);
	spinner.start();

	double position;
	if (argc != 2)
	{
		ROS_ERROR("Usage: rosrun control_robot lift_torso <torso_position>");
		return 1;
	}
	position = atof(argv[1]);
	ROS_INFO("Set torso position to %lf", position);

	moveit::planning_interface::MoveGroup torso_group("torso");
	std::vector<std::string> torso_joints = torso_group.getJoints();
	ROS_ASSERT(torso_joints.size() > 0);
	if (!torso_group.setJointValueTarget(torso_joints[0], position))
	{
		ROS_ERROR("Position out of bounds - not moving torso");
		return 1;
	}
	moveit::planning_interface::MoveItErrorCode error_code;
	ROS_INFO("Lifting torso...");
	error_code = torso_group.move();
	ros::shutdown();
	return error_code == moveit::planning_interface::MoveItErrorCode::SUCCESS;

//	//ros::ServiceClient torso_client = nh.serviceClient<control_robot_msgs::MoveIt>("/control_robot/torso_lift_max");
//	ros::ServiceClient torso_client = nh.serviceClient<control_robot_msgs::MoveItPosition>("/control_robot/torso_lift");
//	control_robot_msgs::MoveItPosition srv;
//	srv.request.position.data = position;
//
//	ROS_INFO("Wait for existence of service: %s", torso_client.getService().c_str());
//	torso_client.waitForExistence();
//
//	if (!torso_client.exists())
//		ROS_ERROR("Client %s does not exist.", torso_client.getService().c_str());
//
//	ROS_INFO("Lifting torso...");
//
//	if (!torso_client.call(srv))
//	{
//		ROS_ERROR("Could not send service message to client: %s", torso_client.getService().c_str());
//		return 1;
//	}
//	ROS_INFO("Service call for torso was successful.");

//	ros::shutdown();
//	return 0;

}
开发者ID:GKIFreiburg,项目名称:pr2_tidyup,代码行数:55,代码来源:lift_torso.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ spiwrite函数代码示例发布时间:2022-05-30
下一篇:
C++ spinlock_release函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap