コード例 #1
0
GGraph::GGraph(const GBitmap* ref, float scale, float rotation,int mode){
    //cout << "@@@_____scale="<<scale<<endl;
    if (this != ref){
        pack_flag=0;
        
        if(scale!=0&&rotation!=0){
            rotateFast(ref,scale,rotation);
            return;
        }
        if(scale!=0&&mode==0){
            scaleFast(ref,scale);
            return;
        }
        if(scale!=0&&mode==1){
            bicubicScale(ref,scale);
            return;
        }
        if(rotation!=0){
            
            rotateFast(ref,1,rotation);
            return;
        }
        init(ref);
        
    }
    
}//_____________________________________________________________________________
コード例 #2
0
ファイル: friend2.cpp プロジェクト: rfen347/swarm-robotics
// Spin for the number of cycles specified
void spin(int cycles){

	// Infrastructure
	ros::Rate loop_rate(loopRate);
	ros::NodeHandle n;
	geometry_msgs::Twist RobotNode_cmdvel;
	ros::Publisher RobotNode_stage_pub = n.advertise<geometry_msgs::Twist>("robot_11/cmd_vel",1000); 

	rotateFast(); 			// start spinning
	int counter = 0;
		
	while (counter < cycles) {
		counter++;

		// Infrastructure
		RobotNode_cmdvel.linear.x = linear_x;
		RobotNode_cmdvel.angular.z = angular_z;
		RobotNode_stage_pub.publish(RobotNode_cmdvel);
		setOrientation();
		ros::spinOnce();
		loop_rate.sleep();
	}

	stopRotation(); // stop spinning
}