本文整理汇总了C++中spinner函数的典型用法代码示例。如果您正苦于以下问题:C++ spinner函数的具体用法?C++ spinner怎么用?C++ spinner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spinner函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: ROS_INFO
void WebVideoServer::spin()
{
server_->run();
ROS_INFO("Waiting For connections");
ros::MultiThreadedSpinner spinner(ros_threads_);
spinner.spin();
server_->stop();
}
示例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);
}
示例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;
}
}
示例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;
}
示例14: main
int main(int argc, char **argv)
{
ros::init(argc, argv, "trivia_intialized");
ros::NodeHandle node_handle;
ros::AsyncSpinner spinner(1);
spinner.start();
}
示例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;
}