亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.p

?? 機器人運動控制
?? P
字號:
//
// Simple script that will loop through an array of motions, play each one, and return
//

// let's set up some parameters to the build system

#include "pleo/limits.inc"
#pragma semicolon 1
#pragma tabsize 4
#pragma amxram MAIN_RAM_MAX

// LifeOS includes
#include <Property.inc>
#include <Motion.inc>
#include <Log.inc>
#include <Script.inc>
#include <Sound.inc>
#include <Util.inc>
#include <Sensor.inc>
#include <Joint.inc>

// local includes
#include "motions.inc"
#include "sounds.inc"
#include "user_properties.inc"

new newJointID[] = {
    JOINT_RIGHT_SHOULDER,
    JOINT_LEFT_SHOULDER,
    JOINT_RIGHT_ELBOW,  
    JOINT_LEFT_ELBOW,
	JOINT_HEAD,	
	
	JOINT_TAIL_VERTICAL,

	JOINT_NECK_VERTICAL,
	JOINT_NECK_HORIZONTAL,
    JOINT_LEFT_KNEE,
    JOINT_RIGHT_KNEE,
    JOINT_LEFT_HIP,
    JOINT_RIGHT_HIP,
    JOINT_TORSO,
	JOINT_TAIL_HORIZONTAL,  
    
	  

};


new jointName[50];
new motions[] = 
{
    #include "motions.p"
};


public main()
{
    

	//-----------------------------------------
	//pleo will runing the neutral positon positon 
	//------------------------------------------
	moveJointListNeutral(0,13,4000,128);
	 sound_set_volume(150);
//	   GoStraight();
//	   balanceLeft();
//	   balanceRight();
//	  LeftFront();

//	  RightFront();
  //  SitUp();
     moveJointListNeutral(0,13,4000,128);
 //   while(!sensor_read(SENSOR_ARSE))
//	    {}
 	SitDown2();
	 
	  OpenTar();
//	   while(!sensor_read(SENSOR_ARSE))
//	   {}
	
	 while(1)
	 {
 	 	PickLeg();
	 }
      

	
	
	while(!sensor_read(SENSOR_WAKEUP))
	{}
    // we let it return here. the main routine should be called again
}


OpenTar()
{
	moveJointListNeutral(4,6,2000,128);
	moveJointListMin(4,6,2000,128);   
}
StepByStep()
{

    new index = 0;
    new Motion: handle = 0;
    
    // play all the motions in our array
	
	
    while (index < sizeof motions)
    {
        new motion = motions[index];
        
        while (property_get(property_animation_paused) == true)
        {
        }
        
        // .. and (try to) play it
        handle = motion_play(motion);

        printf("motion -> %d,index= %d\n", motion,index);

        // wait for it.
        while (motion_is_playing(handle))
        {
        }
       sound_play(snd_beep_short);
		while(!sensor_read(SENSOR_WAKEUP))
		{
			if(sensor_read(SENSOR_BACK))
			{
			  index--;
			  break;
			}
		}
		
        index++;
    }
}
wait_for_time(value)
{
	new curTime=time();
	while(time()-curTime<value)
	{
		
	}
}

wait_for_wakeup()
{
	while(!sensor_read(SENSOR_WAKEUP))
	{}
}
LeftFront()
{
	MoveMotion(12,14);
}

RightFront()
{
	MoveMotion(15,17);
}
balanceRight()
{
	MoveMotion(10,11);
}

balanceLeft()
{
	MoveMotion(8,9);
}
SitUp()
{
	monitor_exec("joi neut");
	monitor_exec("joi pwm 12 30");
	monitor_exec("joi pwm 10 30");
	monitor_exec("joi pwm 4 30");
	monitor_exec("joi pwm 6 30");
	monitor_exec("joi pwm 5 30");
	monitor_exec("joi pwm 7 30");
	monitor_exec("joi pwm 0 -30");
	monitor_exec("joi pwm 2 -30");
	wait_for_time(5000);
	
	new i=0;
	while(i<4)
	{
	moveJointListNeutral(4,5,1000,128);
	moveJointListMax(4,5,1000,128);
	i++;
	}
}
GetUp()
{
	printf("Pleo should be get up from lay down position\n");
	MoveMotion(0,0);
}
GoStraight()
{
	printf("Pleo go straight forward.\n");
	//MoveMotion(1,3);
	MoveMotion(2,3);
	moveJointListNeutral(4,6,3000,128);
	new i=0;
	for(i=0;i<4;i++)
	{
		moveJointListNeutral(4,6,1000,128);
		moveJointListMax(4,6,1000,128);
		
	}
}
OpenEye()
{
	printf("Pleo close and open eye\n");
	MoveMotion(4,6);
}

PickLeg()
{
	
	//moveJointListMin(5,6,2000,128);
//	  monitor_exec("joi pwm 12 -30");
//	  moveJointListMin(5,6,2000,128);
//	  monitor_exec("joi pwm 13 -30");
//	  wait_for_time(4000);
	

	monitor_exec("joi angle 12 40");
	sound_stop();
	sound_play(snd_happy_new_year);
	
	new i=0;
	for(i=0;i<10;i++)
	{
		//MoveMotion(7,7);
	//	  wait_for_time(2000);
	moveJointListMax(2,5,1000,128);
	moveJointListMin(2,5,1000,128);
	
	
	}
	
}
SitDown2()
{
//	  sound_play(snd_growlx);
//	  wait_for_sound(snd_growlx);
//	  monitor_exec("joi neut");
	sound_play(snd_howl);
//	  wait_for_sound(snd_howl);
	monitor_exec("joi pwm 12 30");
	monitor_exec("joi pwm 10 30");
	monitor_exec("joi pwm 4 30");
	monitor_exec("joi pwm 6 30");
	monitor_exec("joi pwm 5 30");
	monitor_exec("joi pwm 7 30");
	monitor_exec("joi pwm 0 30");
	monitor_exec("joi pwm 2 30");
   //--
   	monitor_exec("joi pwm 1 30");
	monitor_exec("joi pwm 3 30");
	//--
	
	wait_for_time(5000);
	//

	//--
	monitor_exec("joi pwm 4 0");
	monitor_exec("joi pwm 6 0");
	monitor_exec("joi pwm 5 0");
	monitor_exec("joi pwm 7 0");
	//--
	monitor_exec("joi pwm 12 0");
	monitor_exec("joi pwm 10 0");
//	  monitor_exec("joi pwm 4 0");
//	  monitor_exec("joi pwm 6 0");
//	  monitor_exec("joi pwm 5 0");
//	  monitor_exec("joi pwm 7 0");
	monitor_exec("joi pwm 1 0");
	monitor_exec("joi pwm 3 0");
	
	monitor_exec("joi pwm 0 -30");
	monitor_exec("joi pwm 2 -30");
	monitor_exec("joi pwm 10 30");
	wait_for_time(4000);
	monitor_exec("joi pwm 0 0");
	monitor_exec("joi pwm 2 0");
	monitor_exec("joi pwm 10 0");
	
	//
	monitor_exec("joi neut");
	// modify the sit down position. modify at 2008.01.29 6:00pm
	monitor_exec("joi pwm 4 20");
	monitor_exec("joi pwm 6 20");
	wait_for_time(2000);
	monitor_exec("joi pwm 4 0");
	monitor_exec("joi pwm 6 0");
}
SitDown1()
{

	//---------pleo sit down ------------
	printf("Pleo will sit down.\n");
	
	monitor_exec("joi neut");
	monitor_exec("joi pwm 12 30");
	monitor_exec("joi pwm 10 30");
	monitor_exec("joi pwm 4 30");
	monitor_exec("joi pwm 6 30");
	monitor_exec("joi pwm 5 30");
	monitor_exec("joi pwm 7 30");
	monitor_exec("joi pwm 0 -30");
	monitor_exec("joi pwm 2 -30");
//	  wait_for_time(5000);
	

//	  monitor_exec("joi pwm 1 30");
//	  monitor_exec("joi pwm 3 30");

	wait_for_time(3000);

   monitor_exec("joi neut 0");

	 

	monitor_exec("joi pwm 4 30");
	monitor_exec("joi pwm 6 30");	
	monitor_exec("joi angle 0 90");
	monitor_exec("joi angle 2 90");
	monitor_exec("joi angle 10 60");
	monitor_exec("joi angle 12 30");
	wait_for_time(2000);
	monitor_exec("joi pwm 4 0");
	monitor_exec("joi pwm 6 0");
	monitor_exec("joi pwm 5 0");
	monitor_exec("joi pwm 7 0");		  
	monitor_exec("joi pwm 0 0");
	monitor_exec("joi pwm 2 0");
//	  monitor_exec("joi pwm 4 -30");
//	  monitor_exec("joi pwm 6 -30");

	
//	  monitor_exec("joi angle 10 50");
	// ----pleo end sit down---------	   	   	   
}
SitDown()
{
	//---------pleo sit down ------------
	printf("Pleo will sit down.\n");
	
	monitor_exec("joi neut");
	monitor_exec("joi pwm 12 30");
	monitor_exec("joi pwm 10 30");
	monitor_exec("joi pwm 4 30");
	monitor_exec("joi pwm 6 30");
	monitor_exec("joi pwm 5 30");
	monitor_exec("joi pwm 7 30");
	monitor_exec("joi pwm 0 -30");
	monitor_exec("joi pwm 2 -30");
	wait_for_time(5000);
//	  monitor_exec("joi pwm 1 30");
//	  monitor_exec("joi pwm 3 30");

//	  wait_for_time(3000);
	//wait_for_wakeup();
	monitor_exec("joi neut");
//    monitor_exec("joi neut 0");
//	  monitor_exec("joi neut 1");
//	  monitor_exec("joi neut 2");
//	  monitor_exec("joi neut 3");
	
	wait_for_time(4000);
//	  monitor_exec("joi angle 10 50");
	// ----pleo end sit down---------	   
}


MoveMotion(sIndex,eIndex)
{
new index=sIndex;
 while (index < eIndex)
    {
        new motion = motions[index];
        
        // .. and (try to) play it
        new handle = motion_play(motion);

        printf("motion -> %d,index= %d\n", motion,index);

        // wait for it.
        while (motion_is_playing(handle))
        {
        }	 	 	 
        index++;
    }	 
	yield();  
}
// wait for the joint to finish its movement
waitForJoint(jointid, timeout = 3000)
{
	new start_time = time();
	new joint_stat = joint_get_status(jointid);
    while ( joint_stat != JOINT_STATUS_STOPPED && joint_stat != JOINT_STATUS_STALLED && (time() - start_time < timeout))
	{	
		yield();
		joint_stat = joint_get_status(jointid);
	}	
	printf("\ntime : %d \n",time() - start_time);
	printf("\njoint status : %d \n",joint_stat);
	return joint_get_status(jointid);


}


waitForJoints(sIndex, eIndex, timeout)
{

	new start_time = time();
	new moving = 1;
	
	while (moving) {

		moving = 0;
		for (new mID = sIndex; mID <= eIndex; mID++) {
			new jointid = newJointID[mID];
			if (  joint_get_status(jointid) != JOINT_STATUS_STOPPED && joint_get_status(jointid) != JOINT_STATUS_STALLED && (time() - start_time < timeout) ) {
				moving = 1;
				break;
			}
		}	
		yield();
	}	
	
}


stopJointMovement(jointid, timeout = 1000)
{

	new speed = 128;
	new vrValue = joint_get_position(jointid, angle_vr);
	joint_move_to( jointid, vrValue, speed, angle_vr );
}

// move a list of joints to neutral position 
public moveJointListNeutral(sIndex, eIndex,timeout, speed) {

	new mID;
		
	// move back to neutral point
	 
	for (mID = sIndex; mID <= eIndex; mID++) {
		new neu_degree = joint_get_neutral( newJointID[mID], angle_degrees);
		joint_move_to( newJointID[mID], neu_degree, speed, angle_degrees );
		joint_get_name(newJointID[mID], jointName );
		printf("%s \t - neutral degree:%d \n", jointName, neu_degree);
		//	  waitWakeupButton();
	}
	
	// Edward Chan:  This is a workaround solution as joint status is still not reliable
	//waitForJoints(sIndex, eIndex, target_vr, timeout/2);
	
	 waitForJoints(sIndex, eIndex, timeout);
}

// move a list of joints to maximium position 
public moveJointListMax(sIndex, eIndex,timeout ,speed) {

	new mID;
	
	 	   
	// move back to neutral point
	for (mID = sIndex; mID <= eIndex; mID++) {
		new max_degree = joint_get_max( newJointID[mID], angle_degrees);
		joint_move_to( newJointID[mID], max_degree, speed, angle_degrees );
		joint_get_name(newJointID[mID], jointName );
		printf("%s \t - max degree:%d \n", jointName, max_degree);
	}
	
	// Edward Chan:  This is a workaround solution as joint status is still not reliable
	// waitForJoints(sIndex, eIndex, target_vr, timeout/2);
	
	waitForJoints(sIndex, eIndex, timeout);
}


// move a list of joints to minimium position 
public moveJointListMin(sIndex, eIndex, timeout,speed) {

	new mID;

		
	// move back to neutral point
	for (mID = sIndex; mID <= eIndex; mID++) {
		new min_degree = joint_get_min( newJointID[mID], angle_degrees);
		joint_move_to( newJointID[mID], min_degree, speed, angle_degrees );
		joint_get_name(newJointID[mID], jointName );
		printf("%s \t - min degree:%d \n", jointName, min_degree);
	}
	
	// Edward Chan:  This is a workaround solution as joint status is still not reliable
	// waitForJoints(sIndex, eIndex, target_vr, timeout/2);
	
	waitForJoints(sIndex, eIndex, timeout);
}


// move a list of joints to minimium position 
public printJointListStatus(sIndex, eIndex) {

	new mID;
		
	// move back to neutral point
	for (mID = sIndex; mID <= eIndex; mID++) {
		new status = joint_get_status(newJointID[mID]);
		new vr = joint_get_position(newJointID[mID], angle_vr);
		new degree = joint_get_position(newJointID[mID], angle_degrees);
		joint_get_name(newJointID[mID], jointName );
		printf("%s status is  %d - VR:%d - degree:%d \n", jointName, status, vr, degree);

	}

}
bool: wait_for_sound(sound_name: sound = 0)
//bool: wait_for_sound(Sound: sound = 0)
{
    while (sound_is_playing(sound) == true)
    {
    //	  yield();
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频中午一区| 中文字幕不卡在线观看| 亚洲精品一区二区在线观看| 亚洲日本在线看| 麻豆精品在线播放| 欧美日韩视频在线观看一区二区三区| 国产亚洲精品久| 久久国产精品区| 欧美日韩国产首页| 亚洲精品福利视频网站| 国产大片一区二区| 精品剧情v国产在线观看在线| 亚洲一区二区三区视频在线播放 | 亚洲成精国产精品女| 成人精品国产一区二区4080| xfplay精品久久| 久久精品二区亚洲w码| 欧美男同性恋视频网站| 亚洲免费视频成人| 91亚洲男人天堂| 亚洲欧洲精品一区二区三区不卡| 国模一区二区三区白浆| 欧美成人三级在线| 麻豆久久一区二区| 日韩一区国产二区欧美三区| 丝袜诱惑亚洲看片| 在线观看不卡视频| 亚洲一卡二卡三卡四卡 | 国内久久精品视频| 久久综合色之久久综合| 精品在线一区二区三区| 精品va天堂亚洲国产| 强制捆绑调教一区二区| 777xxx欧美| 久久精品国产免费| 欧美精品一区二区三区高清aⅴ| 免播放器亚洲一区| 精品久久久久久久久久久院品网 | 日韩精品一区二区三区在线 | 亚洲综合色噜噜狠狠| 欧美性猛交xxxx乱大交退制版| 一区二区三区中文在线观看| 欧美性一二三区| 天使萌一区二区三区免费观看| 6080日韩午夜伦伦午夜伦| 日本中文字幕一区| 久久综合99re88久久爱| 国产精品18久久久久久久久| 中文字幕亚洲在| 欧美中文一区二区三区| 日韩高清欧美激情| 久久久精品人体av艺术| 成人免费毛片嘿嘿连载视频| 欧美日韩免费一区二区三区| 美女网站视频久久| 国产亚洲精品精华液| 91丨porny丨首页| 午夜精品爽啪视频| 久久久久久久久久美女| 成人18视频在线播放| 亚洲国产日产av| 精品国产髙清在线看国产毛片| 国产激情视频一区二区三区欧美| 中文字幕一区二区日韩精品绯色| 欧美性色黄大片手机版| 久久www免费人成看片高清| 欧美激情一区二区三区在线| 欧美伊人久久久久久久久影院| 免费看欧美美女黄的网站| 中文字幕国产一区| 91麻豆精品国产自产在线 | 亚洲精品高清视频在线观看| 欧美一区二区三区视频在线| 成人黄色av电影| 美国一区二区三区在线播放| 亚洲欧美日韩国产综合在线| 精品国产一区二区精华| 色av一区二区| 国产乱人伦偷精品视频免下载| 亚洲品质自拍视频网站| 久久久久久日产精品| 欧美四级电影网| 日韩午夜激情av| 色老综合老女人久久久| 国产精品一二一区| 日日夜夜免费精品视频| 亚洲欧美精品午睡沙发| 精品国产乱码久久久久久久| 欧美三级视频在线播放| 99久久亚洲一区二区三区青草| 日韩精品91亚洲二区在线观看| 亚洲欧美区自拍先锋| 久久久久久99精品| 日韩精品一区二区三区swag | 亚洲自拍偷拍麻豆| 国产精品毛片高清在线完整版| 日韩欧美三级在线| 欧美日韩成人一区| 欧美三级在线视频| 在线观看网站黄不卡| 不卡视频在线观看| 成人免费视频视频| 国产乱码精品一区二区三 | 午夜国产精品影院在线观看| 亚洲精品国久久99热| 国产精品成人一区二区三区夜夜夜| 久久久精品免费观看| 日韩欧美一区二区不卡| 欧美一区中文字幕| 91精品国产综合久久国产大片| 欧美日韩一区二区电影| 欧美日韩国产成人在线免费| 91激情五月电影| 欧洲日韩一区二区三区| 欧美视频在线观看一区二区| 欧美性生活影院| 欧美日韩亚洲综合一区二区三区| 欧洲亚洲国产日韩| 欧美精品免费视频| 91精品国产麻豆| 精品国产一区二区三区av性色| 精品国产一区二区三区av性色| 久久久午夜精品理论片中文字幕| 久久精品人人爽人人爽| 国产精品久线观看视频| 亚洲日本成人在线观看| 亚洲欧美一区二区三区极速播放| 亚洲激情中文1区| 亚洲777理论| 日韩精品电影在线| 国产一区999| 99免费精品视频| 久久精品一区蜜桃臀影院| 久久蜜臀精品av| 综合久久国产九一剧情麻豆| 一个色妞综合视频在线观看| 日韩电影在线一区二区三区| 久久99国产精品麻豆| 成人动漫视频在线| 欧美无砖砖区免费| 欧美tk—视频vk| 成人免费在线播放视频| 亚洲超碰精品一区二区| 极品少妇xxxx精品少妇| 成人午夜免费视频| 欧美日韩亚洲综合在线| 欧美精品一区二区三区久久久| 中文字幕一区二区三区在线观看| 亚洲一区二区三区视频在线| 玖玖九九国产精品| 99re6这里只有精品视频在线观看| 欧美日韩亚洲另类| 国产日本欧美一区二区| 亚洲福利视频三区| 国产成人a级片| 欧美精品1区2区3区| 中文字幕精品在线不卡| 视频在线在亚洲| www.性欧美| 精品乱人伦小说| 亚洲一区二区视频在线观看| 国产电影精品久久禁18| 欧美女孩性生活视频| 国产精品国产自产拍高清av | 亚洲免费伊人电影| 国产一区二区三区免费看| 欧美性猛交xxxxxxxx| 国产精品丝袜久久久久久app| 天堂va蜜桃一区二区三区漫画版| av电影在线观看完整版一区二区| 欧美第一区第二区| 同产精品九九九| 日本国产一区二区| 中文字幕电影一区| 国产一区二区三区在线观看免费 | 亚洲大片免费看| caoporn国产精品| 亚洲成人av电影| 91丝袜美女网| 国产精品久久久久影院亚瑟 | 精品蜜桃在线看| 五月婷婷激情综合| 在线国产亚洲欧美| 亚洲色图丝袜美腿| av电影天堂一区二区在线观看| 久久久久久一二三区| 精品综合久久久久久8888| 欧美一级电影网站| 免费在线观看一区二区三区| 欧美日韩国产bt| 亚洲bt欧美bt精品| 欧美日韩不卡在线| 五月婷婷激情综合| 91精品国产综合久久香蕉麻豆 | 寂寞少妇一区二区三区| 日韩一区二区免费高清| 丝袜亚洲另类欧美| 欧美精品日韩一区| 日本大胆欧美人术艺术动态| 8v天堂国产在线一区二区|