bool UPawnAction_BlueprintBase::Start()
{
	const bool bHasBeenEverStarted = HasBeenStarted();
	const bool bSuperResult = Super::Start();

	if (bHasBeenEverStarted == false && bSuperResult == true)
	{
		ActionStart(GetPawn());
	}

	return bSuperResult;
}
Пример #2
0
/*
 * Here when a button is pressed.
 */
void
do_buttondown(GR_EVENT_BUTTON	*bp)
{
	ActionStart(w, bp->x, bp->y);
}
Пример #3
0
//-----------------------------------------------------------------
int
main(void)
{
	struct timeval t_start,t_end;
	pid_t PID ;
	struct sched_param param;
	int maxpri = sched_get_priority_max(SCHED_FIFO);

	param.sched_priority =maxpri ;
	PID =getpid();
//	sched_setscheduler(PID , SCHED_FIFO ,&param );

	iolib_init();
	iolib_setdir(8,11, BBBIO_DIR_OUT);	// Server motor
	iolib_setdir(8,12, BBBIO_DIR_OUT);
	iolib_setdir(8,15, BBBIO_DIR_OUT);
	iolib_setdir(8,16, BBBIO_DIR_OUT);
	iolib_setdir(8,22, BBBIO_DIR_OUT);
        iolib_setdir(8,23, BBBIO_DIR_OUT);
	BBBIO_sys_Enable_GPIO(BBBIO_GPIO2);

	BBBIO_GPIO_set_dir(BBBIO_GPIO2 ,	// key pad pin
                           BBBIO_GPIO_PIN_12 |BBBIO_GPIO_PIN_10 |BBBIO_GPIO_PIN_8 |BBBIO_GPIO_PIN_6 ,   // input
                           BBBIO_GPIO_PIN_13 |BBBIO_GPIO_PIN_11 |BBBIO_GPIO_PIN_9 |BBBIO_GPIO_PIN_7 );  // output

	int i , j ;
	// recover
        ActionPush(SM_BUTTOM ,90 ,0);
        ActionPush(SM_ARM1 ,90 ,0);
        ActionPush(SM_ARM2 ,110 ,0);
        ActionPush(SM_ARM3 ,150 ,0);
        ActionPush(SM_HAND ,90 ,0);
        ActionStart();

	Angle_Arm_1 =90 ;
	Angle_Arm_2 =110 ;
	Angle_Arm_3 =150;
	Angle_Hand =90 ;
	Angle_Buttom = 90 ;

        //-----------------------------------------
        // create 4x4 scan therad

        pthread_t pid_4x4 ;
        int ret ;
        ret = pthread_create(&pid_4x4, NULL, (void *)Thread_4x4_scan, NULL);

        //-----------------------------------------

	usleep(100000);

	float max_Angle =0 ;


for(j=0 ;j <5 ; j ++)
{
	for(i=0 ; i<7 ;i++)
	{
            ActionPush(SM_BUTTOM ,Action[i][0] ,0);
            ActionPush(SM_ARM1 ,Action[i][1] ,0);
            ActionPush(SM_ARM2 ,Action[i][2] ,0);
            ActionPush(SM_ARM3 ,Action[i][3] ,0);
            ActionPush(SM_HAND ,Action[i][4] ,0);
            ActionStart();
	}
}

/*
	while(key_status[3][3]==1)	//f
	{

	    ActionPush(SM_BUTTOM ,Angle_Buttom ,0);
            ActionPush(SM_ARM1 ,Angle_Arm_1 ,0);
            ActionPush(SM_ARM2 ,Angle_Arm_2 ,0);
            ActionPush(SM_ARM3 ,Angle_Arm_3 ,0);
            ActionPush(SM_HAND ,Angle_Hand ,0);

            ActionStart();
	}
*/
        ActionPush(SM_BUTTOM ,90 ,0);
        ActionPush(SM_ARM1 ,90 ,0);
        ActionPush(SM_ARM2 ,110 ,0);
        ActionPush(SM_ARM3 ,150 ,0);
        ActionPush(SM_HAND ,90 ,0);
        ActionStart();

	//---------------------------

	pthread_join(pid_4x4,NULL);
	printf("Finish\n");

	iolib_free();
	return(0);
}