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

Java Pose类代码示例

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

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



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

示例1: reset

import com.thalmic.myo.Pose; //导入依赖的package包/类
public void reset()
{
	onArm = false;
	whichArm = Arm.UNKNOWN;
	currentPose = Pose.UNKNOWN;

	accelerationX = 0;
	accelerationY = 0;
	accelerationZ = 0;

       orientationX = 0;
       orientationY = 0;
       orientationZ = 0;
       orientationW = 0;

       rollW = 0;
       yawW = 0;
       pitchW = 0;

	Arrays.fill(emg, 0);
}
 
开发者ID:hcmlab,项目名称:ssj,代码行数:22,代码来源:MyoListener.java


示例2: MyoThalmic

import com.thalmic.myo.Pose; //导入依赖的package包/类
public MyoThalmic(String n) {
	super(n);

	pitchW = 0;
	yawW = 0;
	currentPose = new Pose();
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:8,代码来源:MyoThalmic.java


示例3: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
	currentPose = pose;
	if (currentPose.getType() == PoseType.FIST) {
		myo.vibrate(VibrationType.VIBRATION_MEDIUM);
	}		
	invoke("publishPose", pose);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:9,代码来源:MyoThalmic.java


示例4: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
   public void onPose(Myo myo, long timestamp, Pose pose) {
currentPose = pose;
if (currentPose.getType() == PoseType.FIST) {
    myo.vibrate(VibrationType.VIBRATION_MEDIUM);
}
   }
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:8,代码来源:DataCollector.java


示例5: connect

import com.thalmic.myo.Pose; //导入依赖的package包/类
public void connect() {
  if (hub == null) {
    // FIXME - put in connect
    try {
      currentPose = new Pose();
      hub = new HubProxy();
    } catch (Exception e) {
      Logging.logError(e);
    }
  }

  if (myo == null) {
    info("Attempting to find a Myo...");
    myo = hub.waitForMyo(10000);
  }

  if (myo == null) {
    error("Unable to find a Myo");
    isConnected = false;
    return;
  }

  info("Connected to a Myo armband!");
  hub.addListener(this);

  if (hubThread == null) {
    hubThread = new HubThread(this);
    hubThread.start();
  }

  isConnected = true;
  myo.requestBatteryLevel();
  broadcastState();
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:35,代码来源:MyoThalmic.java


示例6: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
  currentPose = pose;
  myodata.currentPose = pose.getType().toString();
  if (currentPose.getType() == PoseType.FIST) {
    myo.vibrate(VibrationType.VIBRATION_MEDIUM);
  }
  invoke("publishPose", pose);
  invoke("publishMyoData", myodata);
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:11,代码来源:MyoThalmic.java


示例7: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
	currentPose = pose;
	if (currentPose.getType() == PoseType.FIST) {
		myo.vibrate(VibrationType.VIBRATION_MEDIUM);
	}
}
 
开发者ID:NicholasAStuart,项目名称:myo-java,代码行数:8,代码来源:DataCollector.java


示例8: onOrientationData

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onOrientationData(Myo myo, long timestamp, Quaternion rotation) {
  updateValues(rotation);
  if(mPanningEnabled) {
    //X Factor
    normalizeYaw();
    double yawDiff = ((mCurrentYaw - mStartingYaw) * -1.0) / DIV;
    if(Math.abs(yawDiff) >= THRESHOLD) {
      yawDiff = (yawDiff < 0) ? yawDiff*yawDiff*-1.0 : yawDiff*yawDiff;
      xFactor = factorBase + yawDiff;
    } else {
      xFactor = factorBase;
    }

    //Y Factor
    double pitchDiff = ((mCurrentPitch - mStartingPitch) * -1.0) / DIV;
    if(Math.abs(pitchDiff) >= THRESHOLD) {
      pitchDiff = (pitchDiff < 0) ? pitchDiff*pitchDiff*-1.0 : pitchDiff*pitchDiff;
      yFactor = factorBase + pitchDiff;
    } else {
      yFactor = factorBase;
    }
    if(mPanTimer == null) {
      mPanTimer = new Timer();
      mPanTimer.schedule(new PanTimerTask(), 0, 16 /*16ms ensure 60Hz refresh rate*/);
    }
  }
  if(myo.isUnlocked() && mCurrentPose == Pose.FIST) {
    normalizeRoll();
    double rollDiff = mCurrentRoll - mStartingRoll;
    if(Math.abs(rollDiff) >= 5.0) {
      double newRoll = mMapView.getRotationAngle() + rollDiff;
      mMapView.setRotationAngle(newRoll);
    }
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:37,代码来源:MyoMapListener.java


示例9: onOrientationData

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onOrientationData(Myo myo, long timestamp, Quaternion rotation) {
  updateValues(rotation);
  if(mPanningEnabled) {
    //X Factor
    normalizeYaw();
    double yawDiff = ((mCurrentYaw - mStartingYaw) * -1.0) / DIV;
    if(Math.abs(yawDiff) >= THRESHOLD) {
      yawDiff = (yawDiff < 0) ? yawDiff*yawDiff*-1.0 : yawDiff*yawDiff;
      xFactor = factorBase + yawDiff;
    } else {
      xFactor = factorBase;
    }

    //Y Factor
    double pitchDiff = ((mCurrentPitch - mStartingPitch) * -1.0) / DIV;
    if(Math.abs(pitchDiff) >= THRESHOLD) {
      pitchDiff = (pitchDiff < 0) ? pitchDiff*pitchDiff*-1.0 : pitchDiff*pitchDiff;
      yFactor = factorBase + pitchDiff;
    } else {
      yFactor = factorBase;
    }
    if(mPanTimer == null) {
      mPanTimer = new Timer();
      mPanTimer.schedule(new PanTimerTask(), 0, 16 /*16ms ensures 60Hz refresh rate*/);
    }
  }
  if(myo.isUnlocked() && mCurrentPose == Pose.FIST) {
    normalizeRoll();
    double rollDiff = mCurrentRoll - mStartingRoll;
    if(Math.abs(rollDiff) >= 5.0) {
      double newRoll = mMapView.getRotationAngle() + rollDiff;
      mMapView.setRotationAngle(newRoll);
    }
  }
}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:37,代码来源:MyoMapControlListener.java


示例10: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
    super.onPose(myo, timestamp, pose);

    // doesn't lock the Myo until an explicit action is done
    // such as myo.lock()
    myo.unlock(Myo.UnlockType.HOLD);

    // unused cases are in the following list just for tutorial purposes
    switch (pose) {
        case DOUBLE_TAP:
            // double tap works as a locker/unlocker
            myo.lock();
            break;
        case WAVE_IN:
            mCallback.onPoseRecognition(Actions.LEFT);
            break;
        case WAVE_OUT:
            mCallback.onPoseRecognition(Actions.RIGHT);
            break;
        case REST:
            // noop
            break;
        case FIST:
            mCallback.onPoseRecognition(Actions.FORWARD);
            break;
        case FINGERS_SPREAD:
            mCallback.onPoseRecognition(Actions.BACKWARD);
            break;
        case UNKNOWN:
            // noop
            break;
    }
}
 
开发者ID:palazzem,项目名称:android-udoo-rover,代码行数:35,代码来源:DeviceListener.java


示例11: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long l, Pose pose)
{
	currentPose = pose;
}
 
开发者ID:hcmlab,项目名称:ssj,代码行数:6,代码来源:MyoListener.java


示例12: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
    // Handle the cases of the Pose enumeration
    Gesture gesture = null;
    switch (pose) {
        case UNKNOWN:
            gesture = Gesture.UNKNOWN;
            break;
        case REST:
            gesture = Gesture.REST;
            break;
        case DOUBLE_TAP:
            gesture = Gesture.DOUBLE_TAP;
            break;
        case FIST:
            gesture = Gesture.FIST;
            break;
        case WAVE_IN:
            gesture = Gesture.WAVE_IN;
            break;
        case WAVE_OUT:
            gesture = Gesture.WAVE_OUT;
            break;
        case FINGERS_SPREAD:
            gesture = Gesture.FINGERS_SPREAD;
            break;
    }

    MyoGestureDataFrame frame = new MyoGestureDataFrame(MyoSensor.this, timestamp, gesture);
    sendNewData(frame);

    if (pose != Pose.UNKNOWN && pose != Pose.REST) {
        // Tell the Myo to stay unlocked until told otherwise. We do that here so you can
        // hold the poses without the Myo becoming locked.
        myo.unlock(Myo.UnlockType.HOLD);
        // Notify the Myo that the pose has resulted in an action, in this case changing
        // the text on the screen. The Myo will vibrate.
        myo.notifyUserAction();
    } else {
        // Tell the Myo to stay unlocked only for a short period. This allows the Myo to
        // stay unlocked while poses are being performed, but lock after inactivity.
        myo.unlock(Myo.UnlockType.TIMED);
    }
}
 
开发者ID:gradlman,项目名称:SensorLib,代码行数:45,代码来源:MyoSensor.java


示例13: addPoseListener

import com.thalmic.myo.Pose; //导入依赖的package包/类
public void addPoseListener(Service service){
	addListener("publishPose", service.getName(), "onPose", Pose.class);
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:4,代码来源:MyoThalmic.java


示例14: publishPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
public Pose publishPose(Pose pose){
	return pose;
}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:4,代码来源:MyoThalmic.java


示例15: DataCollector

import com.thalmic.myo.Pose; //导入依赖的package包/类
public DataCollector() {
rollW = 0;
pitchW = 0;
yawW = 0;
currentPose = new Pose();
   }
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:7,代码来源:DataCollector.java


示例16: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
   public void onPose(Myo myo, long timestamp, Pose pose) {
System.out.println(String.format("Myo %s switched to pose %s.", identifyMyo(myo), pose.toString()));
   }
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:5,代码来源:PrintMyoEvents.java


示例17: processData

import com.thalmic.myo.Pose; //导入依赖的package包/类
public void processData(Myo myo, long timestamp, long timestampDiff, Pose pose, DataType type) {
	
	Log.i("ExerciseManager","ExerciseManager - Pose: "+pose);
	
	if (pose.equals(Pose.WAVE_OUT) || pose.equals(Pose.WAVE_IN)) {
	
		// Next Exercise
		
		if (prevPose != null && !similar_wave(pose,prevPose))
			next();
		else if (timestamp - timestampDiff > TIME_DIFF && prevPose != null && similar_wave(pose,prevPose))
			next();
	
		timestampDiff = timestamp;
	
	} else if (pose.equals(Pose.FIST)) {
		nextSet();
	} else if (pose.equals(Pose.FINGERS_SPREAD)) {
		endSet();
	}
	
	prevPose = pose;
	
	this.update();
	
}
 
开发者ID:myofit,项目名称:MyoFit,代码行数:27,代码来源:ExerciseManager.java


示例18: publishPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
public Pose publishPose(Pose pose) {
  return pose;
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:4,代码来源:MyoThalmic.java


示例19: DataCollector

import com.thalmic.myo.Pose; //导入依赖的package包/类
public DataCollector() {
	rollW = 0;
	pitchW = 0;
	yawW = 0;
	currentPose = new Pose();
}
 
开发者ID:NicholasAStuart,项目名称:myo-java,代码行数:7,代码来源:DataCollector.java


示例20: onPose

import com.thalmic.myo.Pose; //导入依赖的package包/类
@Override
public void onPose(Myo myo, long timestamp, Pose pose) {
  if(!myo.isUnlocked() && pose != Pose.DOUBLE_TAP) { return; }
  // Swap wave poses if the Myo is on the left arm. Allows user to "wave" right or left
  // regardless of the Myo arm and have the swipes be in the appropriate direction.
  if (mArm == Arm.LEFT) {
    if (pose == Pose.WAVE_IN) {
      pose = Pose.WAVE_OUT;
    } else if (pose == Pose.WAVE_OUT) {
      pose = Pose.WAVE_IN;
    }
  }

  // Dispatch touch pad events for the standard navigation controls based on the
  // current pose.
  switch (pose) {
    case DOUBLE_TAP:
      if(myo.isUnlocked()) {
        lock(myo);
      } else {
        unlock(myo);
      }
      break;
    case FIST:
      mStartingRoll = mCurrentRoll;
      break;
    case FINGERS_SPREAD:
      if(mPanningEnabled) {
        stopPanning(myo);
      } else {
        startPanning(myo);
      }
      break;
    case WAVE_IN:
      if(!mZoomingEnabled) {
        startZooming(mZoomoutFactor);
      }
      break;
    case WAVE_OUT:
      if(!mZoomingEnabled) {
        startZooming(mZoominFactor);
      }
      break;
    case REST:
      switch(mCurrentPose) {
        case WAVE_IN:
        case WAVE_OUT:
          stopZooming();
          break;
      }
      break;
  }
  mCurrentPose = pose;
}
 
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:55,代码来源:MyoMapListener.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java TestPipeline类代码示例发布时间:2022-05-23
下一篇:
Java HostParams类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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